PDA

View Full Version : PHP Passing Variables



Sorcerer
June 18th, 2003, 02:50 PM
Using php is there a way to POST variables from one page to another without a form? Or maybe there is another way to do what I am wanting.

I have a form and the first thing it does on submit is validate 4 fields in the form, if one of these fields doesn't validate I want to return the user to the form with all of the information they put in. Along with a message saying they didn't fill in all required fields.

Jubba
June 18th, 2003, 03:01 PM
I think the only way to do it with PHP is to redirect them back to the page but add the varaibles to the URL string...


www.something.com/something.php?name=Jubba&place=Kirupaform.com


The better way would be to use Javascript to validate the form. Works faster client side rather than having the server process the information...

Sorcerer
June 18th, 2003, 03:03 PM
Haven't worked a whole lot with javascript, know any good sites where I could find the information on how to validate the form with it?

Jubba
June 18th, 2003, 03:06 PM
http://www.google.com/search?hl=en&ie=utf-8&oe=utf-8&q=javascript+form+validation

Sorcerer
June 18th, 2003, 03:06 PM
google is good, thanks for the quick reply.

Jubba
June 18th, 2003, 03:10 PM
:)