Friday, September 16, 2011

Php cUrl Example


Send sms without page refresh, the help of cUrl.
Instigate sms Api Easley .
sms API makes it easy for developers to send  SMS messages from any website. 
Code 
<?php
$urltopost="http://txtji.com/sms_api_send";
$datatopost = array (
    "akey" => "XNLp9tQlbc5W5yK6YdLxFh84VpnWaTo7jmgVlyLe-u6nwsFwPqAhrpXbZ-I8SKOKm83fGOq13Hq0BnXe1jw2VQ",
    "message" => "JAFAR ",
    "recipient" => "9451293997"
    );
$ch = curl_init ($urltopost);
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $datatopost);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$returndata = curl_exec ($ch);
curl_close($ch);
echo $returndata;

?>

Title Bar Scrolling Marquee


Title Bar Scrolling Marquee
Use the Title Bar Marquee/Scroller generator at the top of the page to automatically generate a scrolling title bar for your page.

<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
        <title>Static Title</title>
        <script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
        <script src="jquery.marqueetitle.js"></script>
        <script language="JavaScript" type="text/javascript">
            $(document).ready(function() {
                $(document).marqueeTitle({
                    'message'     : ' Example Marquee Text (Jafar Khan 9451293997)',
                    'time'      : 400
                });
            });
        </script>
    </head>
<body>
</body></html>

See Demo Now Click Here





Saturday, August 13, 2011

How to validate url in java script

How to validate url in java script
url validation in java scrip

How to validate url in java script

This function can be used for validating url 
function isURL(s) {
 	var regexp = /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/;
 	return regexp.test(s);
}
 
 
<html>
<head>
</head>
<script language="javascript">
function isURL(s) {
 	var regexp = /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/;
 	alert(regexp.test(s));
}
</script>
<body>
	<form>
    	<input type="text" name="url" size="20" id="url"/>
        <input type="button" value="Validate" 
 onClick="javascript:isURL(document.getElementById('url').value);"/>
    </form>
</body>
</html>
 

Monday, August 8, 2011

How to create dive corner without image

How to create  dive corner without image 
Here you make comer without image with the help of jQuery.  
Code Here :
 <!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=utf-8" />
<title>Untitled Document</title>
<script language="JavaScript" src="jquery-1.6.js"></script>
<script language="JavaScript" src="jquery.corner.js"></script>
<script language="javascript">
$('#divID').corner("10px");
</script>
</head>

<body>

<div id="divID" style="width:300px; height:200px; background-color:#090;" >
&nbsp;test round couner
</div>
</body>
</html>
Example 

 

Wednesday, August 3, 2011

How to export mysql data to excel file


I've been able to export any data from MySQL to a csv file.

Export mysql data to excel in php 

Code here :

<?php
$topRow="<table border='1'>";
$bottomRow="</table>";
$columns="<tr><th>Name</th><th>Age</th><th>Phone/Mobile Number</th>";
$columns.="</tr>";
$data="";
$i==1;
///////////////////////////
/// you can also connect database. you fetch data and pass paramete on td tag fields.
/////////////////////
while($i<10){
$nName="<tr><td>".str_replace('"', '""',"Jafar Khan")."</td>";
$age="<td>".str_replace('"', '""',"24")."</td>";
$phoneMobileNumber="<td>".str_replace('"', '""',"9451293997")."</td>";
$line=$nName.$age.$phoneMobileNumber;
 $data.=$line;
$i++ ;}
$data = str_replace("\r", "", ($topRow.$columns.$data.$bottomRow));
function exportToExcelUtil($filename,$data) {
        header("Content-type: application/octet-stream");
        header("Content-Disposition: attachment; filename=$filename");
        header("Pragma: no-cache");
        header("Expires: 0");
        echo  $data;
    }
exportToExcelUtil("test.xls",$data);
?>

Tuesday, August 2, 2011

How to Encrypt URL


Here you can Encrypt URL with the help of  urlencode($string) and  urldecode( $string)
Is there a way I can encrypt a page URL and hide the data source url?
There are times when you need to to hide the real path, web address or URL to a file that you  sell for profit – ebooks, mp3′s, software  etc (digital products) – We have a simple solution for you to hide the Real File URL and Provide Download via a PHP Script.

Function :
function encriptURL($cabecera,$mensaje) {
        $cabecera=urlencode($cabecera);
        $mensaje=urlencode($mensaje);
        header("Location:".siteName."?string1=$string2&mensaje=$mensaje");
        exit;
     }