404 Error for no apparent reason. I've been struggling for 8 hrs. Please help.

The script runs fine. I don’t get the error until after I run the code and click on the anchor tag.

<?php session_start(); require('connection.php'); if(!isset($_SESSION['username'])){ header("LOCATION: login.php"); } $id= $_SESSION['id']; $users= mysql_query("SELECT * FROM `users` WHERE `id` <> '$id'"); while($row= mysql_fetch_array($users)){ echo '

' . $row['firstname']. '

'; } ?>

//Things that I have checked:
I know what the error means, I don’t however know why I’m getting it.
files are spelled correctly
connected to database
files are in the same folder in (XAMPP)
I’m aware of the mysqli_ instead of mysql_ but I don’t believe that is the issue(also, I’ve been running with the mysql_ for a while now without any issues, and some insight as to why the need to change over would be greatly appreciated. My editor does not recognize mysqli_ for some reason(notepade++)
I’m new to programming in general so any help would be appreciated.

I've been running with the mysql_ for a while now without any issues, and some insight as to why the need to change over would be greatly appreciated.

Because it is insecure ( ie more easily hacked ) and it will be removed completely as you update your versions of PHP.

For your problem:

Is the code you posted request.php and is it in the root directory? the / in front of the name means a specific location, you are probably wanting to just have it as request.php NOT /request.php, unless it is the same page you posted. The you could skip it completely.

Sponsor our Newsletter | Privacy Policy | Terms of Service