Form subssion script

talentedone

Well-Known Member
Joined
Jan 30, 2008
Messages
218
Reaction score
0
Form submission script

As some of you may be aware i have been designing a website www.easyscan.co.za from scratch and have NO EXPERIENCE with programming whatsover. I have now done an "Enquiries /Contact Us" page which has forms that a potential customer would submit. I need a script (or so I believe) to actually have the customers information sent to my email address i.e [email protected]. Does anyone have the code for such a script?


PS: I have not used any of the Wordpress templates as none of them met the look I wanted for the website.
 
Last edited:
Thank you hitchcock for your help. Can someone using a tablet please confirm whether the page is loading correctly as on my cellphone(Symbian :whistle: ) the buttons are all over the place
 
Please don’t take it the wrong way. But your website looks HORRIBLE,HORRIBLE HORRIBLE!
Even if you cant find a wordpress template, I’m sure the worst wordpress template would look beter than what you have there (By Miles!)
You can also try find free straight HTML/CSS templates then modify to your needs.


Enough with the criticism.
Make This http://www.w3schools.com/ your new best friend.

Your website hosting, is it PHP or ASP capable ?
Usually you need a pre processor such as ASP or PHP to get the values sent from the form.

I.E From http://www.w3schools.com/php/php_forms.asp
On a page called form.html you have

PHP:
<html>
<body>

<form action="welcome.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>

</body>
</html>

And on welcome.php you have
PHP:
<html>
<body>

Welcome <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?>

</body>
</html>

From there you need to do something with the variables $_POST["name"] & $_POST["email"]
In your case email it, you can send SMTP mail with php without using Java

Once you have a bit of PHP/ASP experience Investigate some CSS frameworks such as bootstrap, it will make life much easier. a typical bootstrap page will look like this.

http://getbootstrap.com/examples/theme/ there are many ways to change the colors and the theme of it.





IMO , tech your self some php, much easier to learn than ASP.NET and about the same learning curve as Classic ASP, but classic ASP is a bit redundant.
 
Last edited:
Hi I got the php script from one of the members here and had to make some tweaks to it. Instead of a subject field I have added check boxes for potential customers to indicate which particular service they are interested in. The problem is the php script did not come with code for checkboxes so I'm not sure how to "collect" the input from the checkboxes. Does anyone have a php form script has code for checkboxes as well. If possible throw in radio buttons while at it.

BTW I am currently hosting with Gridhost so if any of you are hosting with them and know of resources that would make what I'm doing much easier please tell me.
 
Last edited:
I did try a template from my previous hosting provider but I was not happy with ALL the templates as they all pretty much did not fit the format I was looking for AND it would have taken too much time for me to modify them. In fact this eve led me to change my hosting provider as the previous one did not allow me access to the HTML code. I also tried some Word Press template and the Wordpress dashboard was just not user-friendly for me especially having used the more user-friendly blogspot dashboard. So here we are. Plz help, it's a learning curve and i have always been interested in PHP
 
Last edited:
Like this.

Save the below in a file called test.php, upload to your server and try it out.
PHP:
<?php
if(!empty($_POST["fName"])){$fName=$_POST["fName"];}else{$fName='Nothing Yet';}
if(!empty($_POST["fEmail"])){$fEmail=$_POST["fEmail"];}else{$fEmail='Nothing Yet';}
if(!empty($_POST["fCheckBox1"])){$fCheckBox1=$_POST["fCheckBox1"];}else{$fCheckBox1='Nothing Yet';}
if(!empty($_POST["fCheckBox2"])){$fCheckBox2=$_POST["fCheckBox2"];}else{$fCheckBox2='Nothing Yet';}

//Process the checkbox Value
if($fCheckBox1=='ThisWASChecked'){$fCheckBox1='Checked';}else{$fCheckBox1='Was Not Checked';}
if($fCheckBox2=='ThisWASChecked'){$fCheckBox2='Checked';}else{$fCheckBox2='Was Not Checked';}

echo '
<h3>The following information was retrieved from the HTML form</h3>
<table>
<tr><td>Name</td><td>' . $fName . '</td><tr>
<tr><td>E-mail</td><td>' . $fEmail . '</td><tr>
<tr><td>CheckBox Value 1</td><td>' . $fCheckBox1 . '</td><tr>
<tr><td>CheckBox Value 2</td><td>' . $fCheckBox2 . '</td><tr>
</table>

';
?>


