[thelist] calling a php file and submitting a form?

RUST Randal RRust at COVANSYS.com
Wed Jan 8 14:41:01 CST 2003


Tom Dell'Aringa said:

> a) user fills in form

> b) submit form (post)

> c) before the form goes to the next page (onsubmit()) - I
> need to copy the values from the form and run a php script..
> this means I either have to use javascript or post the form
> to 2 places..is this possible?

The values are passed to the next page via the $_GET or $_POST array,
depending on the method that you have selected from your form.  Say you have
a form input called "name." The value of "name" is passed to the next page
in the query string, and you can pull its value out of the string with...

if(isset($_GET['name'])){
	$name=$_GET['name']; }

So basically what you want to do is either have an intermediate page with
your PHP script on it that performs the actions on the data that you want.

Personally, I'd post the data to the same page as the form and check it
there.  Then forward the user if the data passes validation.

Randal



More information about the thelist mailing list