Page 1 of 1

can u help me modify this??

Posted: Tue Jan 31, 2006 2:46 am
by pleigh
i want to modify this function but having hard time coding it...maybe some proffesionals can easily do this..someone advised me not to use magic quotes...

Code: Select all

function escape($data)
{
    global $connect;
    if (ini_get('magic_quotes_gpc'))
    {
        $data = stripslashes($data);
    }
    return mysql_real_escape_string(trim($data), $connect);
}//end of escape() function.
thanks in advance.. :)

Posted: Tue Jan 31, 2006 2:52 am
by aetoc
What do you want to do?

Give me some help so I can celp you.

Posted: Tue Jan 31, 2006 2:55 am
by pleigh
sorry...im not so specific...i dont want to use the magic quotes and instead, use an alternative...is there a way to do it??

Posted: Tue Jan 31, 2006 3:05 am
by aetoc
Send me all the code of the page if you can.

If you have a problem sending it in the forum send it to my e-mail.

Posted: Tue Jan 31, 2006 3:16 am
by aetoc
feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Code: Select all

<?php
function escape($data) // function named escape with starting value $data var
	{ 
		global $connect; // var named $connect set as global
		if (ini_get('magic_quotes_gpc'))  // Returns the value of the configuration option on success. Failure, such as querying for a non-existent value, will return an empty string.
			{ 
			$data = stripslashes($data); // Returns a string with backslashes stripped off. (\' becomes ' and so on.) Double backslashes (\\) are made into a single backslash (\)
			} 
		return mysql_real_escape_string(trim($data), $connect); connect with ......
	}
?>
I uderstand what the script is about but if I don't see all the code I can't give you any more help. Simple as that.


feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]