php - Login form script change after introducing username and password -
i have form:
<div class="page3"> <form id="indexform" action="index.php" method="post"> <table class="datatable2" style="padding:20;" > <tr> <td><center>username </center><input type="text" name="name" value="" size="10" /></td> </tr> <tr> <td><center>password </center><input type="password" name="password" value="" size="10" /></td> </tr> <tr> <td colspan="2" class="datatable2" style="padding:55 0 0 38;"> <input type="submit" value="log in" name="admsubmit" class="subbtn" style="background-image: url(imagini/autentificare.png);background-repeat:no-repeat;background-position:10 5;background-size:17px;"/></form> </td> <tr> <td colspan="2" class="datatable2" style="padding:40 0 0 8;"> <form action="parola_uitata.php"> <input type="submit" align="right" value="ai uitat parola?" class="subbtn" style="background-image: url(imagini/parola_uitata.png);background-position:11;background-repeat:no-repeat;background-size:17px;margin:-45 1;padding-left:30;" name="parola_uitata"></form> </td> </tr> </table> </div>
image:
and want know how can hide after logging, , displaying in same div : hello ($_session['user'])
-- go admin panel. if can give me idea helpful me.
wrap if statement around markup, , display based on state of session (if logged in or not)
<div class="page3"> <?php if(!isset($_session['logged_in'])) : ?> <form id="indexform" action="index.php" method="post"> <table class="datatable2" style="padding:20;" > <tr> <td><center>username</center><input type="text" name="name" value="" size="10" /></td> </tr> <tr> <td><center>password </center><input type="password" name="password" value="" size="10" /></td> </tr> <tr> <td colspan="2" class="datatable2" style="padding:55 0 0 38;"> <input type="submit" value="log in" name="admsubmit" class="subbtn" style="background-image: url(imagini/autentificare.png);background-repeat:no-repeat;background-position:10 5;background-size:17px;"/></form> </td> <tr> <td colspan="2" class="datatable2" style="padding:40 0 0 8;"> <form action="parola_uitata.php"> <input type="submit" align="right" value="ai uitat parola?" class="subbtn" style="background-image: url(imagini/parola_uitata.png);background-position:11;background-repeat:no-repeat;background-size:17px;margin:-45 1;padding-left:30;" name="parola_uitata"> </form> </td> </tr> </table> <?php else : ?> <-- user logged in, show control panel stuff !--> <?php endif; ?> </div>
Comments
Post a Comment