Robert Elsdon Posted May 5, 2008 Share Posted May 5, 2008 Login.php <?php session_start(); include "dbConfig.php"; if ($_GET["op"] == "login") { if (!$_POST["username"] || !$_POST["password"]) { die("You need to provide a username and password."); } // Create query $q = "SELECT * FROM `dbUsers` " ."WHERE `username`='".$_POST["username"]."' " ."AND `password`=PASSWORD('".$_POST["password"]."') " ."LIMIT 1"; // Run query $r = mysql_query($q); if ( $obj = @mysql_fetch_object($r) ) { // Login good, create session variables $_SESSION["valid_id"] = $obj->id; $_SESSION["valid_user"] = $_POST["username"]; $_SESSION["valid_time"] = time(); // Redirect to member page Header("Location: home.php"); } else { // Login not successful die("Sorry, You have enterd a wrong Username or Paswword please try again and be more carefull with your spelling!"); } } else { echo "<body bgcolor=\"#666666\">"; echo "<center>"; echo '<font size="2" face="verdana" color="#3d3d3d">'; echo "<form action=\"?op=login\" method=\"POST\">"; echo "Username<br /><input name=\"username\" size=\"15\"><br /> "; echo "Password<br /><input type=\"password\" name=\"password\" size=\"15\"><br /> "; echo "<input type=\"submit\" value=\"Login\">"; echo "</form>"; echo "</font>"; } ?> <a href="register.php">Click Here To Register! All Help Is Apreciated! Link to comment https://forums.phpfreaks.com/topic/104205-where-can-i-add-a-stylesheetcss-on-this-login-page/ Share on other sites More sharing options...
Barand Posted May 5, 2008 Share Posted May 5, 2008 Your link to the CSS file goes in the HTML head section. Link to comment https://forums.phpfreaks.com/topic/104205-where-can-i-add-a-stylesheetcss-on-this-login-page/#findComment-533468 Share on other sites More sharing options...
Robert Elsdon Posted May 5, 2008 Author Share Posted May 5, 2008 Can anyone tell me if this code is correct? If not will you fix it and post it Thanks. <?php session_start();//At the start! include "dbConfig.php"; ?> <head> <title>Welcome To UltimateRavers.Net, Your Ultimate Online Raving Destiny!</title> <style type="text/css"> @import "stylesheet.css"; </style> if ($_GET["op"] == "login") { if (!$_POST["username"] || !$_POST["password"]) { die("You need to provide a username and password."); } // Create query $q = "SELECT * FROM `dbUsers` " ."WHERE `username`='".$_POST["username"]."' " ."AND `password`=PASSWORD('".$_POST["password"]."') " ."LIMIT 1"; // Run query $r = mysql_query($q); if ( $obj = @mysql_fetch_object($r) ) { // Login good, create session variables $_SESSION["valid_id"] = $obj->id; $_SESSION["valid_user"] = $_POST["username"]; $_SESSION["valid_time"] = time(); // Redirect to member page Header("Location: home.php"); } else { // Login not successful die("Sorry, You have enterd a wrong Username or Paswword please try again and be more carefull with your spelling!"); } } else { echo "<body bgcolor=\"#666666\">"; echo "<center>"; echo '<font size="2" face="verdana" color="#3d3d3d">'; echo "<form action=\"?op=login\" method=\"POST\">"; echo "Username<br /><input name=\"username\" size=\"15\"><br /> "; echo "Password<br /><input type=\"password\" name=\"password\" size=\"15\"><br /> "; echo "<input type=\"submit\" value=\"Login\">"; echo "</form>"; echo "</font>"; } ?> <a href="register.php">Click Here To Register! Link to comment https://forums.phpfreaks.com/topic/104205-where-can-i-add-a-stylesheetcss-on-this-login-page/#findComment-533479 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.