Im creating store that has an array of products that are listed in it. if someone wants to buy the product, the product is thrown in the URL and passed to the next page to be put in the cart
My problem is...
What if the product name has spaces such as "Fish and Spice"
I would have to make it where the client can put in spaces like this "Fish and Spices"
But it will appear on the URL as "Fish+and+Spices"...
so i decided to put a ereg_replace in the store front. so if the client decides to put in spaces then it will replace the spaces with + signs instead. well I couldnt just put the ereg_replace in the string cause the server threw an error. So i had to make a logic statement that determines if the ereg_replace returns true then replace else dont replace. this is the code below
if ( ereg_replace(" ","+",$value->get_product_name() ) )
{
$name = ereg_replace(" ","+",$value->get_product_name());
}
else
{
$name = $value->get_product_name();
}
my only problem is that i get this error
Warning: ereg_replace() [function.ereg-replace]: REG_BADRPT in /home/igvdev/public_html/oldb/system/content/product_config.php on line 68
Warning: ereg_replace() [function.ereg-replace]: REG_BADRPT in /home/igvdev/public_html/oldb/system/content/product_config.php on line 68
Warning: ereg_replace() [function.ereg-replace]: REG_BADRPT in /home/igvdev/public_html/oldb/system/content/product_config.php on line 68
Warning: ereg_replace() [function.ereg-replace]: REG_BADRPT in /home/igvdev/public_html/oldb/system/content/product_config.php on line 68
Warning: ereg_replace() [function.ereg-replace]: REG_BADRPT in /home/igvdev/public_html/oldb/system/content/product_config.php on line 68
Warning: ereg_replace() [function.ereg-replace]: REG_BADRPT in /home/igvdev/public_html/oldb/system/content/product_config.php on line 68
Warning: ereg_replace() [function.ereg-replace]: REG_BADRPT in /home/igvdev/public_html/oldb/system/content/product_config.php on line 68
Warning: ereg_replace() [function.ereg-replace]: REG_BADRPT in /home/igvdev/public_html/oldb/system/content/product_config.php on line 68
Warning: ereg_replace() [function.ereg-replace]: REG_BADRPT in /home/igvdev/public_html/oldb/system/content/product_config.php on line 68
for each and every product that is evaluated. does anyone know whats wrong with the code and possibly know how i can downsize it if needed