SunQuest
           Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old June 24th, 2001, 10:25 PM
haryanto haryanto is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: USA
Posts: 4 haryanto User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 4 m 18 sec
Reputation Power: 0
Unhappy I know I shouldnt be asking such simple question but this is my 2nd day trying php

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.

Reply With Quote
  #2  
Old June 25th, 2001, 02:39 AM
kloc kloc is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 18 kloc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question maybe i dont know how to count

your code doesn't have 69 lines

Reply With Quote
  #3  
Old June 25th, 2001, 06:02 AM
eaamj01 eaamj01 is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Colchester, England
Posts: 131 eaamj01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 8 sec
Reputation Power: 8
Remember all PHP code has to be terminated with ';'

Check your code
PHP Code:
<TITLE> <?php echo $SiteName?> - Contact Us! </TITLE> 


Should be
PHP Code:
<TITLE> <?php echo $SiteName?> - Contact Us! </TITLE> 


Andy

Reply With Quote
  #4  
Old June 25th, 2001, 06:34 AM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 13
Send a message via AIM to rod k
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

Reply With Quote
  #5  
Old June 25th, 2001, 08:38 AM
dunderhead dunderhead is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 11 dunderhead User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #6  
Old June 25th, 2001, 12:49 PM
haryanto haryanto is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: USA
Posts: 4 haryanto User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 4 m 18 sec
Reputation Power: 0
Quote:
Originally posted by dunderhead
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.


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!

Reply With Quote
  #7  
Old July 4th, 2001, 11:57 AM
Jeewhizz Jeewhizz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: London, England
Posts: 31 Jeewhizz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to Jeewhizz
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

Reply With Quote
  #8  
Old July 9th, 2001, 09:03 PM
Slak Slak is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 21 Slak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Slak
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > I know I shouldnt be asking such simple question but this is my 2nd day trying php


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway