[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 10-31-2005, 03:47 PM   #1 (permalink)
Senior Member
 
nasaboy007's Avatar
 
Join Date: Jul 2005
Location: NJ
Posts: 1,112
1,454.30 NP$ (Donate)

nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of


PHP Mail

Im trying to use the PHP mail function, but it just doesnt seem to work. PHP 4.3.11 is running on the server. my script has:

PHP Code:
<?php
            $fname
=$_POST['fname'];
            
$lname=$_POST['lname'];
            
$address=$_POST['address'];
            
$city=$_POST['city'];
            
$state=$_POST['state'];
            
$zip=$_POST['zip'];
            
$size=$_POST['size'];
            
$date=date('l dS \of F Y h:i:s A');
            if(
$size=="s"){
                
$size="12\" x 18\"";
                }
            else if(
$size=="l"){
                
$size="24\" x 36\"";
                }
            
$email="webmaster@example.com";
            
$subject=$fname . " " . $lname . "Poster Order";
            
$body="Order Information:\n" .
            
"First Name: " . $fname . "\n" .
            
"Last Name: " . $lname . "\n" .
            
"Address: " . $address . "\n" .
            
"City: " . $city . "\n" .
            
"State: " . $state . "\n" .
            
"Zip Code: " . $zip . "\n" .
            
"Poster Size: " . $size . "\n" .
            
"Time and date of order: " . $date;
            
$header="From: posterorders@example.com" . "\r\n"
            
$sent=mail($email,$subject,$body,$header);
            if(
$sent==TRUE){
            echo
Sent;
            }
            else{
            echo
Not Sent;
            }
?>
whats wrong with this?

it trips on line 28, which....

NEVERMIND
i figured it out... im missing a semicolon on the line above... damn it. do u see any other errors tho?
nasaboy007 is offline  
Old 10-31-2005, 05:03 PM   #2 (permalink)
Account Closed
 
Join Date: Jul 2005
Posts: 176
26.00 NP$ (Donate)

cbr600 is on a distinguished road


Edit: You have no semicolon after the header = line

Hmm, Im not sure but why do you have this:
PHP Code:
 $header="From: posterorders@example.com" . "\r\n"
instead of just
PHP Code:
 $header="From: posterorders@example.com"
cbr600 is offline  
Old 11-01-2005, 01:14 AM   #3 (permalink)
Senior Member
 
Peter's Avatar
 
Join Date: Nov 2003
Location: Scotland
Posts: 4,900
0.60 NP$ (Donate)

Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute

Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Quote:
Originally Posted by SexualChocolate
Hmm, Im not sure but why do you have this:
PHP Code:
 $header="From: posterorders@example.com" . "\r\n"
instead of just
PHP Code:
 $header="From: posterorders@example.com"
Take a look in the notes at php.net on the mail page, If I remember correctly if you do not dothis it causes problems with outlook express.
Peter is offline  
Old 11-01-2005, 02:04 PM   #4 (permalink)
Senior Member
 
nasaboy007's Avatar
 
Join Date: Jul 2005
Location: NJ
Posts: 1,112
1,454.30 NP$ (Donate)

nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of


yeah it was the ; that was tripping it up, but i caught that 10 secs after posting this... thnx neway.

@filth
yep i got that info from php.net.
nasaboy007 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple PHP Tell-A-Friend Eric CODE 6 06-07-2006 03:26 AM
Randomingly choosing a quote from Database, PHP SquireQuack Programming 9 10-31-2005 05:50 AM
Simple PHP Form Issue buddybuddha Programming 3 10-30-2005 02:53 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 12:38 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85