This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
/* This file is released under the GPL, any version you like | |
* | |
* PHP PSD reader class, v1.3 | |
* | |
* By Tim de Koning | |
* | |
* Kingsquare Information Services, 22 jan 2007 | |
* | |
* example use: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$email = "[email protected]"; | |
if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { | |
echo "Valid email address."; | |
} | |
else { | |
echo "Invalid email address."; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($handle = opendir('myFolder')) { | |
echo "Directory handle: $handle\n"; | |
echo "Files:\n"; | |
/* This is the correct way to loop over the directory. */ | |
while (false !== ($file = readdir($handle))) { | |
echo $file."<br />"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Check if file exist | |
if(file_exists("path-to-my-image/my-image.png")){ | |
print 'File exist'; | |
} else { | |
print 'File does not exist'; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * | |
FROM tbl_name | |
WHERE creation_time > DATE_SUB(NOW(),INTERVAL 1 HOUR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Add separator in time with Jquery</title> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script> | |
$(document).ready(function() { | |
$("#currentTime").keyup(function(){ | |
if ($(this).val().length == 2){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To get the facebook profile picture | |
http://graph.facebook.com/[user id]/picture | |
For changing the size use this link | |
http://graph.facebook.com/[user id]/picture?type=large --------------> for larger image | |
http://graph.facebook.com/[user id]/picture?type=smaller --------------> for smaller image | |
http://graph.facebook.com/[user id]/picture?type=square --------------> for square |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<meta charset=utf-8 /> | |
<title>Live Word and Character Counter using jQuery</title> | |
<style> | |
textarea{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Error Pages | |
# Here error page is redirecting to error.html. | |
errorDocument 400 http://www.youwebsite.com/404.html | |
errorDocument 401 http://www.youwebsite.com/error.html | |
errorDocument 403 http://www.youwebsite.com/error.html | |
errorDocument 500 http://www.youwebsite.com/error.html | |
# Disable directory Listing | |
# If you want to disable folder files listing, include following code. |