HTML Form to Email – PHP Code and Tutorial

Here is the code, copy and save to a file:

(Tutorial Follows) Anything in red can, or will need to be changed

<?php if($_POST['submit']){ $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message'];  if (!$name) die(‘Sending Failed, please fill in all fields.’); if (!$email) die(‘Sending Failed, please fill in all fields.’); if (!$message) die(‘Sending Failed, please fill in all fields.’);   $ToName = “Mat”; $ToEmail = “*********@bakerdesigns.co.uk”; $FromName = “$email”; $Subject = “New Question”; $Message = $message.”\n\nFrom: “.$name; $headers = “From: “.$FromName.”"; mail($ToEmail, $Subject, $Message, $headers)or die(“Email could not be sent”); die(‘ <html> <head>
<meta http-equiv=”refresh” content=”6;URL=\’../index.html\’”></head>
<body><div align=”center” style=”margin-top:200px; color:#333333;”><h2>Your Message Has Been Sent</h2><p>Thank you for your message, a reply will be sent shortly</p><p>You will shortly be redirected back to the homepage automatically</p><p><img src=”../images/ajax-loader.gif” alt=”Redirecting” /></p></div></body> </html> ‘);
}
?>

The Tutorial

First you need to create a HTML form. It needs to have three fields, one named name, one named email and another named message. Add a submit button. Make sure your HTML form’s action is set to the PHP file which contains the code above. Here is my example code:

<form id=”form1″ name=”form1″ method=”post” action=”scripts/FormToEmail.php“>
Full Name:<input type=”text” name=”name” id=”name” />
Email Address:<input type=”text” name=”email” id=”email” />
Message:<textarea name=”message” id=”message” cols=”35″ rows=”5″ onmousemove=”FillForm()”></textarea>
<input type=”submit” name=”submit” id=”submit” value=”Submit” />
</form>

Now change everything in red such as the redirect in the code and the ‘action’ tag in the HTML form. Also, you will need to copy the animated GIF below and save it somewhere. Put the location of this file in the PHP code section where the file location of “ajax-loader.gif” is placed.

Loader Image


Posted in Uncategorized | Leave a comment

Our New Website!!!

We have just completed our newly refurbished website. Instead of our old grey/black colour scheme, we decided to opt for a lighter white colour scheme. We decided to use green and blue to enhance aesthetics and our new ‘globe’ logo suits us just right.

Visit Web Design Halifax by Baker Designs for a look.

So why?

Well, firstly, our Google rankings were good, but not good enough! We needed a website that was even more Google friendly than our old one and made sure it was crammed full of important key words like “Web Design Halifax” or “Website Design”. We also made our coding much neater and used XHTML to give the GoogleBot an easy experience, all our old table layouts are long gone, div tags have now been used coupled with CSS which makes the code much easier to read.

Our old website was much too simple and small. We couldn’t fit everything we wanted to say on there! We needed a website that would be easier to expand or add to and the new site enables many pages to be added easily along with links in the sidebar we created. The old site was also getting a little dated. Although it used top of the range jQuery effects to create a Mac style dock menu, it lacked the flourish our web design team are used to!

Posted in General Happenings | Tagged , , , | 3 Comments

Nivo Slider Slideshow / Gallery Positioning Problem

Here at Baker Designs – Web Design Halifax we use the Nivo Slider by Dev7Studios a lot. In fact, we think it is a superb jQuery plugin! We have had no problems with it up until now…

Last week two of our sites using this plugin started to position the slider all wrong. The first image was fine, but the next image did not cover the first, it was aligned more to the bottom of the slider.

————-

The problem with the slider was that we use the link to the newest version of jQuery through Google, and when the new version recently came out, it caused the Nivo Slider to act differently. To sort this out was very simple. Link to the jQuery version 1.6 and the Nivo Slider Positioning Problem should be sorted!

Here is what our link looks like – in the <head> section of our site, we are still using the link from Google…

<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js”></script>

Now the websites which had the Nivo Slider Positioning problem are fine.

Posted in General Happenings | Tagged , , , | 2 Comments

Web Design Halifax Portfolio

Posted in Web Design | Tagged , | Leave a comment

A Big Project for our Web Design Halifax team!

We recently teamed up with one of our good business friends to discuss a new venture for the both of us. It will be called Extra-Hours, but that is about all we can tell you i’m afraid! We are very exited and the project is about 65% complete at the moment.

If you take a look in our portfolio you can see a design of the website, but our team has been working on some great features using jQuery. Sliding down login screens, fading image sideshows are just some of the effects you will see on our new site. Our web design Halifax PHP programming team have been very busy on this project, but all the hard work is starting to pay off! It’s looking great!

As soon as we finish this site, we will post a link on our portfolio page for you to look at, you may even want to sign up, it’s going to be free!

Posted in Web Design | Tagged , , , , , , | 2 Comments

Baker Designs – Web Design in Halifax is Happy to be Joining the World of WordPress!

Here at Baker Designs Halifax web design we have been wondering for a while whether setting up a blog would be beneficial to us as a company. After a couple of months and our SEO team desperate for one, here it is!

We decided to use the simple but effective WordPress software. It was super quick to set up, and not much hassle to edit the CSS code (Styling). Now we can share our thoughts and feelings with the world from the small town of Halifax!

The main reason we have added a blog to our site is to connect better with our clients, but mainly for the search engine rankings it will give us. Our basic site only contains 4/5 different pages, meaning our competition just had it over us on the amount of content and keywords. A blog can provide an excellent place to add rich keyword content to your site, like “Web Design Halifax” and also gives you more room to expand a website and get your customers involved with the comments section.

We hope you enjoy reading our Halifax web design (<< A cheeky one) blog in the near future!

Posted in General Happenings | Tagged , , , , , , | 7 Comments