No it didn't work. See the full code here, when you enter the pass and user it will show to you the form to enter your name, but when you press "print Name" it will ask you again for the username and password and will never print yourname.
Code:<HTML dir="rtl"> <body> <center> <?php @session_start(); if($_POST['mkses']){ $_SESSION['id']=$_POST['id']; $_SESSION['pass']=$_POST['password']; } if($_SESSION['id']!="aaa" || $_SESSION['pass']!="aaa"){ echo '<form method="post" action='.$_SERVER[PHP_SELF].' >'; echo "<input type='text' name='id'><input type='text' name='password'>"; echo "<input type='submit' name='mkses' value='login'></form>"; exit; } ?> <?php if($_POST['tt']) echo $_POST['cname']; ?> <form action="<? $_SERVER['PHP_SELF']; ?>" method="post"> name <input type="text" name="cname"><BR> <input type="submit" name="tt" value="Print Name"> </form> </center> </body> </html>




Reply With Quote