|
-
Jun 30th, 2009, 08:48 AM
#1
Thread Starter
Lively Member
page redirect upon submission
The action component of a form can be used to redirect to a page of choice when a form is submitted.
I have a form that contains several form elements. Depending on the choices that the user makes, the page has to be directed accordingly.
For example, if "a" condition is met, the page should load abc.php and if if "b" condition is met, the page should load def.php.
How can this be achieved in php. I don't want to use javascript because that will expose the variables (abc.php?name=so&id=23).
I understand that PHP is server side script and it can't do much about this, but is there a way where out?
What about this following method?
If the condition met is "b", I direct it to abc.php because that is explicitly mentioned in action="abc.php". In the abc.php, I validate if the condition was "a" or "b". If it is "b", I use header('Location: def.php'). Would this be ideal? Even if I were to redirect the page this way, would the submitted data also be passed to def.php?
Last edited by sridharao; Jun 30th, 2009 at 09:04 AM.
Save trees, avoid plastics, say no to zoo, go veg, recycle as much, live holistic
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|