Jump to content

sevaara

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sevaara's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This is what I get Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster. Error 404 localhost 04/23/12 21:13:12 Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1
  2. Ah okay, appreciate your input either way, at least I know it's a server config thing and not a code error.
  3. Localhost with Xampp, Xampp says Apache server and MySQL are running. The file definitely isn't test.php.html so this is a server config thing, any idea what it could be?
  4. It displays a white blank page. I just tested the login page in Internet Explorer and it tried to download the login.php file when I click login. Here's what it displays when I try to login on Firefox 0){ echo "Username & Password correct (Logged in)"; } else { echo "That user doesn't exist"; } } else { echo "Please enter a username and password!"; } ?>
  5. I'm completely new to programming in PHP so I looked up a tutorial on youtube, came across the phpacademy tutorial for making a login page script. I followed everything as mentioned in the video but for some reason, I can login without a username or password entered and on top of that it's not displaying any of the messages I added in the code. I'm using Xampp for my Apache server and MySQL, configured everything I should of (as far as I know) but it still refuses to work. Here's the html for the login page, just a basic form. <html> <form action='login.php' method='POST'> Username: <input type='text' name='username'><br> Password: <input type='password' name='password'><br> <input type='submit' value='Log in'> </html> And then we have the PHP code which isn't working AT ALL. It's like it's not reading it at all for some reason and I can't figure out why. <?php $connect = mysql_connect("localhost", "root", "") or die("Couldn't connect!"); mysql_select_db("phplogin") or die("Couldn't find DB"); $connection =@ mysql_connect($db['server'], $db['user'], $db['password']) or die (include_once("offline.php")); $db =@ mysql_select_db($db['database']) or die (include_once("offline.php")); if($_POST['username'] && $_POST['password']){ $username = trim($_POST['username']); $password = trim($_POST['password']); $query = mysql_query("SELECT * FROM `users` WHERE `username` = '$username' AND `password` = '$password'"); $numrows = mysql_num_rows($query); if ($numrows > 0){ echo "Username & Password correct (Logged in)"; } else { echo "That user doesn't exist"; } } else { echo "Please enter a username and password!"; } ?> One thing I should mention is that, if I try to login on firefox it shows part of my php code as text, if I open it on Opera it displays the whole php code as text. Any ideas? -.-'
×
×
  • 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.