Sunday, 1 December 2013

Send e-mail in PHP

For Sending Mail in PHP their is inbuilt funtion to send e-mails in php but this function only works in server where you can send your e-mail with your server e-mails.

mail(to,subject,message,headers,parameters)

Here is running example of mail function in php

<?php
if(isset($_POST['btn_email']))
{
$email_to = "sender-email";
        $email_subject = "Subject";
$name=$_POST['name'];
$email=$_POST['email'];
$sub=$_POST['Subject'];
$messagenew=$_POST['message'];
$email_message = "Name: ".$name."\n";
    $email_message .= "Email: ".$email."\n";
    $email_message .= "Subject: ".$sub."\n";
    $email_message .= "Message: ".$messagenew."\n";
// create email headers
$headers = 'From: '.$email."\r\n".
'Reply-To: '.$email."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);  
 
echo"<script>alert('Thank you for contacting us. We will be in touch with you very soon.');</script>";
}
?>
<form action="Contact.php" method="post" class="std" enctype="multipart/form-data">
<h1 style='color:black'>Send a message</h1>
<p class="text select">
<label for="id_order">Name</label>
<input type="text" name="name" id="name" value="" />
</p>
<p class="text select">
<label for="id_order">Subject</label>
<input type="text" name="Subject" id="Subject" value="" />
</p>
<p class="text">
   <label for="email">E-mail address</label>
<input type="text" id="email" name="email" value="" />
</p>
<p class="textarea">
<label for="message">Message</label>
<textarea id="message" name="message" ></textarea>
</p>
<p class="submit">
<input type="submit" name="btn_email" id="btn_email" value="Send" class="button_large" onclick="$(this).hide();" />
</p>
</form>
You Can Download It From Here : Click Here

For Any Query Please Write a comment !!

Thanks

Saturday, 30 November 2013

Web Based 3D Dock Menus



Here is The Complete Source Code of The 3D Dock Menu: 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>CSS 3D Dock Menu</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/interface.js"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="dock" id="dock">
  <div class="dock-container">
  <a class="dock-item" href="http://newwebonline.blogspot.in/"><img src="images/home.png" alt="home" /><span>Blog Home</span></a> 
  <a class="dock-item" href="http://newwebonline.blogspot.in/"><img src="images/email.png" alt="contact" /><span>Designer Wall</span></a> 
  <a class="dock-item" href="http://newwebonline.blogspot.in/"><img src="images/portfolio.png" alt="portfolio" /><span>Design Jobs</span></a> 
  <a class="dock-item" href="http://newwebonline.blogspot.in/"><img src="images/music.png" alt="music" /><span>Best Web Gallery</span></a> 
  <a class="dock-item" href="http://newwebonline.blogspot.in/"><img src="images/video.png" alt="video" /><span>IconDock</span></a> 
  <a class="dock-item" href="http://newwebonline.blogspot.in/"><img src="images/history.png" alt="history" /><span>Stock Icons</span></a>
  </div> 
</div>
<!--bottom dock -->
<div class="dock" id="dock2">
  <div class="dock-container2">
  <a class="dock-item2" href="http://newwebonline.blogspot.in/"><span>Home</span><img src="images/home.png" alt="home" /></a> 
  <a class="dock-item2" href="http://newwebonline.blogspot.in/"><span>Contact</span><img src="images/email.png" alt="contact" /></a> 
  <a class="dock-item2" href="http://newwebonline.blogspot.in/"><span>Portfolio</span><img src="images/portfolio.png" alt="portfolio" /></a> 
  <a class="dock-item2" href="http://newwebonline.blogspot.in/"><span>Music</span><img src="images/music.png" alt="music" /></a> 
  <a class="dock-item2" href="http://newwebonline.blogspot.in/"><span>Video</span><img src="images/video.png" alt="video" /></a> 
  <a class="dock-item2" href="http://newwebonline.blogspot.in/"><span>History</span><img src="images/history.png" alt="history" /></a> 
  <a class="dock-item2" href="http://newwebonline.blogspot.in/"><span>Calendar</span><img src="images/calendar.png" alt="calendar" /></a> 
  <a class="dock-item2" href="http://newwebonline.blogspot.in/"><span>Links</span><img src="images/link.png" alt="links" /></a> 
  <a class="dock-item2" href="http://newwebonline.blogspot.in/"><span>RSS</span><img src="images/rss.png" alt="rss" /></a> 
  <a class="dock-item2" href="http://newwebonline.blogspot.in/"><span>RSS2</span><img src="images/rss2.png" alt="rss" /></a> 
  </div>
