![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Grytpype-Thynne <geraldIDONTWANTSPAMbramwell@hotmail.com> wrote in news:MPG.19937ed178ef5b79896e5@news.individual.net : > Hi, > > I have a membership application form on the Animals in Distress website > at http://www.animals-in-distress.net/memapp.htm for people to fill in > then print and send with a cheque, I have been told it is possible to > have it place the amount in the Amount Enclosed box automatically > depending on the numbers and costs of memberships. > > Can someone point me in the direction of a tutorial or script that would > do this, I have not yet delved into php but am going to start. > > Thanks > > Gerald > First, let me say kudos on the subject matter of that site. Very noble cause indeed. Second, let me be sure I am clear on what you are looking to do. Someone comes to the site, chooses 1-9 on your membership page and you would like to have it fill in the "Amount Enclosed" text box automatically based on what they select? If so, it is possible but you won't use PHP. PHP is a server side script and what you are looking to do is client side. You'll need some Javascript - more specifically the "onchange" javascript event. Looking at your code it seems you are using a code generating app, like FrontPage, and I have no idea if an example from me would break that code or not, since I have never used one of those applications, so I won't try it. But the "onChange" javascript function is what you need. HTH, -- Pixel McGee "The world is coming to an end. Please log off." | |||
|
| Advertisements |
| | #2 | ||
| In article <Xns93C9ADC02D628pixelmcgee@199.45.49.11>, pixel@nospam.invalid says... > onchange > thanks for your reply and your comment, I asked because I had been given the following information to the question in another group Yes, simply make the form page a php e.g. memapp.php and set the action to self e.g. echo " <form method=\"post\" action=\"$PhP_SELF\">\n"; By passing any variables back to itself via the form call you can then get parse the variables and return the result in the shape of the completed form with the amount (totaled) etc. Gerald | |||
|
| | #3 | ||
| In article <i35jivcd4et9g7ig3vq0442aj7ro5bgvsu@4ax.com>, ian@WINDOZEdigiserv.net says... > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Whilst lounging around on Thu, 31 Jul 2003 23:02:34 +0100, > Grytpype-Thynne <geraldIDONTWANTSPAMbramwell@hotmail.com> amazingly > managed to produce the following with their Etch-A-Sketch: > > > In article <Xns93C9ADC02D628pixelmcgee@199.45.49.11>, > > pixel@nospam.invalid says... > > > onchange > > > > > thanks for your reply and your comment, I asked because I had been > > given the following information to the question in another group > > > > > > > > Yes, simply make the form page a php e.g. memapp.php and set the > > action to > > self > > e.g. > > echo " <form method=\"post\" action=\"$PhP_SELF\">\n"; > ^^^^^^^^^ > > VERY BAD coding practice. > > > > > > By passing any variables back to itself via the form call you can > > then get > > parse the variables and return the result in the shape of the > > completed form > > with the amount (totaled) etc. > > > > Gerald > > > echo "<form method=\"post\" action=\"{$_SERVER['PHP_SELF']}\">\n"; > > > > Regards, > > Ian > > -----BEGIN PGP SIGNATURE----- > Version: PGP 8.0 > > iQA/AwUBPymUrWfqtj251CDhEQIqIgCePMbZOEWtiQWeWFYzVAOJcQ Wi7KIAoLcI > tPzzqqkUyPqbS/kvmWZnm4Jl > =6wk1 Thanks Ian, Could you possibly point me in the direction of more info on this or somewhere I can get a script, as I have not yet started on php. Gerald | |||
|
| | #4 | ||
| -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Whilst lounging around on Fri, 1 Aug 2003 18:11:31 +0100, Grytpype-Thynne <geraldIDONTWANTSPAMbramwell@hotmail.com> amazingly managed to produce the following with their Etch-A-Sketch: > Thanks Ian, > > Could you possibly point me in the direction of more info on this > or somewhere I can get a script, as I have not yet started on php. Gerald, Have a look on http://www.php.net/ _the_ best reference you'll find =) I'll explain my point to clarify anyway: $PHP_SELF was / is fine if register_globals are enabled.. but this opens up security concerns as no checks are done to see if the data has come from say, a GET URL (foo.com?bar=bleh) or if from a POST method in a form.. or from a cookie, session var etc etc, so as you can see, this is somewhat insecure (or could be). Defining it as $_SERVER['PHP_SELF'] means that if I used foo.com?bar=php_self it'd fail, as that would only be available from $_GET['php_self']. You can find more indepth explanations on this again, on php.net is you doa search for "register_globals" and check out the security comments etc about it =) Also.. create a .php file with just: <?php phpinfo(); ?> Access it via a URL as you would normally, and it'll display a load of info regarding the server and PHP install. If you scroll down to the bottom of the page, you'll see lots more $_SERVER[] vars too, to which you can use in scripts too. As phpinfo() displays the output of such vars, you can see as to what each would contain too, to help you know of that's the one you want to use etc etc etc. HTH. Regards, Ian -----BEGIN PGP SIGNATURE----- Version: PGP 8.0 iQA/AwUBPyqhiWfqtj251CDhEQLwOwCgk9S4362LrjLGe3UHI8sBWx EyqhEAnRsw at9VHf1T+pOAqvP+KKe8pe1x =fXxf -----END PGP SIGNATURE----- -- Ian.H [Design & Development] digiServ Network - Web solutions www.digiserv.net | irc.digiserv.net | forum.digiserv.net Programming, Web design, development & hosting. | |||
|
| | #5 | ||
| In article <i38livskgpfs9n0lrg4teku13hlo5vr1rv@4ax.com>, ian@WINDOZEdigiserv.net says... > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Whilst lounging around on Fri, 1 Aug 2003 18:11:31 +0100, > Grytpype-Thynne <geraldIDONTWANTSPAMbramwell@hotmail.com> amazingly > managed to produce the following with their Etch-A-Sketch: > > > Thanks Ian, > > > > Could you possibly point me in the direction of more info on this > > or somewhere I can get a script, as I have not yet started on php. > > > Gerald, > > Have a look on http://www.php.net/ _the_ best reference you'll find > =) > > I'll explain my point to clarify anyway: > > > $PHP_SELF was / is fine if register_globals are enabled.. but this > opens up security concerns as no checks are done to see if the data > has come from say, a GET URL (foo.com?bar=bleh) or if from a POST > method in a form.. or from a cookie, session var etc etc, so as you > can see, this is somewhat insecure (or could be). Defining it as > $_SERVER['PHP_SELF'] means that if I used foo.com?bar=php_self it'd > fail, as that would only be available from $_GET['php_self']. > > You can find more indepth explanations on this again, on php.net is > you doa search for "register_globals" and check out the security > comments etc about it =) > > Also.. create a .php file with just: > > > <?php phpinfo(); ?> > > > Access it via a URL as you would normally, and it'll display a load > of info regarding the server and PHP install. If you scroll down to > the bottom of the page, you'll see lots more $_SERVER[] vars too, to > which you can use in scripts too. As phpinfo() displays the output of > such vars, you can see as to what each would contain too, to help you > know of that's the one you want to use etc etc etc. > > > HTH. > > Thanks again, only a month ago I did not have access to php on the host but thanks to someone donating hosting to us I have found there are lots of things I can use. By the way before I started the site for Animals in Distress I didn't know anything about html. Gerald | |||
|
| Featured Websites | ||||
|
![]() |
| Tags: help, newbie |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CSS Newbie needs help | tom watson | HTML | 1 | 07-01-2007 1:24 PM |
| Newbie needs help | Dave Patton | GPS | 6 | 06-25-2007 11:45 PM |
| Newbie needs help please | Stingray | Graphics in general | 0 | 06-11-2007 7:19 PM |
| Newbie needs help! | Kai Robinson | Graphics in general | 4 | 06-11-2007 7:09 PM |
| newbie | jawsquip | Ebay Technical Questions | 8 | 05-30-2007 1:40 AM |
| Featured Websites | ||||
|