Install Diffuse in Ubuntu open Terminal Type Command:
sudo apt-get install diffuse
diffuse file1 file2
Eg:diffuse source.php sourcedemo.php
diffuse will be display like:
sudo apt-get install diffuse
$_SERVER['HTTP_X_REQUESTED_WITH']
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
{
From Ajax
}else{
Not Ajax
}
# mysqldump -u [username] –p[password] [database_name] > [dump_file.sql]The parameters of the said command as follows.
<script >
function are_cookies_enabled()
{
var cookieEnabled = (navigator.cookieEnabled) ? true : false;
if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled)
{
document.cookie="testcookie";
cookieEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false;
}
return (cookieEnabled);
}
var result= are_cookies_enabled();
alert(result);
</script>
unlink('foldername/'.$imagename);
<?php
if(file_exists('imagesfolder/'.$image_name)){
unlink('imagesfolder/'.$image_name);
}
?>
<?php
function getAllDatesBetweenTwoDates($strDateFrom,$strDateTo)
{
$aryRange=array();
$iDateFrom=mktime(1,0,0,substr($strDateFrom,5,2), substr($strDateFrom,8,2),substr($strDateFrom,0,4));
$iDateTo=mktime(1,0,0,substr($strDateTo,5,2), substr($strDateTo,8,2),substr($strDateTo,0,4));
if ($iDateTo>=$iDateFrom)
{
array_push($aryRange,date('Y-m-d',$iDateFrom)); // first entry
while ($iDateFrom<$iDateTo)
{
$iDateFrom+=86400; // add 24 hours
array_push($aryRange,date('Y-m-d',$iDateFrom));
}
}
return $aryRange;
}
$fromDate = '2014-07-24';
$toDate = '2014-07-31';
$dateArray = getAllDatesBetweenTwoDates($fromDate, $toDate);
print_r($dateArray);
?>
Output will be :
<?php
//The following code returns the Number of likes for any facebook page.
//Page Id of Knowledgecotner Replace it with your page.
$page_id = "556271807742934";
$likes = 0; //Initialize the count
//Construct a Facebook URL
$json_url ='https://graph.facebook.com/'.$page_id.'';
$json = file_get_contents($json_url);
$json_output = json_decode($json);
//Extract the likes count from the JSON object
if($json_output->likes){
$likes = $json_output->likes;
}
//Printing the count
echo $likes.' Facebook Fans';
?>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
FB.init({
appId : 'your AppId',
status : true,
cookie : true,
xfbml : true
});
FB.login(function (response) {
getFBuserData ();
});
function getFBuserData () {
FB.api('/me', function(data){
var userdetails = data.first_name+ data.last_name + data.id+data.gender+data.link+data.birthday+data.email;
alert(userdetails);
})
}
</script>
<?php
header('Content-Type: image/jpeg');
$backgroundimage = imagecreatefromjpeg('tshirt.jpg');
$overlayimage= imagecreatefrompng('Buy-Now.png');
imagecopy($backgroundimage, $overlayimage, 100, 200, 0, 0, 130, 40);
imagejpeg($backgroundimage, null, 100);
?>
Before merge Images:
![]() |
apt-get install package-name
apt-get install phpmyadminNOTE: if you get permission denied error, then use sudo with this command. To install any package or software in Ubuntu you need root access.
sudo apt-get install phpmyadminonce you type and enter, it ask password for root user
<?php phpinfo();?>Visit it in your browser, you’ll see a table which lists out all the config about current php environment. Search for “memory_limit”, you’ll see:
<?php
$imageurl ='http://sri-knowledgecorner.rhcloud.com/images/blogicon.jpeg';
$image=file_get_contents($imageurl);
$imagename = basename($imageurl);//image name
define('DIRECTORY', 'images/'); //save image in images folder
file_put_contents(DIRECTORY.$imagenam, $image);
?>
<?php
$name = 'srinu chilukuri';
$member = 'This is $name';
echo $member;
?>
If echo $member variable it will print the result as it is without interpreted.
<?php
$name = 'srinu chilukuri';
$member = "This is $name";
echo $member;
?>
output: This is srinu chilukuri