The rewrite I'm using maps /products/string to products.php?product=string and the products.php is basically:

<header>

<?php if(!isset($_REQUEST['products'])) {?>
<a href="products/consumer-hardware>Consumer Hardware</a>
<?php }?>

<?php if (isset($_REQUEST['products']) && $_REQUEST['products'] == 'consumer-hardware') {?>
<consumer-hardware details>
<?php }?>

<footer>

Now the rewrite works, because I'm not getting a 404, but of course since the anchor URL is not a query (products/consumer-hardware rather than products.php?product=consumer-hardware), $_REQUEST has no value! So I see my header & banner but none of the consumer-hardware details. How do I keep my mod-rewrite but assign the url /products/consumer-hardware to the particular section in the page?

Many thanks

Alex

Recommended Answers

If this URL is correct
products.php?product=string

Then this:
$_REQUESTs[/B]']
should be
$_REQUEST

Jump to Post

All 2 Replies

Member Avatar

request has no value coz u cannot request like this

<?php if (isset($_REQUEST) && $_REQUEST == 'consumer-hardware') {?>
<consumer-hardware details>
<?php }?>

try this

<?php
if (isset($_REQUEST)
{
header('Location: /products/consumer-hardware');
}
?>
<consumer-hardware details>
<?php }?>

If this URL is correct
products.php?product=string

Then this:
$_REQUESTs[/B]']
should be
$_REQUEST

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.