diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-05-11 14:54:29 +0200 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-05-11 14:54:29 +0200 |
| commit | 1bb6c3bc23d08851f6af786f516b3cbc73a6f391 (patch) | |
| tree | cafd4ccffd63f1c2f926da5637550eea66ff8b52 /productdetails.php | |
| parent | fe9768f784a1dd333939070ac3940fba30ab0aaa (diff) | |
| download | Catalog-1bb6c3bc23d08851f6af786f516b3cbc73a6f391.tar.gz Catalog-1bb6c3bc23d08851f6af786f516b3cbc73a6f391.zip | |
Check for wrong ids
Diffstat (limited to 'productdetails.php')
| -rw-r--r-- | productdetails.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/productdetails.php b/productdetails.php index c840421..63ba451 100644 --- a/productdetails.php +++ b/productdetails.php @@ -7,9 +7,18 @@ else { header('Location: categories.php'); } +if(isset($_GET['catid'])) +{ + $catid = $_GET['catid']; +} require_once('vendor.inc.php'); $product = ProductQuery::create()->findOneById($id); + +if ( !is_object($product) ) +{ + header('Location: categories.php'); +} ?> <!DOCTYPE html> <html> @@ -25,6 +34,7 @@ $product = ProductQuery::create()->findOneById($id); <dt><a href="contact.html">Contact us</a></dt> <dt><a href=".">Home</a></dt> <dt><a href="categories.php">Categories</a></dt> + <dt><a href="products.php?id=<?php echo $catid; ?>">Back to Category</a></dt> <dt><a href="login.html">Login</a></dt> </dl> </nav> @@ -65,10 +75,4 @@ $product = ProductQuery::create()->findOneById($id); </div> <footer>Copyright by SomeCompany Ltd.</footer> </body> -</html> - - - -<?php -require_once('vendor.inc.php'); -?>
\ No newline at end of file +</html>
\ No newline at end of file |