</div>

<!--dock menu JS options -->
<script type="text/javascript">
$(document).ready(
function()
{
$('#dock').Fisheye(
{
maxWidth: 50,
items: 'a',
itemsText: 'span',
container: '.dock-container',
itemWidth: 40,
proximity: 90,
halign : 'center'
}
)
$('#dock2').Fisheye(
{
maxWidth: 60,
items: 'a',
itemsText: 'span',
container: '.dock-container2',
itemWidth: 40,
proximity: 80,
alignment : 'left',
valign: 'bottom',
halign : 'center'
}
)
}
);

</script>
</body>
</html>
Output Like This :




Download Click Here


Friday, 29 November 2013

How to Add Facebook Like box in website or Blog

I will show you how to add your facebook like box in your static or dynamic website. The Facebook Like Box show your website popularity on facebook . So don't wait just do it fast .

Step 1 : If you are put in your website . Then open your web page in which you want to show the facebook like box . Go To Head Section and at the end of end section you will copy following code :
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
 Step 2 : If you are using Blog or Google Blogspot. just go to your dashboard -> template and Edit HTML here you can find head tag. and Do step 1.


Step 3 : And at the end of body tag copy this code and change your url :



<style type='text/css'>
/*<![CDATA[*/
#fbplikebox{display: block;padding: 0;z-index: 99999;position: fixed;}
.fbplbadge {background-color:#3B5998;display: block;height: 150px;top: 50%;margin-top: -75px;position: absolute;left: -47px;width: 47px;background-image: url('http://1.bp.blogspot.com/-PUYBb2326SY/T13eXFv1sPI/AAAAAAAABdE/VOqfHVMXhWk/s1600/w2b_vertical-right.png');background-repeat: no-repeat;overflow: hidden;-webkit-border-top-left-radius: 8px;-webkit-border-bottom-left-radius: 8px;-moz-border-radius-topleft: 8px;-moz-border-radius-bottomleft: 8px;border-top-left-radius: 8px;border-bottom-left-radius: 8px;}
/*]]>*/
</style>
<script type='text/javascript'>
/*<![CDATA[*/
    (function(w2b){
        w2b(document).ready(function(){
            var $dur = 'medium'; // Duration of Animation
            w2b('#fbplikebox').css({right: -250, 'top' : 350 })
            w2b('#fbplikebox').hover(function () {
                w2b(this).stop().animate({
                    right: 0
                }, $dur);
            }, function () {
                w2b(this).stop().animate({
                    right: -250
                }, $dur);
            });
            w2b('#fbplikebox').show();
        });
    })(jQuery);
/*]]>*/
</script>
<div id='fbplikebox' style='display:none;'>
    <div class='fbplbadge'></div>
    <iframe src='http://www.facebook.com/plugins/likebox.php?href=Type_your_fb_page_URL&amp;width=250&amp;height=260&amp;colorscheme=light&amp;show_faces=true&amp;border_color=%23C4C4C4&amp;stream=false&amp;header=false' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width:250px; height:260px;background:#FFFFFF;' allowtransparency='true'></iframe>
</div>
 And You Get Following Output :


Thursday, 28 November 2013

How to use Geolocation API in HTML5

If you want to use Geolocation API in HTML5 , used to get geographical position by the user. 
It can be support by many browser now ,

Internet Explorer Firefox Opera Google Chrome Safari

Internet Explorer 9+, Firefox, Opera, Chrome and Safari are support Geolocation

The Example is : 



<!DOCTYPE html>
<html>
<body>
<p> your coordinates is :</p>
<script>
 if (navigator.geolocation)
    {
    navigator.geolocation.getCurrentPosition(showPosition);
    }
  else{x.innerHTML="Geolocation is not supported by this browser.";}
function showPosition(position)
  {
  x.innerHTML="Latitude is : " + position.coords.latitude + 
  "<br>Longitude is: " + position.coords.longitude;
  }
</script>
</body>
</html>
You Will Get Your Latitude and Longitude .

If You want to show your latitude and longitude in Google Map
Then you want to use Google Map API.

You Will Get Compelete Source Code Here .


<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
      #map-canvas { height: 100% }
    </style>
    <script type="text/javascript"
      src="https://maps.googleapis.com/maps/api/js?key=API_KEY&sensor=SET_TO_TRUE_OR_FALSE">
    </script>
    <script type="text/javascript">
      function initialize() {                                                                    navigator.geolocation.getCurrentPosition(showPosition);                                                                   var  Latitude =  position.coords.latitude;                                                                                       var Longitude = position.coords.longitude;                                         
 var mapOptions = {
          center: new google.maps.LatLng(Latitude, Longitude),
          zoom: 8
        };
        var map = new google.maps.Map(document.getElementById("map-canvas"),
            mapOptions);
      }
      google.maps.event.addDomListener(window, 'load', initialize);
    </script>
  </head>
  <body>
    <div id="map-canvas"/>
  </body>
</html>

Wednesday, 27 November 2013

How to upload custom template in Google Blogspot

  We can easily use our own template by following few steps as mentioned below.

     1. Select the Template from left menu and click on button Backup/Restore as shown below.


     
     2. Now if you want to keep safe your previous templates/settings then you may keep back file by     clicking button, or simply click "choose file" as shown below and upload you desired template ".xml" file.



     3. If you are again getting any problem you may ask you query in comments.

URL Rewriting in PHP

Apache Module is very difficult but now it come easier for you by using this tutorial or blog for that you will read properly and apply in your website.

For URL Rewriting or Sexy URL you have to start your apache rewrite module from Wamp or XAMP Server following STEPS are as Follows 

Step 1 : First Start Your Wamp/Xamp SERVER .

Step 2 : Now Go For Apache Module in Apache and Find rewrite_module and Click on it . it will show like this : 



Step 3 : Now .htaccess file not .htacces.txt ok .

Step 4 : And Write Code in .htaccess file like this 

1) Start Your Rewrite Engine On by using this code 

