Problem with clean function returning nothing
Posted: Tue Nov 15, 2011 2:43 pm
Hello all.
I have a very little script that use to work on an old server but now its on a new one fails to work. THe code is
For some reason when i pass variables into this script via a form, i know they are accessible because echoing $_POST['newRef'] returns the value. But when i echo $newRef i get nothing. THe function is bringning back nothing.
Im desperate to get this working. As i say it worked on an old server but not a new one.
Any help would be great
I have a very little script that use to work on an old server but now its on a new one fails to work. THe code is
Code: Select all
//Function to sanitize values received from the form. Prevents SQL injection
function clean($str) {
$str = @trim($str);
if(get_magic_quotes_gpc()) {
$str = stripslashes($str);
}
return mysql_real_escape_string($str);
}
//Sanitize the POST values
$newRef = clean($_POST['newRef']);
$newTitle = clean($_POST['newTitle']);
$Notification = clean($_POST['Notification']);Im desperate to get this working. As i say it worked on an old server but not a new one.
Any help would be great