Jump to content

Redirect and send post vars?


Recommended Posts

I have a page2.php. On there is a form. A required field is "phone" and the form sends POST to page3.php.

 

On page3.php i want to check if $_POST['phone'] is set, and if not, go back to page2.php and keep the postdata so I can automatically fill-in the form fields.

 

How can i do this?

Link to comment
https://forums.phpfreaks.com/topic/99366-redirect-and-send-post-vars/
Share on other sites

I would store it into a session variable.

Good idea, I'll try it.

 

Or, have page2.php POST to itself, then you don't have to redirect if it doesn't validate.

But if it DID validate on page2.php, I would still have to have it redirect to page3.php with the post vars. But thanks for the first suggestion. :)

 

I'll let you know how it goes. People, feel free to post more solutions.

 

Wes

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.