开发者

php - How to redirect page with post data

开发者 https://www.devze.com 2023-01-12 13:38 出处:网络
I have three pages as follows: 1> Form.php // users enter information, such as email, phone and is sent开发者_C百科 to registervalidate.php by POST method

I have three pages as follows:

1> Form.php // users enter information, such as email, phone and is sent开发者_C百科 to registervalidate.php by POST method
2> registervalidate.php // validate the user entered information
3> welcome.php // print the user information back to the user

I need to redirect registervalidate.php to welcome.php if the user information is valid and print enter information on page welcome.php.

Here is question:

How do I transfer the posted data from form.php and send them to welcome.php from page registervalidate.php.

My working environment is XAMPP+MySQL+PHP+jQuery on windows machine.

Thank you


You could use $_SESSION variables, then you have acces from anywhere ;-) But don't forget the session_start(); at first.


I would store the variables in a session, and then forward the user on, making sure the form now checks $_SESSION as well as $_POST


You can do it with $_GET (don't do it) or do it with cURL.


I would use javascript so

//your validation stuff...

if($valid)
{
    echo("<script language=\"javascript\">location.href=\"welcome.php?myvar1=".$myVar1"\";</script>");
}

edits... I suck at formatting

0

精彩评论

暂无评论...
验证码 换一张
取 消