...

View Full Version : Sending Email in PHP trouble



angst
07-07-2005, 03:28 PM
hello,
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!
-Ken

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

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

test'/s or something like that?

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

like:

they'\re

shouldn't that be removed while sending?

thanks again for your time!
-Ken

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

thanks for your help! :thumbsup:

joeframbach
07-07-2005, 03: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\"";

angst
07-07-2005, 04:11 PM
hello,
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:




<?php

$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!
-Ken



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum