View previous topic :: View next topic |
Author |
Message |
andrewsheldon98 -
Joined: 09 May 2003 Posts: 2
|
Posted: Fri May 09, 2003 6:54 am Post subject: send email problem |
|
|
Code: |
<?
if ($Email) {
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
if($Name=="" || $Email=="" || $Comment=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if($errors==1) echo $error;
else{
$message="Name: ".$Name."
Email: ".$Email."
Comment: ".$Comment."
";
mail("mail@scpa.co.uk","Form Submitted at your website",$message,"From: phpFormGenerator");
header("Refresh: 0;url=http://www.scpa.co.uk/thankyou.php");
}
}
else {
?>
<form action="<?php $PHP_SELF ?>" method=post>
Name<input type=text name='Name'>
Email<input type=text name='Email'>
Comment<textarea name='Comment' rows=5 cols=40></textarea>
<input type=submit value='Submit Form'></form>
<?php
}
?>
|
Above is the script but when i submit the email the form resets its self with no errors. |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sat May 10, 2003 12:36 am Post subject: Re: send email problem |
|
|
Edit your php.ini file and locate the line beginning with register_globals and set it to register_globals=on .
For more information, search for register_globals on that forum . _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
andrewsheldon98 -
Joined: 09 May 2003 Posts: 2
|
Posted: Sat May 10, 2003 3:46 am Post subject: |
|
|
doesnt work when i try that. |
|
Back to top |
|
|
s1asher -
Joined: 20 Mar 2003 Posts: 53
|
Posted: Sat May 10, 2003 10:56 am Post subject: |
|
|
Have you specified an SMTP server/sendmail_path in php.ini?
If your using a windows host, then you should set:
Code: | [mail function]
; Setup for Windows systems
SMTP = smtp.my.isp.net
sendmail_from = me@myserver.com |
If you are using your own mail server, set the smtp.my.isp.net to localhost and you can change the sendmail_from to your desired email address. remember to keep the sendmail_path deactivated by keeping the ; before it.
I dont fully know how to use the sendmail_path is your running Linux (or other Unix based OS). If this is the case then perhaps someone else can post the answer.
Hope this Helps |
|
Back to top |
|
|
|