HDFilmMaker2112 Posted June 9, 2011 Share Posted June 9, 2011 When I submit a product using my admin panel, the PayPal button has slashes added to escape the double quotes in the paypal button. It's also adding slashes to my apostrophes. I didn't think it was suppose to add slashes, or they should atleast be pulled out on insert into the database? function sanitize($formValue){ if(function_exists(get_magic_quotes_gpc()) && get_magic_quotes_gpc()) { $formValue = stripslashes($formValue); } $formValue = mysql_real_escape_string($formValue); return $formValue; } $product_link=sanitize($_POST['product_link']); http://ghosthuntersportal.com/store.php?product=13#overview Quote Link to comment https://forums.phpfreaks.com/topic/238908-problem-adding-paypal-link-to-database/ Share on other sites More sharing options...
HDFilmMaker2112 Posted June 9, 2011 Author Share Posted June 9, 2011 I just checked to see when the slashes are added and they're placed in there prior to mysql_real_escape_string, which makes no sense.... the function is not called prior to that at all. This is the form: <form action="./product_process.php?do=add" method="post"> <p><label>Product Name:</label> <input type="text" name="product_name" size="30" /> <label>Product Price:</label> <input type="text" name="product_price" size="5" /> </p> <p><label>Product Code:</label> <input type="text" name="product_code" size="30" /></p> <p><label>Product Category:</label> <input type="text" name="product_category" size="30" /></p> <p><label>Product Link:</label><br /> <textarea name="product_link" rows="5" cols="30"></textarea> </p> <p><label>Product Image:</label> <input type="text" name="product_image" size="30" /></p> <p><label>Product Tag:</label> <input type="text" name="product_tag" size="30" /></p> <p><label>Product Keywords:</label> <input type="text" name="keyword" size="30" /></p> <p><label>Product Hightlights:</label><br /> <textarea name="product_highlights" rows="10" cols="60"></textarea> </p> <p><label>Product Features:</label><br /> <textarea name="product_features" rows="10" cols="60"></textarea> </p> <p><label>Product Pros:</label><br /> <textarea name="product_pros" rows="5" cols="30"></textarea> </p> <p><label>Product Cons:</label><br /> <textarea name="product_cons" rows="5" cols="30"></textarea> </p> <p><label>Product Description:</label><br /> <textarea name="product_description" rows="10" cols="60"></textarea> </p> <p><label>Product Notes:</label><br /> <textarea name="product_notes" rows="5" cols="30"></textarea> </p> <p><label>Product Specifications:</label><br /> <textarea name="product_specifications" rows="10" cols="60"></textarea> </p> <p><input type="submit" value="Submit" name="Submit" /></p> </form> Quote Link to comment https://forums.phpfreaks.com/topic/238908-problem-adding-paypal-link-to-database/#findComment-1227665 Share on other sites More sharing options...
HDFilmMaker2112 Posted June 9, 2011 Author Share Posted June 9, 2011 Narrowed down the issue to this: function_exists(get_magic_quotes_gpc()) it returns false... any ideas why? When I use get_magic_quotes_gpc() by itself it returns true. Quote Link to comment https://forums.phpfreaks.com/topic/238908-problem-adding-paypal-link-to-database/#findComment-1227691 Share on other sites More sharing options...
HDFilmMaker2112 Posted June 9, 2011 Author Share Posted June 9, 2011 function_exists is looking for a string so it needs to be this: function_exists('get_magic_quotes_gpc') Quote Link to comment https://forums.phpfreaks.com/topic/238908-problem-adding-paypal-link-to-database/#findComment-1227701 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.