Hi,
So I have a page with url:
mysite.com/product.php?model=JUCA3821
This would bring up my JUCA3821 product.
I'd like to make it so that if a user deleted the model part (mysite.com/product.php) it would redirect to an error page or something similar.
So I wrote this code:
But this isn't working. I can't seem to make it so that this will work. I get this error message:PHP Code:// if model is empty, the url is incorrect
if (!isset($_GET["model"]) || empty($_GET["model"])) {
header('Location: /product-error.php');
} else {
$modelNo = $_GET["model"];
}
$tsql = "SELECT fProductRefNum1, ..., fUnitDimension2
FROM fProducts
WHERE fProductRefNum1 = '$modelNo'";
"PHP Notice: Undefined variable: modelNo in E:\WWW\DEV\product.php on line 19"
I've tried every different way I can think of. Does anyone have any ideas?
Thanks a lot,
Dan


Reply With Quote
Bookmarks