|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Hi Guys I know I shouldnt be asking such simple question but I have problem with this stupid mail script.
When I run it it says that I have error on line 69. The exact message is Warning: Server Error in d:\html\users\olivinecom.sg\html\4CM_phpEmail.php on line 69 According to my editor line 69 is mail("$UserEmail", "$ThankyouMessage", "Your Message : $UserComment", "From: URL"); I checked everything in the script but cant find a single error. Can anyone please help me? Regards, Roy H <? $SiteName = "Alco Automation Pte Ltd"; $SiteEmail = "webmaster@olivine.com.sg"; $ThankyouMessage = "Thank You for your Submission"; ?> <HEAD> <TITLE> <?php echo $SiteName?> - Contact Us! </TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" text="#000000"> <CENTER> Hello, <?php echo $UserName?> . <BR> <BR> Your submission has been sent back to you at <?php echo $UserEmail?> as a confirmation email. </CENTER> <? ### User's Confirmation### $UserComment = "$UserName, Thank you for submiting your comment, or question, about $SiteName.\n"; $UserComment .= "If needed, we will respond back with 48 hours.\n"; $UserComment .= "If you do not recieve a reply within 48 hours\n"; $UserComment .= "please email us at: $SiteEmail\n\n"; $UserComment .= "$SiteName Administration\n"; mail("$UserEmail", "$ThankyouMessage\n", "Your Message : $UserComment\n", "From: $SiteEmail"); ### E-mail sent to recepient ### $AdminMessage = "$UserName, Submitted the following Information:\n"; $AdminMessage .= "Name: $UserName\n"; $AdminMessage .= "Company: $UserCompany\n"; $AdminMessage .= "Title: $UserTitle\n"; $AdminMessage .= "Address: $UserAddress\n"; $AdminMessage .= "E-mail: $UserEmail\n"; $AdminMessage .= "Phone Number: $UserPhone\n"; $AdminMessage .= "Fax: $UserFax\n"; $AdminMessage .= "Country : $UserCountry\n"; $AdminMessage .= "Message : $UserMessage\n"; $AdminMessage .= "$HTTP_USER_AGENT\n"; mail("$SiteEmail", "Message from Alco Automation Website", $AdminMessage, "From: $UserEmail"); ?> <p><br> </BODY> Last edited by haryanto : June 25th, 2001 at 06:43 AM. |
|
#2
|
|||
|
|||
|
your code doesn't have 69 lines
|
|
#3
|
|||
|
|||
|
Remember all PHP code has to be terminated with ';'
Check your code PHP Code:
Should be PHP Code:
Andy |
|
#4
|
|||
|
|||
|
sorry, eaamj01, that is not correct. The closing php tag ?> implies an end of line marker ';'
Since it's impossible to tell which line is 69 I'm guessing, but from the error message is from the mail() line. It might be that sendmail is acting up.
__________________
FSBO (For Sale By Owner) Realty |
|
#5
|
|||
|
|||
|
To expound on rod k's point, you have to set up your local mail server in the php.ini file.
The section to tweak lies just below [mail function] You did not say on which OS PHP runs on; I think there is a line specially for Win32 systems. |
|
#6
|
|||
|
|||
|
Quote:
Hey Dunder, What do you mean by setting up my local mail server in the php.ini file?I have no accesss to the server cause I host it remotely.I do not have m own server. And according to the hosts the server runs on Win 2000 Is this going to pose any problem? Anyway is there any method to turn off the error messages? Please help! |
|
#7
|
|||
|
|||
|
i get
Warning: Bad Message destination in c:\phpdev3\www\index2.htm on line 31 Warning: Server Error in c:\phpdev3\www\index2.htm on line 44 which shows up as the two lines with mail(..)
__________________
Jeewhizz http://www.the-bluebox.co.uk |
|
#8
|
|||
|
|||
|
errors
you can't turn off error messages, they mean you have not properly coded something. PHP isn't like HTML, the server will not correct simple mistakes with PHP like browsers do with HTML, you must be completely correct. I can see several syntax errors in you script. Pay attention to your code.... you have left out a few of these: "\n" As well as added a few too many. You are also missing some of these ";" If all you want is an e-mail form and you are having so much trouble with PHP, why not just use an already made script? It is easier to learn languages such as PHP and PERL if you first become familiar with them by using scripts that already work. If you try to dive right in and start writing scripts, you'll either get frustrated and give up, or just kill yourself all together.
|
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > I know I shouldnt be asking such simple question but this is my 2nd day trying php |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|