Copy link to clipboard
Copied
[24-Jul-2023 07:58:29 UTC] PHP Notice: Use of undefined constant id - assumed 'id' in
may i know what does the php notice mean
/home/pbv3iybckwao/public_html/product.php on line 72 [24-Jul-2023 07:58:29 UTC] PHP Notice: Undefined index: id in /home/pbv3iybckwao/public_html/product.php on line 72
Copy link to clipboard
Copied
With $_GET['id'], you are trying to access a variable that comes from the URL query parameter as in product.php?id=123. When the parameter does not exist, you will get the error message.
It is better to reconstruct the code to check if the parameter exists as in
// Check if $_GET ['id'] is set
if (isset ($_GET ['id'])) {
// Use $_GET ['id']
$id = $_GET ['id'];
} else {
// Handle the case when $_GET ['id'] is not set
// For example, show an error message or redirect to another page
echo "No id provided";
}
Copy link to clipboard
Copied
 
Please check if the above coding has error.
i used your method to test and really no "no id is provided"
Copy link to clipboard
Copied
Echo the id on the product.php page after you $_GET it, assuming you are linking to that page from the page which passes the id via the url. Do you have any result.
I assume you are not trying to open the products.php page directly, which will throw the error/warning.
Copy link to clipboard
Copied
im figuring out the problem.
thanks for your suggestion