triple nested quotes?
this seams really simple but I can't figure it out.
I have the following code:
and it takes the $mess and puts it inside this:
$mess = "Welcome to Money4Every1! If you would like to learn how to use our site, you can visit the tutorial found here - <a href='http://money4every1.net/offer101.php'>http://money4every1.net/offer101.php</a>"; //welcome message to site users. This message gets sent to a users inbox when they login.
and I think because i have HTML inside my $mess it isn't sending correctly.. help?
$msg = mysql_query("INSERT INTO `messages` (`to`, `from`, `subject`, `message`, `status`, `date`) VALUES(\"$u\", 'admin', 'Welcome', '$mess', 'unread', '$date')");
do i just put \' for the a href?
yep, figured it out. just had to put
You are better off using mysql_real_escape_string rather than hard coding the backslashes as then you don't have to strip the backslashes out later.
Even better would be to use prepare/bind to separate the data from the query and then you wouldn't have triple nested quotes any more.