hi there i am working on a project based on php mysql and html now as i was using an more secure method to authenticate login information than simply getting the post variables and comparing it with the data base i came accross different functions like
isset()
empty()
stripslashes()
i got it right till isset and empty but when working with stripslashes i am not getting it right ,as far as i know that the purpose of stripslashes() is to remove any extra
' " / and \ etc
but as i tried to use it and in username input field i entered
\omer and tried to echo it after using stripslashes($_ POST['FIELD_NAME']); it still shows the" \ " in it
My code is here
[code=php]
<?
$msg="";
if(isset($_POST['Submit'])){
if(!empty($_POS T["l_name"]) && !empty($_POST["l_pass"])) {
if(isset($_POST["l_name"]) && isset($_POST["l_pass"])){
$mem_name=strip slashes($_POST["l_name"]);
$mem_pass=strip slashes($_POST["l_pass"]);
echo $mem_name.'<br />'.$mem_pass;
}
else{
$msg.="Good to see you Looser";
header("Locatio n: buzz.php?msg=". $msg);
exit();
}
}
else{
$msg.="The e-mail address / user name and password you entered did not match any accounts in our file. Please try again.";
}
}
else{
$msg.="Good to see you Looser";
header("Locatio n: buzz.php?msg=". $msg);
exit();
}
?>
[/code]
any help in this regard would be highly appreciated
regards,
Omer Aslam
isset()
empty()
stripslashes()
i got it right till isset and empty but when working with stripslashes i am not getting it right ,as far as i know that the purpose of stripslashes() is to remove any extra
' " / and \ etc
but as i tried to use it and in username input field i entered
\omer and tried to echo it after using stripslashes($_ POST['FIELD_NAME']); it still shows the" \ " in it
My code is here
[code=php]
<?
$msg="";
if(isset($_POST['Submit'])){
if(!empty($_POS T["l_name"]) && !empty($_POST["l_pass"])) {
if(isset($_POST["l_name"]) && isset($_POST["l_pass"])){
$mem_name=strip slashes($_POST["l_name"]);
$mem_pass=strip slashes($_POST["l_pass"]);
echo $mem_name.'<br />'.$mem_pass;
}
else{
$msg.="Good to see you Looser";
header("Locatio n: buzz.php?msg=". $msg);
exit();
}
}
else{
$msg.="The e-mail address / user name and password you entered did not match any accounts in our file. Please try again.";
}
}
else{
$msg.="Good to see you Looser";
header("Locatio n: buzz.php?msg=". $msg);
exit();
}
?>
[/code]
any help in this regard would be highly appreciated
regards,
Omer Aslam
Comment