I am trying to redirect a webpage depending on the URL parameters. I have gone through so many tutorials and stackflow answers in the last couple of days without finding a way past this. I am not a programmer but learnt everything i know about php and html coding using stackflow.So thanks you everyone.
www.domain.com/women/product?id=08607080
would like to redirect to
www.domain.com/women/Accessories/product?id=08607080
this is the code I am using now but it directs to www.dmail.com/women
Help please
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/womenconfig.inc.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/functions.inc.php';
mysql_connect(HOST, USERNAME, PASSWORD) or die(mysql_error());
mysql_select_db(DB) or die(mysql_error());
$ArtNumber = isset($_GET['id'])?$_GET['id']:Null;
$ArtNumber = isset($_GET['id'])?$_GET['id']:Null;
$query = "(SELECT * FROM " . implode(' WHERE ArtNumber=\'' . $ArtNumber . '\') UNION (SELECT * FROM ', array_keys($shops_arr)) . ' WHERE ArtNumber=\'' . $ArtNumber . '\' ) ';
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
$ArtNumber = $row['ArtNumber'] ;
$ProductCategory1 = $row['ProductCategory1'] ;
$ProductCategory2 = $row['ProductCategory2'] ;
$ProductCategory3 = $row['ProductCategory3'] ;
echo "<script>window.location = ''/women/Accessories'.$ProductCategory1.'/product?id=',$ArtNumber,''</script>";
?>
window.location = ...which is rendered when you execute the script? I suspect not all parameters are passed.headers()function or directly use the rewriting module of your http server.