RE: [PHP] Passing Arguments

From: Date: Fri, 17 Nov 2000 02:27:48 +0000
Subject: RE: [PHP] Passing Arguments
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-25846@lists.php.net to get a copy of this message
Hi, Hope this helps for the first question. Basic form. <? if($caller=="coolpage") { //double validate data through php //process data //set msg variable to success or something //redirect user maybe } ?> <html> <head> <title>Cool Page</title> <script> // some sort of validation </script> </head> <body> <? echo $Msg; ?> //your select box <input type="submit" name="submit" value="Submit" onSubmit="/*some javascript validation function */"> <input type="hidden" name="caller" value="coolpage"> </body> </html> So what happens is that when the user first comes to the page, the data is not processed because $caller does not equal to "coolpage". The user selects something from your select box then clicks submit. The selection is validated through JavaScript. When the page is submitted the hidden field caller is set to "coolpage". Then the data is validated again through PHP just to make sure it's all ok. When the page is submitted the data is now proceeds to process the data because $caller=="coolpage". Hope this helps. Matt Stone -----Original Message----- From: Thomas Holton [mailto:holton@mbi.ucla.edu] Sent: Friday, 17 November 2000 12:14 PM To: php-general@lists.php.net Subject: [PHP] Passing Arguments Hello. I have a php file that accesses my mysql database, displays some of the database data in <select> lists, along with some other listings. This all works great. What i want to do now is take some of the arguments that are selected and update the sql database with those values. What i dont understand is how I am going to pass these selections to a second php script in order to do the mysql statement there. So, i guess my question is two part: 1. Is there some way to use the submit button on the same page to do an update command, OR 2. How do i pass the arguments to another php script where i do know how to do the new mysql update command. Thanks in advance! tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#25846) next »