I enter my data into a form on page1.php. Then I click submit and I get sent to page2.php. Page2 has the following code:
<?
include('dbconnect.inc');
mysql_query("insert into products(Product, SubProduct, MetaTitle, CategoryID, Data, Advert) values('$Product', '$SubProduct', '$MetaTitle', '$CategoryID', '$Data', '$Advert')");
echo $CategoryID." > ".$Product."> ".$SubProduct.": ".$SubProduct;
echo '<br><br>';
echo '<br><br>';
echo '<a href="admin.php">Back to Admin</a>';
?>
Two things I need:
- I want to add in the ProductID field. But this is only generated after I click submit on page1.php. How do I get this value?
Currently, a typical output from the echo statement would be:
mysite.com/main.php?navtype=subproduct&category=Business&productname=aa&filter=
Yet at the end I should have filter=(whatever the value of ProductID is).
- Any spaces in the string should be converted to whatever they would appear like in a browser. Is it %20 or something? Is there some kind of find and replace function?
Thanks,
Jon