Step 2: Product Insert Page - Creating the PageName

Tutorial #2 - Adjusting the add product page

After submitting a new record we'll get the product name then "clean it up" then use this as the page name. IE Orange Bowl (Small) becomes OrangeBowlSmall

You could do this with either Javascript or PHP. I did it in PHP

// create Page name
$pageName = $_POST['prod_name'];
$pageName = strip_tags($pageName);
$pageName = stripslashes($pageName);
$symbols = array("!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "=", "+", " ","/","|","\",";",":");
$pageName = str_replace($symbols, "", $pageName);

View

PHP Hosting

Recent Topics