RewriteEngine On


2) And Type The following RewriteRule for all the pages 
 RewriteRule ^/(.*) http://www.example.com/$1 [L,R]

3) Now You can also apply Rewrite Condition For Example

# For sites running on a port other than 80
RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^/(.*)         http://www.example.com:%{SERVER_PORT}/$1 [L,R]

# And for a site running on port 80
RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST}   !^$


Now Total Solution is : 

RewriteEngine On
# For sites running on a port other than 80
RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^/(.*)         http://www.example.com:%{SERVER_PORT}/$1 [L,R]

# And for a site running on port 80
RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST}   !^$

RewriteRule ^/(.*) http://www.example.com/$1 [L,R]



Dynamic SEO using PHP

When it comes to updating title tags, meta descriptions, canonical link elements, etc. on a page-by-page basis, we often rely on the power of the client’s CMS. Whether we’re using WordPress plugins or Drupal modules to get the job done, we generally have a process that is efficient and feasible. No tinkering with template files. No scouring the web for alternative solutions. Simple implementation – just the way we like it.
Content Management Systems with built in SEO utilities are great. What happens, though, when you’re tasked with implementing all of the pertinent HTML elements page-by-page on a PHP based website with a static <head>? Let’s dive right in.

1. Make that <head> dynamic!

