PHP sessions problems -
i'm using sessions save ever user types in form , ever type displayed on other pages.
it working fine after server uploads , such code has done 1 on me , i'm lost.
can see if can spot mistake? need fresh eyes.
html.
<div id="form"><!--form start--> <form action="home.php" method="post"> <p>enter name <input type="text" id="full_name" name="fullname" class="name_input"/> <input type="submit" name="submit" value="submit" /> </p> </form> </div><!--form end-->
php.
<?php session_start(); // declaring variable if(isset($_post['fullname'])){ //setting variable if(empty($_post['fullname'])){ //if empty dont nothing wep page reload }else{ //if have $_session['fullname'] = $_post['fullname']; //get session name (from from) header("location: home.php"); //then direct user home page (will display name on each page) }} ?>
session on other pages
<div id="echo"> <!-- div echo start --> <?php echo $_session['fullname'] ?> </div> <!--div echo end -->
$_session['fullname'] = $_post['fullname']; session_register(fullname);
replace code try it
Comments
Post a Comment