php sessions wont save form data -
here's have far. problem when nail submit takes me next page, session not store first name. if remove action, it's action="" session saves first name. why happen , how prepare it?
...html stuff... <?php session_start(); if(isset($_post['submit'])){ $_session['firstname'] = $_post['firstname']; } ?> <form method="post" action="nextpage.php"> <input name="firstname" type="text" size="70"/> ... <input type="submit" name="submit" value="continue"/> </form>
$_post['firstname'] not exist, until post form info page itself. that's why setting action "" works, because posts form info itself.
otherwise, utilize these 2 lines of code in nextpage.php instead of here, , set session variable in nextpage instead.
session_start(); if(isset($_post['submit'])){ $_session['firstname'] = $_post['firstname']; }
php
No comments:
Post a Comment