In most cases, each static PHP file, be it index.phpcontact.php, what have you, will reference the same header.php file via an include statement:
<?php include('header.php'); ?>
The include statement tells the server that any code within header.php should also be included in the file being requested. This way, we don’t have to write a lot of the same HTML on every content page. Instead, we have this one static file from which we can pull the necessary code. Note that theheader.php file doesn’t necessarily contain only the HTML <head>. Generally, it will include any code that is reusable at the top of the HTML document throughout the website (including the logo, navigation, banner, etc.). Let’s look at an example of code we might find in header.php:
<html lang="en">
<head>
<title>Page Title Here</title>
<meta name="description" content="Meta description goes here.">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="wrapper">
. . .
This is a bit stripped-down, of course, but it’s serviceable. Notice, though, that our title tag and meta description have static text values. Even if we edit these to be a bit more descriptive of a particular page, we’ll be effectively applying the same title and meta description to every page on the website. Not good. Fortunately, we can make these dynamic values (unique to each page) by using PHP variables. We’ll use the echo construct to place the necessary page-level variables(which we haven’t yet created) in the right spots in header.php.
<html lang="en">
<head>
<title><?php echo $pageTitle; ?></title>
<meta name="description" content="<?php echo $pageDescription; ?>">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="wrapper">
. . .
It’s safe to say that we’ll be implementing titles and meta descriptions on each page of the website. What about something like a canonical link element or meta robots markup, though? We might not want these on every page, but rather just select pages. To handle these elements, we’ll use a couple of conditional statementsIf the canonical URL and/or robots content is defined for a given page, then we’ll include the element(s) in the <head>. If the condition within the parentheses is met, then the code within the brackets ({ ... }) is executed.
<html lang="en">
<head>
<title><?php echo $pageTitle; ?></title>
<meta name="description" content="<?php echo $pageDescription; ?>">
<?php
// If canonical URL is specified, include canonical link element
if($pageCanonical)
{
echo '
<link rel="canonical" href="' . $pageCanonical . '">';
}
// If meta robots content is specified, include robots meta tag
if($pageRobots)
{
echo '
<meta name="robots" content="' . $pageRobots . '">';
}
?>

<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="wrapper">
. . .
Now that we have ourselves a <head> with elements that rely on page-defined variables, we’ve done most of the “hard” work. Let’s move on to defining these page-specific variables.

2. Define page-specific PHP variables

So, for each page on our site – all individual PHP files – we’ll need to define, at a minimum, two variables ($pageTitle and $pageDescriptionbefore our include(header.php) statement. Ideally, we would write in some conditionals to catch cases where these variables aren’t defined; but for now, we’ll just be extra careful to define them on each page. We have the option of defining two additional variables ($pageCanonical and $pageRobots), as well. To define a variable, we use the syntax: $variable = "This is a string";. Let’s go ahead and assign values to all four of our variables for the home page. We’ll be working with the index.php file. (The topic of our site is Orange Widgets).

<?php
// Define variables for SEO
$pageTitle = 'Orange Widgets | The Best Orange Widgets';
$pageDescription = 'Visit AwesomeOrangeWidgets.com to find the best orange widgets in all the lands (Oz included).';
$pageCanonical = 'http://www.awesomeorangewidgets.com/';
// We don't want the search engines to see our website just yet
$pageRobots = 'noindex,nofollow';
// Include header file
include('header.php');
. . .
?>
Simple enough, right? We’ve defined our title, meta description, canonical URL, and meta robots content with four PHP variables. Let’s see what the top of the source code looks like forindex.php.
<html lang="en">
<head>
<title>Orange Widgets | The Best Orange Widgets</title>
<meta name="description" content="Visit AwesomeOrangeWidgets.com to find the best orange widgets in all the lands (Oz included).">
<link rel="canonical" href="http://www.awesomeorangewidgets.com/">
<meta name="robots" content="noindex,nofollow">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="wrapper">
. . .
Not too shabby, eh? While it might seem like a pain to declare these variables on a page-by-page basis, it’s really not much different than using All in One SEO for WordPress or something comparable for another CMS. Once you’ve familiarized yourself with the concepts outlined above, you’ll find that editing the files directly isn’t as taxing a process as you might have thought. For those of you working on small PHP-based websites, I highly recommend implementing the dynamic<head> elements we’ve discussed. What takes minutes to implement could yield years’ of worth.