Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/238908-problem-adding-paypal-link-to-database/
Share on other sites

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>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.