"L'URL demandée n'a pas été trouvée sur ce serveur"

wail6 Posted messages 1 Status Member -  
 Anonymous user -
Hello,

I am very frustrated by this bug! :/
I have read all the other similar posts on the forum but I couldn’t find the solution

The first time I click on any product I get a 404 error page

Not Found

The requested URL /MyOnlineStore/product.php was not found on this server.

* I think this is a server error!!!?
This is the code I wrote for the products HTML page:
 <?php // Connect to the MySQL database include "storescripts/connect_to_mysql.php"; // Check to see the URL variable is set and that it exists in the database if (isset($_GET['id'])) { // Use this var to check to see if this ID exists, if yes then get the product // details, if no then exit this script and give message why $sql = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT 1"); $productCount = mysql_num_rows($sql); // count the output amount if ($productCount > 0) { // get all the product details while($row = mysql_fetch_array($sql)){ $product_name = $row["product_name"]; $price = $row["price"]; $details = $row["details"]; $category = $row["category"]; $subcategory = $row["subcategory"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); } } else { echo "That item does not exist."; exit(); } } else { echo "Data to render this page is missing."; exit(); } mysql_close(); ?> 

1 answer

Anonymous user
 
Hi there,

It seems to be a path issue, from where this script is being called?? To see clearly, you can do a
echo getcwd();

in the calling script.
It will return the path of the script, it's probably because you need to redirect from one script to another, maybe the code is not following.

Otherwise, check the permissions on the MyOnlineStore folder.

--
Resolved? ===> [RESOLVED]
0