spearchilduser Posted March 28, 2012 Share Posted March 28, 2012 i have problem : I have a page(page1) that sends details to the login page(page2) to check if the details are correct checks these and if there is a match it directs them to the next page.(page 3) The page1 sends 3 details to the page 2 that are stored into variavles but as there is no submittion when they check the details how do i then send these details onto the page 3 ? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted March 28, 2012 Share Posted March 28, 2012 use sessions session_start page2.php session_start(); $_SESSION['val1'] = $_POST['val1']; header("location: page3.php"); exit; page3.php session_start(); echo $_SESSION['val1']; Quote Link to comment Share on other sites More sharing options...
spearchilduser Posted March 28, 2012 Author Share Posted March 28, 2012 ok the on page 3 can i then delete this from the session becuase on page 3 i store them into a tbale so i dont need them any more Quote Link to comment Share on other sites More sharing options...
spearchilduser Posted March 28, 2012 Author Share Posted March 28, 2012 or clear them Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted March 28, 2012 Share Posted March 28, 2012 you can use unset // unset 1 item unset($_SESSION['val1']); // unset multiple items unset($_SESSION['val1'], $_SESSION['val2'], $_SESSION['val3']); // unset all session data unset($_SESSION); Quote Link to comment Share on other sites More sharing options...
leitning Posted March 28, 2012 Share Posted March 28, 2012 Yeah, as LittleGuy said SESSION variables are the way to go in most cases, but you could also use GET variables depending on the situation. For example using GET variables could allow an external link to submit to the page as well; which could either be incredibly helpful or disastrous. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.