Web Design Web Design Forum
Registration is free! Here you can view your subscribed threads, work with private messages and edit your profile and preferences Calendar Find other members Frequently Asked Questions Search
Home Web Design

Convenient web based access to our favorite web design Usenet groups

web design reviews

This is Interesting: Free Magazines for Graphics designers and webmasters  





  Last Thread  Next Thread
Author
Thread Post New Thread   

php contact form troubles
 

Jazztastic




quote this post edit post

IP Loged report this post

Old Post  12-30-05 - 11:29 PM  
I'm trying to create a contact form in php, but with no luck. I
contacted my provider and the came up with the following:

(quote)
For the mail function to work, you must send the mail as if it were
from A VALID Premium Hosting POP3 account. You do this by including the
name of the account in the mail headers, such as...

mail('nobody@example.com', 'the subject', 'the message', null, '-f{put
your pop3 email address here}');

OR

$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: {put your pop3 email address here}' . "/r/n";
mail($to, $subject, $message, $headers);
(/quote)

The script that handles the form is:

# RegisterGlobals ON

$FTGfirstlastname = $_POST['firstlastname'];
$FTGemail = $_POST['email'];
$FTGrepeatemail = $_POST['repeatemail'];
$FTGage = $_POST['age'];
$FTGcpubrand = $_POST['cpubrand'];
$FTGSubmit = $_POST['Submit'];

# Redirect user to the error page

if ($validationFailed == true) {

header("Location: error.html");
exit;

}

# Email to Form Owner

$emailTo = '"name" <info@mysite.info>';

$emailSubject = "The contact form";

$emailBody = "firstlastname: $FTGfirstlastname\n"
. "email: $FTGemail\n"
. "repeatemail: $FTGrepeatemail\n"
. "age: $FTGage\n"
. "cpubrand: $FTGcpubrand\n"
. "Submit: $FTGSubmit\n"
. "\n"
. "";

$emailHeader = "From: $FTGemail\n"
. "Reply-To: $FTGemail\n"
. "Content-type: text/plain; charset=\"ISO-8859-1\"\n"
. "Content-transfer-encoding: quoted-printable;\n";

mail($emailTo, $emailSubject, $emailBody, $emailHeader);

# Redirect user to success page

header("Location: success.html");
exit;


Thanks in advance



Post Follow-Up to this message ]
Sponsored Links
 





All times are GMT. The time now is 01:51 AM. Post New Thread   
  Previous Last Thread   Next Thread next
Dreamweaver archive | Show Printable Version | Email this Page | Subscribe to this Thread

Popular forums

Adobe Photoshop forum Macromedia Flash Web Site Design
Dreamweaver FrontPage forum
JavaScript Forum XML forum
Style Sheets VRML
Forum Jump:
Rate This Thread:

 

XML RSS Feed web design latest articles Syndicate our forum via XML or simple JavaScript

Web Design archive  Database administration help  


Top Home  -  Register  -  Control Panel   -  Memberlist  -  Calendar  -  Faq  -  Search Top