Jump to content

Amateur Elements

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Amateur Elements's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok, im very new to php. I mostly only understand using SQL and PRINT funtions. I own the web site amateurelements.com and i am making a new portal for it. How ever i dont know jack crap about log in scripts. Heres what i have [u][b]LogIn Form[/b][/u] [code]<?php if ($_SESSION['user']) { ?>   <?php print "<font class=\"greyfont\">"; ?>   <b><?php print $_SESSION['user']; ?></b> LOGGED   &nbsp;&nbsp;&nbsp;<a href="http://amateurelements.com/Forum/index.php?action=profile">   <?php print "<font class=\"greylink\">"; ?>PROFILE<?php print "</font>"; ?></a>   - <a href="http://www.amateurelements.com/submit.php">   <?php print "<font class=\"greylink\">"; ?>SUBMIT CONTENT<?php print "</font>"; ?></a>   - <a href="http://www.amateurelements.com/logout.php">   <?php print "<font class=\"greylink\">"; ?>LOGOUT<?php print "</font>"; ?></a> <? } else { ?> <img src="http://www.amateurelements.com/spacer.gif" width="1" height="2" /> <form action="http://www.amateurelements.com/login.php" method="post" name="LogInForm" id="LogInForm"> <input type="text" name="username" id="username" value="USER NAME" onclick="value=''" style="height:20; background-color:666666; color:eedd00; font:'BankGothic Md BT';" /> &nbsp; <input type="password" name="password" id="password" value="PASSWORD" onclick="value=''" style="height:20; background-color:666666; color:eedd00; font:'BankGothic Md BT';" /> &nbsp; <input type="submit" name="login" id="login" value="- LOG -" style="height:20; background-color:666666; color:eedd00; font:'BankGothic Md BT';" /> </form> <?php print "<font class=\"greyfont\">"; ?> Not a member yet? Click <a href="http://www.amateurelements.com/Forum/register.php"> <?php print "<font class=\"greylink\">"; ?>here</font></a> to register and start uploading!</font> <? } ?>[/code] [b][u]LogIn Script[/u][/b] [code]<?php include("http://www.amateurelements.com/CONFIG/STYLE.php"); ?> <?php session_start; ?> <?php $conn = mysql_pconnect("localhost", "amateur", "") or die(mysql_error()); @mysql_select_db(amateur_smf1, $conn) or die(mysql_error()); ?> <?php   if ($_GET['login']) {   $user = $_POST['username'];   $pass = $_POST['password'];   $sql = mysql_query("SELECT * FROM amateur_smf1.members WHERE memberName = '$user' AND passwd = '$pass'", $conn)   or die(  mysql_error());   if (mysql_num_rows($sql) == 1) {   $error = false;   $_SESSION['user'] = $user;   setcookie("user", $user, 0, "/", "amateurelements.com");   print "<?php include(\"http://www.amateurelements.com/logged.php\"); ?>"; ?> <?php   } else {   $error = "Incorrect username or password!";   }   } ?>[/code] [b][u]Logged.php[/u][/b] [code]<html><style type="text/css"> <!-- body,td,th {     font-family: BankGothic Md BT;     font-size: 14px;     color: #EEDD00; } body {     background-color: #666666;     margin-left: 5%;     margin-top: 5%;     margin-right: 5px;     margin-bottom: 5%; } --> </style> <center> <table width="90%" height="90%" cellpadding="0" cellspacing="0"><tr> <td width="100%" height="17" align="center" valign="top">     <table width="100%" height="17" cellpadding="0" cellspacing="0" bgcolor="#EEDD00"><tr>     <td width="17" bgcolor="#EEDD00" align="center" valign="top">         <img src="Images/Basic-Images/Corner-TL.gif">     </td><td width="100%" height="17" background="Images/Backgrounds-Borders/MainBorder-Top.gif"     style="background-repeat:repeat-x;">         <img src="spacer.gif" width="1" height="10">     </td><td width="17" height="17" bgcolor="#EEDD00" align="center" valign="top">         <img src="Images/Basic-Images/Corner-TR.gif">     </td></tr></table> </td></tr><tr><td width="100%" height="100%" align="center" valign="top">     <table width="100%" height="100%" cellpadding="0" cellspacing="0" bgcolor="#EEDD00"><tr>     <td width="10" height="100%" background="Images/Backgrounds-Borders/MainBorder-Left.gif"     style="background-repeat:repeat-y;">         <img src="spacer.gif" width="10" height="100%">     </td><td width="100%" height="100%" align="center" valign="middle" bgcolor="#EEDD00">         <br><br>         <font size="6" face="BankGothic Md BT" color="#666666">           LOGGED IN         </font><br><br>         <font class="<?php print "$greylink"; ?>">           <a href="http://www.amateurelements.com/home.php">           click here to go back to the index page</a>         </font>     </td><td width="10" height="100%" background="Images/Backgrounds-Borders/MainBorder-Right.gif"     style="background-repeat:repeat-y;">         <img src="spacer.gif" width="10" height="100%">     </td></tr></table> </td></tr><tr><td width="100%" height="17" align="center" valign="bottom">     <table width="100%" height="17" cellpadding="0" cellspacing="0" bgcolor="#EEDD00"><tr>     <td width="17" height="17" bgcolor="#EEDD00" align="center" valign="bottom">         <img src="Images/Basic-Images/Corner-BL.gif">     </td><td width="100%" height="17" background="Images/Backgrounds-Borders/MainBorder-Bottom.gif"     style="background-repeat:repeat-x; background-position:bottom;" valign="bottom">         <img src="spacer.gif" width="1" height="10">     </td><td width="17" height="17" bgcolor="#EEDD00" align="center" valign="bottom">         <img src="Images/Basic-Images/Corner-BR.gif">     </td></tr></table> </td></tr></table> </center> </html>[/code]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.