| | |||||
| ||||||||
| CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) | ||||||||||||||||
| NamePros Member Join Date: Mar 2004 Location: Middle Earth (NZ)
Posts: 149
![]() | PHP Form Script, Nice 'n' Easy! OK, I posted this reply to many people that wanted a bit of help with their form and decided to package it up here for all to benefit from a nice quick and easy to implement php form script that will process unlimited fields in a form, you just have to name them in the HTML side of things, it doesn't get any easier if you are just starting out. OK, here we go: First off, copy the text below and save this as formscript.php (you can name it anything but for this example thats what I will call it ) Simply change the details in the "$To", "$From" and "$Subject" fields below to suit, I have bolded them below also to make it easier. Now ... you just change the address near the bottom of this script just after "header("location:" part that is in bold below to either, your homepage or a "thank you" page that says, "thanks" and confirms the eMail has sent then re-directs to where you want it too, usually your homepage (again ... I have made the code bold where you have to change it slightly to suit but it pretty straight forward, honest!) Here is the PHP Script:
NOTE: for the eMail to come through as the senders name and eMail, make sure you have a field named "name" and one named "email" to reflect the php script right at the top, see below
![]() The above code I have used in forms for a few years now on many contact pages and has never let me down, to give you an instant idea of how it formats here is an eMail form my hosting site a while ago now:
????: NamePros.com http://www.namepros.com/showthread.php?t=28903 Just make sure you name them appropriately to make sense of your questions being answered from your form. I hope this helps someone out there looking for a simple solution like this and if I have seemed to of rushed my explanation and you are still confused, reply to this thread for a prompt reply. Warm Wishes,
__________________ Script Installation, Avatars, Banners and Buttons for $NP or Paypal, PM me your requirements :D Deni J Vanin | Freelance Jobs and Forums | Web Design
Last edited by OneEyedDog; 04-30-2004 at 04:06 PM.
| ||||||||||||||||
| |
| | #2 (permalink) |
| Electrifying Guy ![]() Join Date: Sep 2003
Posts: 4,749
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Hi there! Thanks for this incredible post! You've certainly explained it in practically layman's terms. I've 2 questions about this form you posted: 1. If a person wants my free report and inputs his/her ????: NamePros.com http://www.namepros.com/showthread.php?t=28903 1st & last name & email then clicks GO, what code do I input in my site that, after the page redirects after the user clicked GO, my redirected page will greet him/her? I was looking for a script or code that'll allow my site to start off by saying "Hi 1st Name!" based on how he/ she input his/her 1st name from the subscription form. An example is projectmousetrap.com... 2. Is there a string or code that'll "allow" any valid email address thru? The reason I ask is because the current mailing list manager I use gave me an "email doesn't exist" error message when I clicked on the link to confirm subscription....even if the email actually exists! Hope you can help. Thanks! |
| |
| | THREAD STARTER #3 (permalink) | ||||||||||||
| NamePros Member Join Date: Mar 2004 Location: Middle Earth (NZ)
Posts: 149
![]() | Howdy ![]()
????: NamePros.com http://www.namepros.com/showthread.php?t=28903
It will display this message in the "echo" filed after you submit the form as above. Hope this helps on that one.
Warm Wishes,
__________________ Script Installation, Avatars, Banners and Buttons for $NP or Paypal, PM me your requirements :D Deni J Vanin | Freelance Jobs and Forums | Web Design | ||||||||||||
| |
| | THREAD STARTER #7 (permalink) |
| NamePros Member Join Date: Mar 2004 Location: Middle Earth (NZ)
Posts: 149
![]() | Thanks
__________________ Script Installation, Avatars, Banners and Buttons for $NP or Paypal, PM me your requirements :D Deni J Vanin | Freelance Jobs and Forums | Web Design |
| |