Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-29-2005, 09:41 PM   PM User | #1
andrew1234
Regular Coder

 
Join Date: Oct 2002
Posts: 147
Thanks: 31
Thanked 2 Times in 2 Posts
andrew1234 is an unknown quantity at this point
script error

Hi this script used to work
but it does not work.. can you please help me correct it...

thanks

Andrew

<?
//echo "Title[$Title]";
$txtTo = "info@thet.co.za,te@t.co.za,om@hot.com";
$txtFrom = "info@test.co.za";
$subject = "test";
$header = " \n\n";
$footer = " \n";


// continue with rest of form...
$message .= "Name : $name \n\n";
$message .= "E-mail : $email \n\n";
$message .= "Telephone : $code $tel \n\n";
$message .= "Question : $textarea \n\n";



mail ($txtTo, $subject, $header . $message . $footer, $txtFrom);

?>
andrew1234 is offline   Reply With Quote
Old 06-30-2005, 02:09 AM   PM User | #2
Nightfire
Senior Coder

 
Nightfire's Avatar
 
Join Date: Jun 2002
Posts: 4,266
Thanks: 6
Thanked 48 Times in 48 Posts
Nightfire is on a distinguished road
What doesn't work on it? Doesn't send? Sends blank email? Get an error?
__________________
Blue Panda
Website Design | 1 Pound Ads | 'ow much? | Coding Geeks
Nightfire is offline   Reply With Quote
Old 06-30-2005, 07:33 AM   PM User | #3
andrew1234
Regular Coder

 
Join Date: Oct 2002
Posts: 147
Thanks: 31
Thanked 2 Times in 2 Posts
andrew1234 is an unknown quantity at this point
hi

I get this error:


Notice: Undefined variable: message in /home/test.com/ftp/html/sent.php on line 11


thanks for the help
andrew1234 is offline   Reply With Quote
Old 06-30-2005, 02:23 PM   PM User | #4
Nightfire
Senior Coder

 
Nightfire's Avatar
 
Join Date: Jun 2002
Posts: 4,266
Thanks: 6
Thanked 48 Times in 48 Posts
Nightfire is on a distinguished road
Change this
PHP Code:
 $message .= "Name : $name \n\n";
$message .= "E-mail : $email \n\n";
$message .= "Telephone : $code $tel \n\n";
$message .= "Question : $textarea \n\n"
to
PHP Code:
$message "Name : $name \n\n";
$message .= "E-mail : $email \n\n";
$message .= "Telephone : $code $tel \n\n";
$message .= "Question : $textarea \n\n"
__________________
Blue Panda
Website Design | 1 Pound Ads | 'ow much? | Coding Geeks
Nightfire is offline   Reply With Quote
Old 06-30-2005, 02:44 PM   PM User | #5
JamieR
Senior Coder

 
JamieR's Avatar
 
Join Date: Oct 2004
Location: United Kingdom
Posts: 3,161
Thanks: 0
Thanked 5 Times in 5 Posts
JamieR is on a distinguished road
Nightfire, sorry to sound like a complete idiot here, but why is a dot being used after the variable name? like $message .=?

__________________
-Jamie

Last edited by JamieR; 06-30-2005 at 02:52 PM..
JamieR is offline   Reply With Quote
Old 06-30-2005, 02:52 PM   PM User | #6
Brandoe85
teh Moderatorinator


 
Join Date: Sep 2004
Location: USA
Posts: 2,472
Thanks: 4
Thanked 40 Times in 40 Posts
Brandoe85 will become famous soon enough
The '.' is the concatenation operator, it's just like '+=' in other languages. So it takes whats allready in the variable and tacs more onto the end.
__________________
-Brando
Why using tables for eating is stupid!
Brandoe85 is offline   Reply With Quote
Old 06-30-2005, 02:53 PM   PM User | #7
JamieR
Senior Coder

 
JamieR's Avatar
 
Join Date: Oct 2004
Location: United Kingdom
Posts: 3,161
Thanks: 0
Thanked 5 Times in 5 Posts
JamieR is on a distinguished road
ah right, thanks - I gotta learn more php
__________________
-Jamie
JamieR is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:07 AM.


Advertisement
Log in to turn off these ads.