View Full Version : Sending Email in PHP trouble

07-07-2005, 04:28 PM
I'm tyring to send an email in PHP,
but having trouble with the body of the email,
it looks like it can't have any ''' in it.
If i remove them, everything works again.

my error code:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /signup.php on line 63

how can i get around this to properly format the message?

thanks in advance for your time!

07-07-2005, 04:35 PM
Try escaping them with a backslash \ - this will allow PHP to include them without parsing them.

07-07-2005, 04:36 PM
hmm, ok and how would that look?

test'/s or something like that?

07-07-2005, 04:44 PM
ok, i've got it working now,,
but when i receive the email i still see the slashes?



shouldn't that be removed while sending?

thanks again for your time!

07-07-2005, 04:46 PM
ok nm, i've got,

thanks for your help! :thumbsup:

07-07-2005, 04:50 PM
have you got it working right?

the escape character \ is to occur right before the character that needs to be escaped.
$text = "Vocab lesson: Your mom\'s sister is your \"aunt\"";

07-07-2005, 05:11 PM
maybe you could help me with one other small thing,

just trying to setup a very simple login with the user and pass coded, insted of using a db.

trying to use this:


$user = $_POST['user'];
$pass = $_POST['pass'];

if ( $user == "admin" and $pass == "admin" ) {

header("Location: admin/admin.php");

} else {

header("Location: admin/index.php?error=login");



but i keep getting errors for some reason.

Notice: Undefined index: user in login.php on line 3

Notice: Undefined index: pass in login.php on line 4

Warning: Cannot modify header information - headers already sent by (output started at login.php:3) in login.php on line 12

i've been doing google searches and can't come up with anything yet.
I'm still very new to php coding. just moving over from ASP/VB, so i know that these things can be done, but syntax is a *****! :confused:

thanks again for your time!