View Single Post
Old 04-29-2008, 07:56 AM  
dirtysouth
Confirmed User
 
Join Date: Jul 2003
Location: Mobtown
Posts: 2,613
Really Quick PHP Help REQ

I need to trim special characters out of a form because it's parsing the "'" (single quote) and fucking up a cart I'm building. Users that have something like "Joe's Mags" crashes the cart due to the single quote. Here's what I have:

PHP Code:
if(!empty($_POST['shipcompany']))
{
    
$shipcompanytrim($_POST['shipcompany']);
}
else
{
    
$shipcompany '';

Been mucking around with this:

PHP Code:
$shipcompany "'!£$%^&ss*()}{@:'#~/?><>/ 1 2 3 4 5 3/.,/:@/||\-=-__++-¬``1`sds";
$shipcompany preg_replace('/[^a-z0-9]/'''$shipcompany); 
I just don't know how to mesh the code together. Thanks in advance as you guys always come through in a pinch and the client is pinching the fuck outta me ATM!
__________________
no sig
dirtysouth is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote