[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

backslash apostrophe in php



My students are in MySQL database on a mailing list containing their name and email address. I have a page set up on the intranet that I can go to in order to enter a text message. When I hit submit, the msg variable is carried over to a page containing PHP code which takes each student from MySQL, and sends them an email.

The only problem I am having right now is that if I enter an 's on the textbox of the form, my code is sending out a \'s. For example: The word dont't get sent to the student as don\'t.

It looks like one part of my code might be anticipating that an escape must be sent before the ', but in reality it doesn't need to be sent. I figured others probably have had similar problems. Please let me know if you have any ideas! My code is pasted below. The form code is at the top, and then the php code which pulls the data from the database is on the bottom. This php code is inside of a loop.


Form Code:
<form name="form" method="post" action="dbrun.php">
<p><center><textarea COLS="100" ROWS="40" WRAP="soft" name="msg"></textarea></center><p>
<center><input type="Submit" name="Submit" value="Submit"></center>
</form>



dbrun.php code:
$to="$Row[email]";
$subject="PLC Training";
$fullmsg="Hello $Row[name]: \r\n\n$msg";
mail($to,$subject,$fullmsg,'From: Instructor <me@mydomain>');


Thanks!

Ricky