PHP form to email tutorial

This is a discussion on "PHP form to email tutorial" within the PHP Forum section. This forum, and the thread "PHP form to email tutorial are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 19th, 2007, 09:29
Reputable Member
Join Date: Oct 2006
Location: UK
Age: 25
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cullinanweb Send a message via Skype™ to cullinanweb
Smile PHP form to email tutorial

Hi there, there have been many posts on this subject asking for help so I have added this page with a link to a tutorial on my blog. I am constantly posting this link to help people maybe this post could be made 'sticky' to help others?

The link is http://www.cwebltd.co.uk/2007/06/05/...tact-form.html

hope this helps somebody.

Cheers
Dan
Reply With Quote

  #2 (permalink)  
Old Jul 4th, 2007, 13:38
SuperMember

SuperMember
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Pádraig
Re: PHP form to email tutorial

Thanks for that! Its exactly what I needed. Now I hope it will work for me!
Reply With Quote
  #3 (permalink)  
Old Jul 5th, 2007, 08:04
Up'n'Coming Member
Join Date: Jul 2007
Location: France
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP form to email tutorial

The link to emailvalidator.php is broken, so can't get the whole script to work.
Reply With Quote
  #4 (permalink)  
Old Jul 5th, 2007, 08:40
Reputable Member
Join Date: Jun 2007
Location: Bellevue, SK, Canada
Age: 28
Posts: 222
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP form to email tutorial

Quote:
Originally Posted by matelot View Post
The link to emailvalidator.php is broken, so can't get the whole script to work.
not here..
Right click on the link and save the destinationfile..
Reply With Quote
  #5 (permalink)  
Old Jul 5th, 2007, 09:02
Up'n'Coming Member
Join Date: Jul 2007
Location: France
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP form to email tutorial

Tried that. It won't save. I've inspected the code and the url. The link points to http://www.cwebltd.co.uk/emailvalidator.php, an empty file. Clicking on the link again produces an empty file.

What have I missed? Or will some kind soul post the contents?

Cheers
Reply With Quote
  #6 (permalink)  
Old Jul 15th, 2007, 12:58
Reputable Member
Join Date: Oct 2006
Location: UK
Age: 25
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cullinanweb Send a message via Skype™ to cullinanweb
Re: PHP form to email tutorial

sorry for the delay been on holidays, the contents of the file are
Code: Select all
<?php
     function check_email_address($email) {
  if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) {
    return false;
  }
  $email_array = explode("@", $email);
  $local_array = explode(".", $email_array[0]);
  for ($i = 0; $i < sizeof($local_array); $i++) {
     if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) {
      return false;
    }
  }  
  if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) {     $domain_array = explode(".", $email_array[1]);
    if (sizeof($domain_array) < 2) {
        return false; 
    }
    for ($i = 0; $i < sizeof($domain_array); $i++) {
      if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) {
        return false;
      }
    }
  }
  return true;
}
also have uploaded the correct file now for download

oops
Reply With Quote
  #7 (permalink)  
Old Jul 15th, 2007, 17:40
Up'n'Coming Member
Join Date: Jul 2007
Location: France
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP form to email tutorial

I can copy and paste as required, but in FF your download link doesn't work still. Under IE6, right click and save produces an empty .htm file. Clicking the link directly pulls up the .php with the only content visible as the html header.
Reply With Quote
Reply

Tags
email, form submitter, php

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
[SOLVED] Email Submit Form Problem, The tutorial From The Php Forum longstand PHP Forum 3 Nov 12th, 2007 20:06
PHP email form not sending email Kurt PHP Forum 1 Oct 12th, 2007 04:26
Form submits to email via php, but email is blank!!?? DH1234 PHP Forum 2 Jun 18th, 2007 10:42
Help Me With My Email Form Please bruno89 Web Page Design 6 May 2nd, 2006 12:40
php email form djme PHP Forum 3 Jan 1st, 2006 22:06


All times are GMT. The time now is 07:36.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

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