jsucupira Posted August 29, 2007 Share Posted August 29, 2007 I got the code: but I am not sure how the login.php and logout.php files should be. can anyone gimme a example? i'll highly appreciate <?php if(isset($session[userid])){ // Member is logged in so we have to display welcome message with userid and one logout link echo "<tr><td align=center'><strong><font color='#FFFFFF'>Welcome $session[username]</font></strong></td></tr> <tr> <td><font color='#FFFFFF'><strong><a href='logout.php'>LOGOUT</a></strong></font></td></tr> "; }else { // Member has not logged in so we can display the login form allowing member to login with user id and password echo "<form name='login' method='post' action='loginck.php' style='margin:0px'> <tr><td width='37%'><strong><font color='#FFFFFF'>Username</font></strong></td> <td width='58%'><input name='id' type='text' class='field' id='username22' size='14'></td> </tr> <tr><td><strong><font color='#FFFFFF'>Password</font></strong></td> <td><input name='pw' type='password' class='field' id='password227' size='14'></td> </tr> <tr><td> <a href='forgot.php'>Forgot password</a></td> </tr></form>"; } // End of else condtiion echo "</table>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/67182-solved-help-with-loginphp/ Share on other sites More sharing options...
trq Posted August 29, 2007 Share Posted August 29, 2007 Can you please be a bit more specific with your actual question? And please post code between [ code ] [ /code ] tags (without the spaces). Quote Link to comment https://forums.phpfreaks.com/topic/67182-solved-help-with-loginphp/#findComment-336984 Share on other sites More sharing options...
matthewhaworth Posted August 29, 2007 Share Posted August 29, 2007 And it's not $session it's $_SESSION. Quote Link to comment https://forums.phpfreaks.com/topic/67182-solved-help-with-loginphp/#findComment-336985 Share on other sites More sharing options...
jsucupira Posted August 29, 2007 Author Share Posted August 29, 2007 I wanted to know how to code the page login.php, I wanted to find an example of a login.php page. also what do you mean not by "post code between [ code ] [ /code ] tags (without the spaces)." Quote Link to comment https://forums.phpfreaks.com/topic/67182-solved-help-with-loginphp/#findComment-336991 Share on other sites More sharing options...
matthewhaworth Posted August 29, 2007 Share Posted August 29, 2007 I wanted to know how to code the page login.php, I wanted to find an example of a login.php page. also what do you mean not by "post code between [ code ] [ /code ] tags (without the spaces)." Notice that when you posted your PHP it looked like this <?php // I am php echo "blah"; ?> if you put them in [code][/code] tags it'll look like this <?php // I am php echo "blah"; ?> And it is a lot easier to read. You can auto-insert these code tags by clicking the hash button in the menu located above where you type your post. <?php if(isset($session[userid])){ // Member is logged in so we have to display welcome message with userid and one logout link echo "<tr><td align=center'><strong><font color='#FFFFFF'>Welcome $session[username]</font></strong></td></tr> <tr> <td><font color='#FFFFFF'><strong><a href='logout.php'>LOGOUT[/url]</strong></font></td></tr> "; }else { // Member has not logged in so we can display the login form allowing member to login with user id and password echo "<form name='login' method='post' action='loginck.php' style='margin:0px'> <tr><td width='37%'><strong><font color='#FFFFFF'>Username</font></strong></td> <td width='58%'><input name='id' type='text' class='field' id='username22' size='14'></td> </tr> <tr><td><strong><font color='#FFFFFF'>Password</font></strong></td> <td><input name='pw' type='password' class='field' id='password227' size='14'></td> </tr> <tr><td> <a href='forgot.php'>Forgot password[/url]</td> </tr></form>"; } // End of else condtiion echo "</table>"; ?> Your code will look like that. After reading your code, realise that you can't end an <a> tag with [/url]. That's BBCode. Quote Link to comment https://forums.phpfreaks.com/topic/67182-solved-help-with-loginphp/#findComment-336993 Share on other sites More sharing options...
trq Posted August 29, 2007 Share Posted August 29, 2007 I'm sorry, but there are many tutorials already written that cover the subject of php logins (many free on the net). This board is for help with specific problems with existing code. As for the [ code ] tags. f you place your code within them you will get it properly formated like so... <?php echo "this is foo"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/67182-solved-help-with-loginphp/#findComment-336994 Share on other sites More sharing options...
jsucupira Posted August 29, 2007 Author Share Posted August 29, 2007 thnx matthe. and thorpe I'll do some more web searchs :/ Quote Link to comment https://forums.phpfreaks.com/topic/67182-solved-help-with-loginphp/#findComment-336997 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.