php - getting post data from previous page -


I have two page pages one and one page_ two, when users enter some information in page_on that will be inserted into the database and when Enter that press, it should be directed to page 2 and within this page it is the same information that it has entered on page_one. And every time the user refreshes the problem, the data in page 2 is re-inserted into the database. I tried to fix this issue using a header on a new page, but it was entered in page_ two which was entered on page_on

page_one

  & lt; Form action = "page_one.php" method = "post" name = "info" & gt; & Lt; Input name = "userName" type = "text" / & gt; & Lt; Input name = "userEmail" type = "text" / & gt; & Lt; Input name = "userPass" type = "text" / & gt; & Lt; Input name = "submit" type = "submit" /> & Lt; / Form & gt; & Lt ;? Includes Php ('db.php'); If (isset ($ _ POST ['login'])) {$ user_name = $ _POST ['username']; $ User_email = $ _POST ['userEmail']; $ Password = $ _POST ['userPass']; Mysql_query ("Include user values ​​('$ user_name', '$ user_email', '$ password')"); Header ("location: page_two.php.php"); Go out; }? & Gt;  

Page_tev

  & lt; Php $ user_name = $ _POST ['username']; $ User_email = $ _POST ['userEmail']; $ Password = $ _POST ['userPass']; Your username resonates: '. $ User_name; Echo your email: '. $ User_email; Echo your password: '. $ Password; & Lt; Input name = "user name" type = "hidden" value = "& lt ;? php echo $ user_name ;? & gt;" / & Gt; & Lt; Input name = "userEmail" type = "hidden" value = " 

pass the variable on page 2 via the URL .

Then your header will be

  header ("location: page_tv.phppp.username = user_name and usermail = user_mail and userpages = Password ");  

Now these variables get $ _GET on page_ two

  and  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -