Wednesday, June 18, 2014

html formatted contact form with attachment link

If you are looking for a contact form which can send html formatted email to the recipient and if you have little bit knowledge about php you can try this html contact form with attachment link. it will send a html formatted  to the recipient.

HTML CODE

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="" content="">
</head>
<body>
<form method="POST" action="attachmail.php" enctype="multipart/form-data">
<table>
<tr>
<td>Nname</td>
<td><input type="text" name="name"/></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email"/></td>
</tr>
<tr>
<td>Phone</td>
<td><input type="text" name="phone"/></td>
</tr>
<tr>
<td>message</td>
<td><textarea name="comments" id="comments" class="field" tabindex="6"></textarea></td>
</tr>
<tr>
<td>select a file*</td>
<td><input name="file" id="file" type="file" tabindex="7"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" value="submit"/></td>
</tr>
</table>
</form>
</body>

</html>

php attachment.php

<?php
$to = "someone@reciver.com"; //change recivers email address
$from = $_POST['email'];
$subject = "attachment mail"; //change subject
$headers          = 'MIME-Version: 1.0' . "\r\n";
$headers         .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers         .= "From: The Sender $from" . "\r\n";

$name = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$imglink = $_FILES["file"]["name"];

$allowedExts = array("gif", "jpeg", "jpg", "png");
$temp = explode(".", $_FILES["file"]["name"]);
$extension = end($temp);

if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/jpg")
|| ($_FILES["file"]["type"] == "image/pjpeg")
|| ($_FILES["file"]["type"] == "image/x-png")
|| ($_FILES["file"]["type"] == "image/png"))
&& ($_FILES["file"]["size"] < 200000000)
&& in_array($extension, $allowedExts)) {
  if ($_FILES["file"]["error"] > 0) {
    echo "Return Code: " . $_FILES["file"]["error"] . "<br>";
  } else {
    echo "Upload: " . $_FILES["file"]["name"] . "<br>";
    if (file_exists("upload/" . $_FILES["file"]["name"])) {
      echo $_FILES["file"]["name"] . " already exists. ";
    } else {
      move_uploaded_file($_FILES["file"]["tmp_name"],
      "upload/" . $_FILES["file"]["name"]);
      echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
      $message = "<html>
<body>
<p><strong>Name:</strong> <br>$name</p>
<p><strong>Phone:</strong> <br>$phone</p>
<p><strong>Email:</strong> <br>$email</p>
<p><strong>Quote Information</strong> <br>$comments</p>
<p><strong>Submitted Files</strong></p>
<hr>
<a href='upload/$imglink'>$imglink</a>
</body>
</html>";
    }
  }
} else {
  echo "Invalid file";
}



mail($to,$subject,$message,$headers);

?>

Monday, June 9, 2014

Thursday, June 5, 2014

why choose worpress as your cms platform

Most of designers and developers love wordpress as a cms systems there are may reasons behind it.

  1. Open source: Wordpress is a opensource cms. It is free to download and use. It has a huge helpful community by which you can solve your problems related to wordpress. They share their thoughts, ideas and there programs.
  2. Easy to install: Most of web hosting company allows you to install wordpress on a single click through cpanel. if you are using a hosting login to your control panel scroll to the application and you will find wodpress. If you want to install wordpress on your system and if you are using a window computer you will require wamp server installed on your computer. Here is a video tutorial which will guide you 
  3. Eye catchy themes: Wordpress provide you three eye catchy themes to use by default. If you have basic knowledge about php, html, css, jquery you can make your theme which can be easily integrated to wordpress and you can give your website a great look according to your flavor.
  4. Easy cms: Wordpress is a very flexible cms platform where you can setup the modules according to your requirement. You can edit, save, publish your articals, page very easily. 
  5. S.E.O: SEO (Search Engine Optimisation) this is making your site search engine friendly and getting it to appear high up in the search engine results page. This area is constantly changing and be wary of companies who can promise miraculous results, however there  are still a number of simple things you can do with your wordpress site to assist it’s performance.
  6. pingback: Pingbacks are a form of automated comment for a page or post, created when another WordPress blog links to that page or post.When you publish a new blog post, WordPress attempts to ‘ping‘ all the sites that were linked to in your post. i.e. Your WordPress website is informing other websites that you’ve linked to them.When you receive pingpacks, then it means someone else has linked to one of your posts 
  7. Plugins: Wordpress has a huge collection of plugins which will add additional functionality to your website for downloading plugins you can visite "https://wordpress.org/plugins/".