Monday, 23 December 2013

How to Attacch File/Image From External URL(remote file/image) to e-mail

How to Attacch File/Image From External URL to e-mail Iam Previously explain about sending e-mails using PHPmailer and Gmail server in this added a code for attachment File/Image from Folder But
Now i'am Explain about how to attach a File/Image from External URl.

General File/Image attachemnet:
File/Image attachment from Remote:
$string = file_get_contents(""); 

$mail->AddStringAttachment($string, "01182013_220715.jpg", $encoding = 'base64', $type = 'application/octet-stream');
In case file_get_cotents field to load file use cURL,
Read More info about file_get_contents and cURL Click Here

Saturday, 21 December 2013

How To Validate Email, URL And IP in PHP

How To Validate Email, URL And IP in PHP I know to most PHP programmers, this isn’t a big deal. I am going to show us, how to validate Email, URL and IP address using their respective PHP validation function.
It is very important input by users are validated before they are sent for processing. Not validating what users enter can lead to a very big security breach and could make your website susceptible to hackers. PHP has a large number of filters for validation and sanitization, but we’re only going to see that of the Email, URL and IP address.
Let’s take a look at these validation filters and how they work.

Validating Email:
Function :– filter_var($value, FILTER_VALIDATE_EMAIL)
 $email = "";
 if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
 echo "This ($email) email is valid.";
 else {
 echo "This ($email) is not valid.";
Validating URL:
Function – filter_var($value, FILTER_VALIDATE_URL)
 $url = '';
 if (filter_var($url, FILTER_VALIDATE_URL)) {
 echo "This ($url) URL is valid.";
 else {
 echo "This ($url) URL is not valid.";
Validating IP address:
Function – filter_var($value, FILTER_VALIDATE_IP)
 $ip = '';
 if (filter_var($ip, FILTER_VALIDATE_IP)) {
 echo "This ($ip) IP address is valid.";
 else {
 echo "This ($ip) IP address is not valid.";

Thursday, 19 December 2013

Sending e-mail using SMTP server of Gmail with PHP.

Sending e-mail using SMTP server of Gmail with PHP. This article is about send emails in SMTP(Simple Mail Transfer Protocol) using phpmailer by gmail server,
Here we are using PHPMailer for send emails using SMTP in php
It is very easy process.....

Tuesday, 17 December 2013

Get longitude & latitude values with Google Maps API using PHP

Get longitude & latitude with Google Maps API get the latitude and longitude values from Google Maps API, based on the town, city or country location.
  $url = "";
  $response = file_get_contents($url);
  $response = json_decode($response, true);
  $lat = $response['results'][0]['geometry']['location']['lat'];
  $long = $response['results'][0]['geometry']['location']['lng'];
  echo "latitude: " . $lat . " longitude: " . $long;
The URL takes in 3 parameters: address (your main location), region (optional but can help with ambiguity) and sensor (indicates whether or not the request will come from a device with a locational sensor).
The print_r command commented out above is a useful way to work out the array structure that you need to drill down to. To get the longitude and latitude values, we need to drill down through 5 levels.

More Info vist:

Friday, 13 December 2013

Delete file/image in cakephp

Delete images in cakephp For instance, you would like to delete car.jpg under YOUR WEBROOT/img folder.
First, you construct a File object:
App::uses('File', 'Utility');

$file = new File(WWW_ROOT .'img/car.jpg',false, 0777);

   echo "file/image deleted successfully";
   echo "file/image failed to be delete";
$file->delete() return true when the file has successfully been deleted. Hence, we check for successions of file deletion using the if statement as shown above.
*** I hope this Post helps to You ***

Wednesday, 11 December 2013

How To Browse More Securely in Cyber Cafe or on Public PCs ?

How To Browse More Securely in Cyber Cafe or on Public PCs ? Learn on the serious topic of how you can browse more securely on others/Public PCs or when you are in Cyber Cafe.Yes , it is a very serious topic that how you can browse whenever are far from your personal PC and at that time you have to browse from any cyber cafe without any idea of whether the Systems are secure or not for browsing , and you have to open your important online accounts like Internet banking ,Credit/Debit Card transactions , Official Email-IDs ,Blogging Account and Social networking account like(Facebook,Twitter,LinkedIn) which shows your virtual or vital public presence .Without knowing how others manage their system security , you signing in to your account and a day you will shocked that your account have been misused and you do not know anything about what happened , why happened.

Monday, 9 December 2013

Meta Tags and its importances

What is Meta Tags and Use of Meta Elements Meta Tags or Meta Elements are the HTML or XHTML elements used to provide structured meta data about the web page. It may contain the page description, keywords or about robot etc.. This meta tags plays a major role in Search Engine Optimization (SEO). it place between the <head> and </head> tag.

Saturday, 7 December 2013

Using PHP Generate Excel Report From Database

When developing a website that uses a database, quite often there would be a requirement to store dynamic data in a table, whether that be contact form entries, activity logs, or even lists of registered users.

While that data can be easily extracted directly from the database using database software, you may need to export that data using a web application. The following code is some useful PHP that can be used to take all data from a MySQL table and export them in a Excel format, that can be downloaded by the user as a Excel sheet.

Friday, 6 December 2013

Disable back button of your browser using javascript(Cross browser compatible)

It is an interesting browser hack and which uses hash values to prevent the default functionality of browser back button.But it and can be very annoying to use in your website and may be your user can dump your website . So please don't use that until if you have a really valid reason for it.

just at the top of your script .It set the hash value to 'no-back-button' at the time of page load.

Wednesday, 4 December 2013

Ubuntu 12.04 can’t connect to the internet

It seems this is a common problem with an easy fix.
sudo apt-get remove --purge resolvconf
After that Restart your Networ, Using following command.
sudo /etc/init.d/networking restart
sudo service network-manager restart

Friday, 22 November 2013

Where Should The Google Analytics Tracking Code to Be Placed?

The Analytics snippet is a small piece of JavaScript code that you paste into your pages. It activates Google Analytics tracking by inserting ga.js into the page. To use this on your pages, copy the code snippet below, replacing UA-XXXXX-X with your web property ID. copy and paste the code into the body of the page, right before the closing </body> tag

Wednesday, 20 November 2013

How to block Inappropriate words with javascript validation

This post about how to block Inappropriate/bad words content with java script validation.
Its a simple and easy to implement program hope you enjoy it.

Tuesday, 19 November 2013

Foreach equivalent in javascript

foreach function in PHP is very nice and easy to use,I am explain about equivalent function in javascritpt
<script language="javascript" type="text/javascript">
var new_array = new Array('knowledge','corner','srinu','chilukuri');
for (var key in new_array)
{     alert(new_array[key]); } </script>

Tuesday, 12 November 2013

How to use MySQLi_connect in PHP

As you all knows that MySQLi is improved PHP extension of MySQL which is introduced in PHP 5. MySQL is deprecated in PHP 5.5 will be removed in future. We have millions of applications using PHP MySQL and needs to be updated on MySQLi or PDO (PHP Data Objects is also a new extension you can use to use in your applications). So today i am going to give you a very simple integration guide of MySQLi how to connect to a database, how to run a query and insert records etc hope you like this article.

Thursday, 31 October 2013

How to Import CSV File Data Into Mysql Using PHP

How to Import CSV File Data Into Mysql If you are a developer then definitely you might have faced this. Many times you need to import data from a CSV (comma separated value) file and insert it into your MySQL database. Say for Example consider a case when you have many records in a CSV file and you need to import them into your MySQL database then you can’t insert each n every single record manually as it will take too much time.

Tuesday, 29 October 2013

Error: SQLSTATE[HY000]: General error: 1364 Field ‘xyz’ doesn’t have a default value

By default, MySQL is enabled with strict_mode ON, which will most likely cause problems with older PHP applications written for MySQL 4. For example, strict mode will return an error on insert statements if an empty string is provided where an integer is expected.
You may disable strict mode in one of two ways:

you can run the following in phpMyAdmin
SET @@global.sql_mode="";
or Open your “my.ini” file within the MySQL installation directory, and look for the text “sql-mode”. Find:
# Set the SQL mode to strict
and change to
# Set the SQL mode to strict

Wednesday, 23 October 2013

Username Availability Checker With jQuery and Ajax

You might have seen many websites which checks username availability in real time during registration process.For example Gmail or twitter sign up processes, their registration process is user oriented , it tells user availability on run time.
This Article is to create a similar script which will tell username availability at run time.

In this article we are checking the username entered by the user during filling the form with the usernames already stored in the database using Ajax and Jquery on run time.


Monday, 21 October 2013

How to install adobe reader on ubuntu

This article help you to install adobe reader on Ubuntu
Adobe reader is a free and most trusted software to view PDF is the one of the essential software must installed in all kind of operating systems like linux , windows , MAC, tablets and mobiles


Thursday, 17 October 2013

Linux Chown Command Examples to Change Owner and Group

The concept of owner and groups for files is fundamental to Linux. Every file is associated with an owner and a group. You can use chown and chgrp commands to change the owner or the group of a particular file or directory.

In this article, we will discuss the ‘chown’ command as it covers most part of the ‘chgrp’ command also.

1. Change the owner of a file
$ls -l filename
-rw-r--r-- 1 srinu chilukuri 0 2013-10-16 20:03 filename

$ chown root filename

$ls -l filename
-rw-r--r-- 1 root chilukuri 0 2013-10-16 20:05 filename

So we see that the owner of the file was changed from ‘srinu’ to ‘root’.

Wednesday, 16 October 2013

Character counter in JavaScript

This is about creating a character counter for textarea and limit it accordingly. You may have seen this kinda stuff in some messaging site mostly in sites which provides SMS facilities. They limit us to enter only specified number of characters in text area. Also in some sites there are limitation on characters in comments.Twitter also having character limit in tweet.

Iam explained in this article, how to use the count character javascript with the help of a form. The count value decreases when you type each character into textbox.


Tuesday, 8 October 2013

Php script for downloading files

In this article am going to explain you how to create PHP file downloader to download any files from web server to local machine. This application works mainly on the header of the PHP.
When you want to download any file you need to send the file name to this application, rest of the thing PHP will handle.

Saturday, 5 October 2013

file_get_contents vs cURL

In this Post,I will explain difference between file_get_contents and curl.

PHP offers two main options to get a remote file, curl and file_get_contents. There are many difference between the two. Curl is a much faster alternative to file_get_contents.

Using file_get_contents to retrieve took 0.198035001234 seconds. Meanwhile, using curl to retrieve the same file took 0.025691986084 seconds. As you can see, curl is much faster.

file_get_contents - It is a function to get the contents of a file(simply view source items i.e out put html file contents).

Friday, 4 October 2013

Tweet Images using PHP (Twitter API)

Hi already I'm Expalin about how to create Twitter App ,Today i have worked on Twitter Oauth in this post expalin about how to tweet with images using php with Twitter API.

First we have to Create Twitter App The Twitter App Creation Process Find Here

How the Tweet Images Code Works?
The code for tweet images divided in two files, the first is “start.php” where the code start and a second file “callback.php” where twitter will redirect user back after giving authorization to our app. (the URL to our callback.php file has been updated in App settings at the time of app creation )

Wednesday, 25 September 2013

Simple Drop Down Menu with Jquery and CSS

This post is very basic level Jquery and CSS implementation. I want to explain how to design simple drop down menu with CSS, HTML and Jquery.
This system helps you to minimise the menus list.


Saturday, 21 September 2013

Zooming Images using jQuery

Image zoom-in is very useful feature in an eCommerce website to show your product images to viewers in zoom with there ease. So in this tutorial i am going to show you how to make a very simple zoom in image program in which I have used a jQuery plugin


Friday, 20 September 2013

How to Create Twitter App

To create Twitter application you need to Visit the Twitter Developers Site

The first thing you need to do is head on down to In order to create an account, all you need to do is click on the “Sign In” link at the top right.

Thursday, 19 September 2013

How To Add Tweeting With Short URL Functionality To A Website (With PHP)

There is a 140 character limit in Twitter & the length of the URL is a headache. So, auto-shortening the URL with a short URL service will be handy.

The file_get_contents function of PHP helps us to easily get the short URL as a string. Lets use the TinyURLservice & create a simple function:
function makeShortURL($URLToConvert) { 
     $shortURL= file_get_contents("" . $URLToConvert); 
     return $shortURL; 
calling the function with the URL, like:
<?php echo makeShortURL("")?>


Friday, 13 September 2013

Play Notification Sound using Jquery.

How to play a notification sound on website chat?. We implemented this in a simple chat box application using Jquery and HTML5 audio tag.


Thursday, 5 September 2013

Example will demonstrate how a web page can communicate with a web server using Ajax

The following example will demonstrate how a web page can communicate with a web server while a user type characters in an input field:
When a user types a character in the input field above, the function "showHint()" is executed. The function is triggered by the "onkeyup" event:
function showHint(str)
if (str.length==0)
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

  if (xmlhttp.readyState==4 && xmlhttp.status==200)
<b>Start typing a name in the input field below:</b>
First name: <input onkeyup="showHint(this.value)" type="text" />
Suggestions: <span id="txtHint"></span>
The page on the server called by the JavaScript above is a PHP file called "gethint.php" The source code in "gethint.php" checks an array of names, and returns the corresponding name(s) to the browser:
// Fill up array with names
//get the q parameter from URL
//lookup all hints from array if length of q>0
if (strlen($q) > 0)
  for($i=0; $i<count($a); $i++)
    if (strtolower($q)==strtolower(substr($a[$i],0,strlen($q))))
      if ($hint=="")
        $hint=$hint." , ".$a[$i];
// Set output to "no suggestion" if no hint were found
// or to the correct values
if ($hint == "")
  $response="no suggestion";
//output the response
echo $response;

Thursday, 29 August 2013

How to install gnome3 on ubuntu

This article will help you to install gnome3 on ubuntu. people who are not interested in using unity can install gnome environment on their ubuntu machine.Gnome3 now comes with various new features


How to install curl on ubuntu

We only need to run following commands to install CURL for PHP on Ubuntu
srinu@ebiz:~$ sudo apt-get update

srinu@ebiz:~$ sudo apt-get install php5-curl

srinu@ebiz:~$ sudo service apache2 restart

Tuesday, 27 August 2013

Birthday Dropdown using html and js validation

Birthday Dropdown using html and js , validation for selected year is not leaf year the day will show only 28 days
 <script type="text/javascript">
  function call(){
 var kcyear = document.getElementsByName("year")[0],
  kcmonth = document.getElementsByName("month")[0],
  kcday = document.getElementsByName("day")[0];
 var d = new Date();
 var n = d.getFullYear();
 for (var i = n; i >= 1950; i--) {
  var opt = new Option();
  opt.value = opt.text = i;
 kcyear.addEventListener("change", validate_date);
 kcmonth.addEventListener("change", validate_date);

 function validate_date() {
 var y = +kcyear.value, m = kcmonth.value, d = kcday.value;
 if (m === "2")
     var mlength = 28 + (!(y & 3) && ((y % 100) !== 0 || !(y & 15)));
 else var mlength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][m - 1];
 kcday.length = 0;
 for (var i = 1; i <= mlength; i++) {
     var opt = new Option();
     opt.value = opt.text = i;
     if (i == d) opt.selected = true;
        <div class="register-form-row">
      <div class="register-form-row-col">Date Of Birth :</div>
      <div class="register-form-row-col">Month :<select name="month" onchange="call()" >
         <option value="">select</option>
         <option value="1">Jan</option>
         <option value="2">Feb</option>
         <option value="3">Mar</option>
         <option value="4">Apr</option>
         <option value="5">May</option>
         <option value="6">Jun</option>
         <option value="7">Jul</option>
         <option value="8">Aug</option>
         <option value="9">Sep</option>
         <option value="10">Oct</option>
         <option value="11">Nov</option>
         <option value="12">Dec</option>
        Day :<select name="day" >
           <option value="">select</option>
        Year:<select name="year" onchange="call()">
           <option value="">select</option>
Date Of Birth :
Month : Day : Year:

Wednesday, 21 August 2013

Get the value from a select box and display their value.Using jQuery

Display select box selected value using jQuery......
<html lang="en">
   <script src=""></script>
 <select id="kc">
   <option>srinu chilukuri</option>
   function displayVals() {
   var singleValues = $("#kc").val();
   $("p").html("<b>value:</b> " +
   singleValues );

Tuesday, 20 August 2013

Facebook Slide Out Like Box Widget For Blog Or Website

Stylish facebook like box widget is design and it will slide out smooth when you place your cursor on the widget banner due to the jQuery effect.
For you to add this great widget to your blog, simply follow the few steps below.


Monday, 19 August 2013

How to Install nginx webserver in ubuntu

Nginx (pronounced engine-x) is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server.with Nginx now hosts nearly 12.18% (22.2M) of active sites across all domains. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption. it serves static content 50 times faster than Apache. nginx is a perfect load balancer can able to handle more than 7000 live request per second.


Input field accept only numeric valus (Trying to paste Text Content Not Accept)

This post will show you how to restrict keyboard inputs so that only numbers can only be pressed for a specific HTML element to ensure that the number-only fields get valid values, and trying to paste other than numerics its not accept.


Saturday, 17 August 2013

Google API – Get contact list

Google API – Get contact list I am going to tell you about inviting friends. I think that this is the most important part for every website, a key to success. Today I will show you how to create simple and effective Gmail contact importer using OAuth authorization and API. Also, I will tell about obtaining Google API access too.

As the first step – lets prepare our own project in Google API console, please open this link  and create your project. Then we need goto ‘API Access’ section and click ‘Create an OAuth 2.0 client ID’ button. Now we should fill a name for our new project:

Click next button, and, at the second step we should set URL of our destination page:

Finally, we’ve got our Client ID and secret (or – consumer key and secret):

Now – download the source files from Here  and lets start coding

  if (version_compare(phpversion(), "5.3.0", ">=")  == 1)
    error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
    error_reporting(E_ALL & ~E_NOTICE); 

 $sClientId = 'Your Google Client Id';
 $sClientSecret = 'Your Client Secret ';
 $sCallback = 'http://localhost/srinu/googleapi/index.php'; // change it to your call back url!
 $iMaxResults = 90; // max results
 $sStep = 'auth'; // current step



 // prepare new instances of GmailOath  and GmailGetContacts
 $oAuth = new GmailOath($sClientId, $sClientSecret, $argarray, false, $sCallback);
 $oGetContacts = new GmailGetContacts();

if ($_GET && $_GET['oauth_token']) {

    $sStep = 'fetch_contacts'; // fetch contacts step

    // decode request token and secret
    $sDecodedToken = $oAuth->rfc3986_decode($_GET['oauth_token']);
    $sDecodedTokenSecret = $oAuth->rfc3986_decode($_SESSION['oauth_token_secret']);

    // get 'oauth_verifier'
    $oAuthVerifier = $oAuth->rfc3986_decode($_GET['oauth_verifier']);

    // prepare access token, decode it, and obtain contact list
    $oAccessToken = $oGetContacts->get_access_token($oAuth, $sDecodedToken, $sDecodedTokenSecret, $oAuthVerifier, false, true, true);
    $sAccessToken = $oAuth->rfc3986_decode($oAccessToken['oauth_token']);
    $sAccessTokenSecret = $oAuth->rfc3986_decode($oAccessToken['oauth_token_secret']);
    $aContacts = $oGetContacts->GetContacts($oAuth, $sAccessToken, $sAccessTokenSecret, false, true, $iMaxResults);

    // turn array with contacts into html string
    $sContacts = $sContactName = '';
    foreach($aContacts as $k => $aInfo) {
        $sContactName = end($aInfo['title']);
        $aLast = end($aContacts[$k]);
        foreach($aLast as $aEmail) {
            $sContacts .= '<p>' . $sContactName . '(' . $aEmail['address'] . ')</p>';
  } else {
    // prepare access token and set it into session
    $oRequestToken = $oGetContacts->get_request_token($oAuth, false, true, true);
    $_SESSION['oauth_token'] = $oRequestToken['oauth_token'];
    $_SESSION['oauth_token_secret'] = $oRequestToken['oauth_token_secret'];

<!DOCTYPE html>
<html lang="en" >
        <meta charset="utf-8" />
        <title>Google API - Get contact list | Sri info</title>
       <h1> Get Contect List using Google api<h1>

    <?php if ($sStep == 'auth'): ?>
        <h3>Step 1. OAuth</h3>
        <h4>Please click <a href="<?php echo $oAuth->rfc3986_decode($oRequestToken['oauth_token']) ?>">this link</a> in order to get access token to receive contacts</h4>
    <?php elseif ($sStep == 'fetch_contacts'): ?>
        <h2>Step 2. Results</h2>
        <?= $sContacts ?>
    <?php endif ?>

When we click authorization button, it will open google authorization page, where we should grant access for our application to get our contact list:

JQuery Slider

Drag a handle to select a numeric value.
The basic slider is horizontal and has a single handle that can be moved with the mouse or by using the arrow keys

<html lang="en">
  <meta charset="utf-8" />
  <link rel="stylesheet" href="" />
   <script src=""></script>
   <script src=""></script>
 $(function() {
 $( "#slider-range-max" ).slider({
 range: "max",
 min: 1,
 max: 100,
 value: 1,
 slide: function( event, ui ) {
 $( "#amount" ).val( ui.value );
 $( "#amount" ).val( $( "#slider-range-max" ).slider( "value" ) );
    <form name="qnty" action="" method="post">
 <label for="amount">Quantity:</label>
 <input type="text" id="amount" readonly style="border: 0; color: #38761d; font-weight: bold;" name="qnty"/>
 <div id="slider-range-max" style="cursor:pointer"></div>
 <input type="submit" value="submit">

Friday, 16 August 2013

Extend phpMyAdmin time out

1)Go find phpmyadmin's
$ sudo gedit /etc/phpmyadmin/
2)Add these lines to the bottom of the file
$cfg['LoginCookieValidity'] = 60*60*24;
ini_set('session.gc_maxlifetime', $cfg['LoginCookieValidity']); 
3)Restart Apache
$ sudo service apache2 restart
If with above trick, still doesn't work, try to edit /etc/phpmyadmin/ file, then search for
$cfg['Servers'][$i]['auth_type'] = 'cookie'
then edit / add the following
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'your_mysql_username';
$cfg['Servers'][$i]['password'] = 'your_mysql_password';

10 Simple Ways To Improve SEO Rankings

Thursday, 15 August 2013

Connecting Microsoft SQL Server with PHP on Ubuntu

Here is how to get PHP 5.3 on Linux (specifically Ubuntu) talking to a Microsoft SQL Server database:

  1) Install FreeTDS and the PHP MS SQL extension

sudo apt-get install freetds-common freetds-bin unixodbc php5-sybase

  2) Restart Apache

sudo /etc/init.d/apache2 restart

  3) Configure FreeTDS

  Add this at the end of the file:
host =
port = 1433
tds version = 8.0
Test connection to the MSSQL server with this PHP script
 $server = 'your server name';
 $username = 'enter';
 $password = 'enter';
 $database = 'enter';
 $connection = mssql_connect($server, $username, $password);
 if($connection != FALSE)
  echo "Connected to the database server OK<br />";
  die("Couldn't connect");
 if(mssql_select_db($database, $connection))
  echo "Selected $database ok<br />";
  die('Failed to select DB');

 $query_result = mssql_query('SELECT @@VERSION');
 $row = mssql_fetch_array($query_result);
  if($row != FALSE)
  echo "Version is {$row[0]}<br />";


How to send SMS using PHP

How can I send SMS using PHP?
Actually this is easy process but for this you have to purchase an API to send SMS. But I have found a solution to show your project temporarily. I have an API that provides a free trial and allows to send 5 free SMS that is sufficient to show the project.

To integrate this you have to follow the following steps :

  1) Go to site, on this site click on free trial as follow :

2) You will get a simple form, fill that form and after submission you will get a mail which will contain username and password.
   3) Now download the sms api from Here

   4) Place this file into your project folder

   5)  Now put the following code in the file and send SMS :
   <form method=post action='srisms.php'>
   <table border=0>
      <td>Recipient no:</td>
      <td><input type='text' name='recipient'></td>
      <td><textarea rows=4 cols=40 name='message' maxlength="140"></textarea></td>
      <td> </td>
      <td><input type=submit name=submit value=Send></td>

Wednesday, 14 August 2013

How to Get the Current Page URL

function curPageURL() {
 $pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
 } else {
 return $pageURL;
  echo curPageURL();

How to check if the request came from mobile or computer using php

 Include Mobile_Detect.php file  Download from Here
require_once ('Mobile_Detect.php');
$detect = new Mobile_Detect;
$deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');
$scriptVersion = $detect->getScriptVersion();

<!DOCTYPE html>
<html xmlns="" lang="en" xml:lang="en">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,    minimum-scale=1.0, user-scalable=no">
    <p>This is a <b><?php echo $deviceType; ?></b></p>