am an amateur to PHP scripting.so kindly point out the blunders!
I am trying to pass on a session variable,basically to welcome a user to his webpage.
The code goes like this :
Code: Select all
<html>
<title>Session test page</title>
<body>
<form action ="welcome.php" method="post"
<p>NAME <input type = "text" name="fname" maxlength = "50"/></p>
<p>PASSWORD <input type="password" name="password"/></p>
<p><input type="SUBMIT" name="fsubmit" value="submit"/></p>
</form>
<?php
session_start();
$_SESSION['username']=$_POST['fname'];
?>
</body>
</html>
Code: Select all
<html>
<body>
<?php
session_start();
echo $_SESSION['username'];
?>
</body>
The problem is when I submit the form saying name and password , am unable to see any output after i submit the form,
Suppose
NAME : ABCDE
password : ******
then after hitting submit i shld get ABCDE in my webpage,which doesn't happen
Kindly help me out!