Jump to content

wickedXxxxlegox

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by wickedXxxxlegox

  1. 'Ello everyone. I am having a problem with my login system. When I try to log in, it says login failed even though I have the correct username and pass. My username is Andrew Baker, and my pass is obviously a secret. Here's the code to checklogin.php: <?php // checkLogin.php require('includes/header.php'); session_start(); // Start a new session require('includes/db_connect.php'); // Holds all of our database connection information // Get the data passed from the form $username = $_POST['user']; $password = $_POST['password']; // Do some basic sanitizing $username = stripslashes($username); $password = stripslashes($password); $sql = "select * from members where username = '$username' and password = '$password'"; $result = mysql_query($sql) or die ( mysql_error() ); $count = 0; while ($line = mysql_fetch_assoc($result)) { $count++; } if ($count == 1) { $_SESSION['loggedIn'] = "true"; header("Location: home.php"); // This is wherever you want to redirect the user to } else { $_SESSION['loggedIn'] = "false"; header("Location: loginfailed.php"); // Wherever you want the user to go when they fail the login } ?> Thanks! If you need any more info then reply down here vvvvv
  2. Well, have any good login system tutorials?
  3. That it says "Third Party PHP Scripts" WHICH MEANS that I can use scripts from any other site I want and I can ask for help. And I can also tell you that it's not the same problem. I have a semicolon where I need it.
  4. Excuse me sir, but have you read this forum's title?
  5. Error Message: Parse error: syntax error, unexpected T_VARIABLE in /home/a1922355/public_html/checklogin.php on line 7 code: <?php include('includes/header.php') ?> <?php include('includes/db_connect.php') $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM users WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ session_register("myusername"); session_register("mypassword"); header("location:loginsuccess.php"); } else { echo "Wrong Username or Password"; } ?>
  6. Well, you don't need the locations table. Just make a row in the users table and have then set their location and then check to see if this person lives in Let's say... Ssn Diego for example, it would send San Diego weather reports.
  7. f*ck. I really suck at coding. I hate myself.
  8. I don't see anything wrong with it...
  9. Helloo... I am having some trouble with my site. This code isn't working. db.php <?php include('includes/db_connect.php') mysql_query("CREATE TABLE news( title VARCHAR(20), name VARCHAR(30), body LONGTEXT date DATE)") or die(mysql_error()); echo "Table Created!"; ?> This is the code for includes/header.php <?php $db = @mysql_connect('mysql12.000webhost.com', 'a1922355_Andrew', 'PASSWORD') or die(mysql_error()); @mysql_select_db('a1922355_wizzle', $db) or die(mysql_error()); ?> Here is the error I get on db.php: Parse error: syntax error, unexpected T_STRING in /home/a1922355/public_html/db.php on line 5 I'm litterally super . Thanks.
×
×
  • 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.