Php(sessions)...how to put textbox value in session and pass it to another page?i m getting error -
<?php session_start(); ?> <form action="harddisk.php" method="post">//form <input type="text" name="user" /> <?php if(isset($_post['user'])) { $_session['userget']=$_post['user']; } ?> <input type="submit" value="submit" /> </form> 2nd page <?php session_start(); ?> <?php if (isset($_session['userget'])) { $form_value = $_session['userget']; } echo $form_value ; ?>
..........................................................................................................
you have used text box name check submit button name too.
<form action="harddisk.php" method="post">//form <input type="text" name="user" /> <input type="submit" value="submit" name="submit" /> </form> <?php session_start(); if(isset($_post['submit'])&&isset($_post['user'])) { $_session['userget']=$_post['user']; } ?>
and in second page
<?php session_start(); if (isset($_session['userget'])) { echo $form_value = $_session['userget']; }
Comments
Post a Comment