*

Recent

Author Topic: Login on home page  (Read 4667 times)

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Login on home page
« on: May 16, 2009, 08:53:45 PM »
Open up the header.php file located: /YOURSITE.com/templates/default

and add this in either the left or right column:
Code: [Select]
<?php
if(!isset($suserid)){
echo 
'
<tr>
<td class="header2">Log In:</td>
</tr>
<tr>
<td class="content2">
<form action="'
.$domain.'/login/" method="POST">
Username:<br /> 
<input type="text" name="username">
Password:<br /> 
<input type="password" name="password">
<input type="submit" name="submit" value="Login">  Or  <a href="'
.$domain.'/signup/">Sign Up</a>
</form>
</td>
</tr>'
;
}else{
echo 
'
<tr>
<td class="header2">Hey!</td>
</tr>
<tr>
<td class="content2">
Hey, <b>'
.$usrdata['username'].'</b>
<br />
You\'r logged in!
</td>
</tr>'
;
}
?>

(if you want it in the right column open up the footer.php file)

any questions about this script, just ask!
« Last Edit: May 16, 2009, 10:17:56 PM by adamlacombe »

Trasion

  • Guest
Re: Login on home page
« Reply #1 on: July 20, 2009, 05:31:37 PM »
Adam, no offense, but I thought that yours looked quite boring, and all together, and out of place. I tweaked it up a bit, here's the codes:

Code: [Select]
<table width="100%">



<?php
if(!isset($suserid)){
echo 
'
<tr>
<td class="header2">Login</td>
</tr>
<tr>
<td class="content2">
<form action="'
.$domain.'/login/" method="POST">
&nbsp;<strong>Username:</strong><br /> 
<center><input type="text" name="username"></center><br />
&nbsp;<strong>Password:</strong><br /> 
<center><input type="password" name="password"></center><br />
<div align="right"><input type="submit" name="submit" value="Login">&nbsp;&nbsp;</div><br /><center>Need an account?<br /><a href="'
.$domain.'/signup/">Sign up</a> now.</center>
</form>
</td>
</tr>'
;
}else{
echo 
'
<tr>
<td class="header2">Welcome</td>
</tr>
<tr>
<td class="content2">
Hello, <b>'
.$usrdata['username'].'</b> (<a href="http://zoovix.com/myaccount/">edit</a>)<br /><br />Enjoy the arcade, and have a great time!<br /><br /> Had enough of the arcade?
Click <a href="'
.$domain.'/logout/">here</a> to logout.<br /><br /></td></tr>';
}
?>
</table>

Credits to Adam still. :) If this is against the rules, please let me know and I'll remove. I just thought that it might help some people out.

All I did was change what was written, and added a few more things. The core code was made by Adam, I take no credit for this.

(You can also remove the "My Menu" thing now too. I put all the links in this. Except for the admin panel, and admin blog one, but you can memorize those!)

It looks much neater than having this login box, AND a My Menu box.
« Last Edit: July 20, 2009, 05:43:37 PM by Trasion »

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Login on home page
« Reply #2 on: July 20, 2009, 05:49:44 PM »
lol its fine, I just made it very basic, no links..
But when I made it, there was no "My menu".