Forum Moderators: coopster
I want to create a php page (showitem.php) to grab the url and change the item# and redirect to a different page.
ex. domain.com/newitem.php?item=N300
I have already written the code to query the database based on the old item number and return the new id, but i am not sure how to strip the old id from the url, replace it with the new and redirect.
Thanks in advance for the help!
(being a noob, I am not sure if I described my problem clearly)
showitem.php file
<?
$oldItem=$_GET["item"]; //this gets "item" from url
/*
here goes all your mysql code to grab new item number against this $oldItem value, lets say you save the new item number in variable $newItem
then
*/
header("Location : http://example.com/newitem.php?item=$newItem");
?>