Jump to content

dvd871

Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dvd871's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yea, it must have been something messed up in php. I reinstalled XAMPP and it works fine now. What a waste of an hour. Stuff like this only happen to you when you are under the gun and must complete something... Thanks for the quick replies.
  2. Now I know the second suggestion should have worked since its checking to see if the string length is greater than 1 but its still is failing! --Edit: output of $username snd password right before the first check: #DEBUG: admin #DEBUG: password
  3. This is killing me. I have used this code dozens of times in various scripts but now all of a sudden it fails. The simple form: <html> <head> <title><?=$config['game_name']?></title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto;"> <tr><td style="width: 50%;">About Your Game Name - Put a short description of your game here.</td> <td><form action="login.php" method="post"> Username: <input type="text" name="username"><br> Password: <input type="password" name="password"><br> <input type="submit" name="submit" value="Submit"></form></td></tr> <tr><td> </td><td><h3><a href="register.php">REGISTER NOW!</a></h3></td></tr></table> </body> </html> The login.php: <?php $err = ""; $username = stripslashes($_POST['username']); $password = stripslashes($_POST['password']); // Check both username and password were supplied if((!$username) || (!$password)) { $err.="Please enter ALL of the information! <br />"; include "error.php"; exit; } // Check for invalid character in the username elseif(!preg_match("/^[\\w-_]*[\\w-_]$/", $username)) { $err.="Your user name contains invalid characters"; include "error.php"; exit; } // Check for invalid character in password elseif(!preg_match("/^[\\w-_]*[\\w-_]$/", $password)) { $err.="Your password contains invalid characters"; include "error.php"; exit; } ?> I have verified that the username and password are set after setting the initial variables. The code barfs on the if((!$username) || (!$password)) { It keeps telling me "Please enter ALL of the information!" I am using php 4.4.7, mySQL 4, apache 1.3x
  4. It's just like the other guys told you in your duplicated post. Your query has single quotes in it that is causing things to fail. Change: mysql_query("INSERT INTO schools VALUES ( '$_SESSION['school_name']', '$_SESSION['postcode']', '$_SESSION['teacher_name']', '$_SESSION['email']', '$_SESSION['num_logins']' )"); To: mysql_query("INSERT INTO schools VALUES ( '$_SESSION[school_name]', '$_SESSION[postcode]', '$_SESSION[teacher_name]', '$_SESSION', '$_SESSION[num_logins]' )");
  5. Try loading the .sql file that you have and see what it contains. If you have PHPmyadmin create a new database, then click on the SQL tab, scroll down to where it says \"location of the text file\" and click on the browse button. Browse to the directory that has your .sql file in it, select it, then click the go button. That should load whatever is in your .sql file. If you don\'t have phpmyadmin then you will need to telnet into your webserver account which is a little more involved.
×
×
  • 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.