Tutorials
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOtherTutorials

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 Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old September 30th, 2004, 10:11 AM
skullzy skullzy is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: belfast
Posts: 50 skullzy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 50 m 7 sec
Reputation Power: 2
simple php formmail

here is a simple php formmail for those who need it
this will be a contact formail but it is easy to edit so you can do what you want with it.
---------------------------------------------
here is the form
---------------------------------------------
php Code:
Original - php Code
  1.  
  2.           </p>
  3.          
  4.           <form name="form1" method="post" action="">
  5.             <p>
  6.             <p><B>Name::: </B>
  7.               <INPUT TYPE = "text" NAME = "name" />
  8.             </p>
  9.             <p>
  10.                 <B>Email::: </B>
  11.                 <INPUT TYPE = "text" NAME = "email" /></p>
  12.             <p><strong>Comments:</strong><br>
  13.               <textarea name="comments" cols="50" rows="15" id="Comments"></textarea>
  14.             </p>
  15.             <p>
  16.               <input type = "submit" name = "submit" value = "Submit"/>
  17. </p>
  18.           </form>
  19. ######################
  20. here is the code to send the info to your emial address and to also check for errors
  21. ######################
  22. <?php
  23.  
  24.  
  25. if ($submit) { // if this is submited
  26.  
  27. // error messages (if nothing in box sends error) //
  28.     if ($name <= "")
  29.          $error = "Please enter Name";
  30.     else if ($email <= "")
  31.          $error = "Please enter  Email";
  32.         else if ($comments <= "")
  33.          $error = "please enter a Comment";
  34.         
  35.     if ($error) // if there is a error
  36.         echo ($error);
  37.     else {  // and if there not do this
  38. mail("Youremial@emailhost.com", "Contact", "name: $namenemail: $emailncomments: $comments","From: $name <$email>");   
  39.  
  40. Echo("Thank you $name,nyour information has been sent thank you.");
  41.  
  42.  
  43.     }
  44.        
  45. }
  46.  
  47. ?>

----------------------------------------------
don't forget to put your email address in

Reply With Quote
Reply

Viewing: Codewalkers ForumsOtherTutorials > simple php formmail


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 6 hosted by Hostway