This file contains hidden or 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 | |
/* Source: http://www.apphp.com/index.php?snippet=php-get-remote-ip-address */ | |
function GeneratePassword($length=8, $strength=0){ | |
$vowels = 'aeuy'; | |
$consonants = 'bdghjmnpqrstvz'; | |
if($strength >= 1) $consonants .= 'BDGHJLMNPQRSTVWXZ'; | |
if($strength >= 2) $vowels .= 'AEUY'; | |
if($strength >= 3) $consonants .= '12345'; | |
if($strength >= 4) $consonants .= '67890'; | |
if($strength >= 5) $vowels .= '@#$%'; |
This file contains hidden or 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 | |
/* Source: http://www.apphp.com/index.php?snippet=php-get-remote-ip-address */ | |
// pathinfo() constants parameter list | |
// PATHINFO_DIRNAME => directory name | |
// PATHINFO_BASENAME => name of file (w/out extension) | |
// PATHINFO_EXTENSION => file extension | |
// PATHINFO_FILENAME => file name w/ extension | |
$path = '/images/thumbs/my_avatar.gif'; | |
This file contains hidden or 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 | |
/* Source: http://www.apphp.com/index.php?snippet=php-get-remote-ip-address */ | |
function convertSecToStr($secs){ | |
$output = ''; | |
if($secs >= 86400) { | |
$days = floor($secs/86400); | |
$secs = $secs%86400; | |
$output = $days.' day'; | |
if($days != 1) $output .= 's'; | |
if($secs > 0) $output .= ', '; |
This file contains hidden or 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
<form> | |
/* Source: http://www.apphp.com/index.php?snippet=php-get-remote-ip-address */ | |
<input type="button" value="Previous Page" onclick="history.go(-1)"> | |
</form> |
This file contains hidden or 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
<script language="javascript"> | |
/* Source: http://www.apphp.com/index.php?snippet=php-get-remote-ip-address */ | |
function CopyText(el){ | |
var selectedText = ""; | |
if(window.getSelection){ | |
selectedText = window.getSelection(); | |
}else if (document.getSelection){ |
This file contains hidden or 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
<script type="text/javascript"> | |
/* Source: http://www.apphp.com/index.php?snippet=php-get-remote-ip-address */ | |
var count = 6; | |
var redirect = "http://www.apphp.com"; | |
function countDown(){ | |
var timer = document.getElementById("timer"); | |
if(count > 0){ | |
count--; | |
timer.innerHTML = "This page will redirect in "+count+" seconds."; | |
setTimeout("countDown()", 1000); |
This file contains hidden or 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
<script type="text/javascript"> | |
/* Source: http://www.apphp.com/index.php?snippet=php-get-remote-ip-address */ | |
function CreateBookmarkLink(){ | |
var title = document.title; | |
var url = document.location.href; | |
if(window.sidebar){ | |
/* Mozilla Firefox Bookmark */ | |
window.sidebar.addPanel(title, url, ""); | |
}else if(window.external){ | |
/* IE Favorite */ |
This file contains hidden or 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
<style type="text/css"> | |
/* Source: http://www.apphp.com/index.php?snippet=php-get-remote-ip-address */ | |
.round{ | |
border:1px solid #c1c13a; | |
-moz-border-radius: 10px; | |
-webkit-border-radius: 10px; | |
border-radius: 10px; /* future proofing */ | |
-khtml-border-radius: 10px; /* for old Konqueror browsers */ | |
} | |
</style> |
This file contains hidden or 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
<style type="text/css"> | |
/* Source: http://www.apphp.com/index.php?snippet=php-get-remote-ip-address */ | |
p.first { margin-top: 0 !important; margin-left: 0 !important; } | |
p.last { margin-bottom: 0 !important; margin-right: 0 !important; } | |
/* or */ | |
div#articles p:first-child { border:1px solid #c1c13a; } | |
div#articles p:last-child { border:1px solid #3ac13a; } | |
/* or */ | |
div#articles > :first-child { text-align:left; } |
This file contains hidden or 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 | |
/* Source: http://www.apphp.com/index.php?snippet=php-get-file-extension */ | |
function get_file_extension($file_name) | |
{ | |
/* may contain multiple dots */ | |
$string_parts = explode('.', $file_name); | |
$extension = $string_parts[count($string_parts) - 1]; | |
$extension = strtolower($extension); | |
return $extension; | |
} |