<br><br><br>
<form action="test.php" method="post">
<table>
<tr><td>Name:</td><td><input type="text" name="fName" size="40"></td></tr>
<tr><td>E-mail:</td><td><input type="text" name="fEmail" size="50"></td></tr>
<tr><td>Check Me 1</td><td><input type="checkbox" name="fCheckBox1" value="ThisWASChecked"   ></td></tr>
<tr><td>Check Me 2</td><td><input type="checkbox" name="fCheckBox2" value="ThisWASChecked" checked  ></td></tr>
<td><td><input type="submit" value="Contact Us"></td></tr>
<table>
</table>
</form>
 
Thank you very much, had been trying some other method which returns a yes for the box if it is checked
 
Last edited:
ha ha ha woooooo shyyyyt I did it!!!! My own website from scratch. Thanks for helping guys. Now I can start with the bells and whistles like flash animation
 
Please tell me that the development of that website is still in its infancy. It makes my eyes bleed. I hate to say this, but that website doesn't have a single redeeming quality in its current form. When I decided to make a website for my mom I didn't have any web development knowledge either, but what I produced looked tidy, simple and professional. I took the time to complete some Udemy courses on web development before tackling the website, and I'm now fairly competent with HTML5, CSS3, JavaScript, PHP, MySQL, XML, JSON, AJAX and jQUERY. I spent about two months doing the courses in my spare time.

Before planning the site, I Googled for a directory of beautiful modern websites and found this:
http://www.webdesign-inspiration.com/web-designs/style/modern

It helped point me in the right direction with regards to the overall design and also allowed me to benefit off the work of professional designers and pinch some nifty ideas I saw some of them use.
 
Thank you very much, had been trying some other method which returns a yes for the box if it is checked


Well , where it says, 'ThisWASChecked' could have been "yes" as well, it can be billybob doesnt matter, if it wasnt checked the form wil just pass a blank
 
Please tell me that the development of that website is still in its infancy. It makes my eyes bleed. I hate to say this, but that website doesn't have a single redeeming quality in its current form. When I decided to make a website for my mom I didn't have any web development knowledge either, but what I produced looked tidy, simple and professional. I took the time to complete some Udemy courses on web development before tackling the website, and I'm now fairly competent with HTML5, CSS3, JavaScript, PHP, MySQL, XML, JSON, AJAX and jQUERY. I spent about two months doing the courses in my spare time.

Before planning the site, I Googled for a directory of beautiful modern websites and found this:
http://www.webdesign-inspiration.com/web-designs/style/modern

It helped point me in the right direction with regards to the overall design and also allowed me to benefit off the work of professional designers and pinch some nifty ideas I saw some of them use.

The point is the fancier the website the more complex the code/language, needless to say I simply don't have the time to invest in learning code just to build one website when I will never use those skills again. If I had the cash to splurge I would just have one done for me
 
The point is the fancier the website the more complex the code/language, needless to say I simply don't have the time to invest in learning code just to build one website when I will never use those skills again. If I had the cash to splurge I would just have one done for me

It looked like a business website to me. Directing potential customers to it would be a disaster. There are local companies that will build you a basic but professional ten page website for around R3k. A professional website doesn't have to be fancy or have complex code btw.

Building a website requires knowledge and skill - neither of which you possess. You have two options - acquire that knowledge and skill or pay someone else who has them. It's really quite a simple dilemma.
 
Fine. Fine. Fine I will nab one of those really fancy templates and do my website from scratch all over again. Problem is I cant find a template I like. I want to have my services right on the front page I dont want customers having to click around from link to link or scrolling down the length of 3 pages just to find the information they are looking for and a lot of those world class websites seem to have that...endless scrolling down. I hate that. I reaaaaally hate the scrolling. If I hate it on a PC imagine on a tablet/touch screen phone.
 
Last edited:
As some of you may be aware i have been designing a website www.easyscan.co.za from scratch and have NO EXPERIENCE with programming whatsover. I have now done an "Enquiries /Contact Us" page which has forms that a potential customer would submit. I need a script (or so I believe) to actually have the customers information sent to my email address i.e [email protected]. Does anyone have the code for such a script?


PS: I have not used any of the Wordpress templates as none of them met the look I wanted for the website.

Dude my eyes are burning!!!!!

Besides the way the site looks, I take my hat off that you actually are actually doing something to try and better yourself.
As for web design, we all need to start to learn somewhere or other.
Keep in mind this will be the front of your business and you know that thing they say about first impressions...

I would suggest going on http://teamtreehouse.com/tracks/front-end-web-development, Sign up for a 14 day free trail and do the front end web dev track, they start off building a simple but stylish portfolio website that you can complete before your trail is over.
Good Luck!
 
Am using weebly now for their template, still don't like the templates they have but to please the choir and the "customers" I will redesign the website.
 
and yes I have downloaded HTML, PHP, mySQL, java books from kickasstorrents hopefully this will whip me into good shape
 
Top
Sign up to the MyBroadband newsletter
X