PHP Contact Mail Form

I know I have another of these posted on my blog however that one assumes that php global settings is OFF and many servers have it set to ON. So here is one that should work regardless of your server settings. To see an example of this working, just click on the contact page of my website in the links above.

Code:

<html>

<body>

<?php

//if submit button pressed

if(isset($_POST[‘submit’])){

//sending to my email
$name = $_POST[‘name’];
$email = $_POST[’email’];
$comments = $_POST[‘comments’];
$subject = $_POST[‘subject’];
$sql = “‘$name’, ‘$email’, ‘$comments'”;
$em = “‘$subject'”;
mail(‘enterYourEmailAddressHere’, $em, $sql);

echo(“<p>You message has been sent!” . “</p>”);
}
?>

<form name=”form1″ id=”form1″ method=”post” action=”<?=$PHP_SELF?>”>
<p align=”left”><strong>Name:</strong>
<input type=”text” name=”name” />
</p>
<p align=”left”>&nbsp;</p>
<p align=”left”><strong>Email:</strong>
<input type=”text” name=”email” />
</p>
<p align=”left”>&nbsp;</p>
<p align=”left”><strong>Subject:</strong>
<input type=”text” name=”subject” />
</p>
<p align=”left”>&nbsp;</p>
<p align=”left”><strong>Message:</strong>
<textarea name=”comments” cols=”60″ rows=”3″></textarea>
</p>
<p align=”left”>
<input name=”submit” type=”submit” id=”submit” value=”submit” />
<input type=”reset” name=”Submit2″ value=”Reset” />
</p>
</form>

</body>

</html>

HTML5: When will it be ready for prime time?

At this point, HTML5 is not ready to be used, which is why pretty much everyone is NOT using it. I recently did a test of a few of the major HTML5 tags, such as the video tag, one that will be most common, and it failed on more than 50% of the browsers I tested it on. I tested this on firefox, IE, Opera, and Safari for the mac and pc. Then on mobile devices including ipad, iphone, and android froyo. You can test the page yourself by clicking this link. Check to see where it works and does not.

So at this point, I would strongly recommend NOT using HTML5 until is becomes more standardized. Its just full of too many holes. As new browsers get released these holes may become larger or smaller so you really need to just pay attention. W3C has said the standards would be ready by 2014 and you currently can ‘trick’ all browsers into working but honestly I am not going to write code for every browser possibility. That is not the point of HTML5 and if that is the case I might as well use a plug in.

Anyone interested in learning html5 should check out: http://www.w3schools.com/html5/default.asp

And anyone interested in learning more about why HTML5 is not ready for prime time should check out this link. This site describes why youtube is continuing to use flash player and not HTML5: http://www.streaminglearningcenter.com/articles/what-is-html5.html

How compatible is HTML5 with current web browsers?

Apparently not too much. This is the latest comparison chart:

http://www.findmebyip.com/litmus/

It really doesnt matter which browser you are using, Firefox, Safari, Chrome, IE, or Opera – NONE of them are compatible at this point. Sure some of them are somewhat compatible but none are even close to fully supporting most options. What does this mean for HTML5? It means that at this point, I would be very weary of developing for it. Wait until its fully compatible then do it.

Essentially if all new browsers from today on were 100% compatible I would still wait some time before developing for HTML5. Why? Most users to not upgrade their browsers unless they are set up update automatically. Thus you would be developing something that more than likely only your tech savvy users are able to view.

HTML5 just DHTML?

We all remember DHTML from the late 90’s and early 2000’s. The potential was awesome. Functionality that combined html4, css2 and javascript. It turned out to be a big flop because there were not dhtml standards that all browsers would adopt making a website compatible on one browser but not the others. Thus DHTML faded from the spotlight – but never disappeared.

Recently there has been a lot of buzz around HTML5, mainly because Apple has been avid on not using Flash on their iPhone and iPad. HTML5 is simply html5, css3, and javascript combined. Seem familiar to DHTML (html4, css2, and javascript)? Absolutely. It is basically the same thing. Another similarity is that right now HTML5 is a mess on browsers. There are no standards so what works on one browser is not working on another. Will it have the same downfall as DHTML? I dont know but I do know that people are excited to see what happens.

The one thing people need to not confuse is that HTML5 is an update to HTML4 and HTML5 refers to a combination of HTML5, CSS3, and Javascript. Seems confusing but what everyone is talking about is the combination, not just HTML5 by itself.

SEO (Search Engine optimization)

Here is a list of the main things I have used to keep my sites consistently in the # 1 ranking for my chosen keywords in Google:

1. Content

Content is king. The more content you have on your site, actually related to your site, the more Google will like you. Google loves content. And you cannot trick them.  This is the number one way to get your site listed as high as possible in search results. A problem with content is that spiders like text content. This makes flash based content not as readable.

2. Site Analyzers

Go to: http://www.widexl.com/. Use the SEO tools on the right hand side to test how your site is currently doing. You can gain more insight on the importance of SEO and its tools from websites like WebChimpy.com. Most importantly, the meta tag analyzer. Your meta tags should be as close to 100% as possible, no less than 90%.

3. Tags

Make sure your meta tags and title correctly match your site.

Meta tags go in the <head> html tag usually just after the title.  There are 4 meta tags I always include on my sites: keywords, description, author, and robots. Here are examples:

<meta name="Keywords" content="keyword 1, keyword 2, keyword 3, etc" />
For the keywords, you need to write keywords that match your site.
<meta name="Description" content="describe your site here/>
For the description, you need to write a 1-2 sentence description of your site. 
This should include as many of your keywords as possible.
<meta name="author" content="write author here" />
For this, instead of a name, I usually write the site name here
<meta name="robots" content="index,follow" />

This section remains unchanged. You are telling the spider to go to the index page and follow all the links.

<title>my title</title>

The title should match your site.

4. Site map

Have a site map somewhere that will link all of your pages. Having an additional, xml sitemap can help as well.

5. Links to your site

Have other related sites link to yours. The more sites that link to yours the better Google will like you and the higher your page rank will be.

6. Code

Make sure the code of your site is clean – lots of css and no tables. Better code = higher ranking. Monitor web20ranker review as it is an accurate indication of a company’s diligence and competence. No dreamweaver templates (unless you create the template yourself, this means NO premade ones from anywhere but your code). No dreamweaver code unless you wrote it. Google doesn’t like made up code. You need to write the code yourself and make sure you debug it. Otherwise the spiders will not like you.

Some rules for step 6:

No dreamweaver, code only

Only external CSS

No tables only div tags

Please debug the code

No hidden code – this is a huge no no. You cannot trick Google they are smarter than you think

Flash is great but cannot be seen by spider. Text is best.

7. My links

Make sure any links to external pages work.

Some sources:

Straight from Google on their rankings: http://www.google.com/support/webmasters/bin/answer.py?answer=35769