futurra wrote:the sql function is used to help filter a string (name) ie: joe blogs
$name would then store the filtered string
Surprisingly I know what the functions do, I also know that if you pass joe blogs through mysql_real_escape_string it will appear to do nothing as there is nothing to escape. If you want to see what my_sql_real_escape_sting and strip tags do use this
<?php
set_magic_quotes_runtime( 0 );
if (isset($_POST['submit'])){
echo 'No escaping outputs: '.$_POST['name'];
print '<br>';
$name = strip_tags($_POST['name']);
echo 'Strip tags outputs: '.$name;
print '<br>';
$name = mysql_real_escape_string($_POST['name']);
echo 'Escape String outputs: '.$name;
print '<br>';
$name = mysql_real_escape_string(strip_tags($_POST['name']));
echo 'Escape String and strip tags outputs: '.$name;
} else {
?>
<form method="POST" action="<?php $_SERVER['PHP_SELF'];?>">
<input type="text" name="name" size="30">
<input type="submit" name="submit" value="Submit">
</form>
<?php
}
?>
And you still haven't said what the problem is!