Forum Moderators: coopster
i've tried the tutorials on php.net, but it mucked up my redirect function (that sends the user back to their originating page [dynamic?bla=bla1] with the "success" message)
i'm sure i've done something incorrect that caused this to happen. can anyone enlighten me?
this is the tutorial i used: [ca3.php.net...]
in my redirect, somehow a " and ' got inserted between the filename.
'myemail'@myemail.com in my admin area where i output the data from the database, it shows up as:
\'myemail\'@myemail.com for this effort, i tried:
$email = mysql_real_escape_string( $email ); am i safe from any injections?
//grab info from previous page
$email = mysql_real_escape_string( $mail ); query:
$query_manf = "select * from notification where id='".$id."' and email='".addslashes($email)."' "; (email being where the user can input their email).. this form checks to see if their address currently exists, if not, proceed to next query:
$query_insert = "insert into notification(id,email,date)values(".$id.",'".$email."',now()) "; is there anything else i can do to thwart possible attacks?
is this too much protection (or, am i using this incorrectly)?
//grab info from previous page
$email = mysql_real_escape_string( $mail );query:
$query_manf = "select * from notification where id='".$id."' and email='".addslashes($email)."' ";
mysql_real_escape_string is enough, you don't need to apply addslashes later on.
is there anything else i can do to thwart possible attacks?
there is a thread ehre about PHP Security [webmasterworld.com] that might help with some of the concepts