Archive for Tháng Chín, 2008
<? $info=getimagesize("image.jpg"); echo "Image width: ".$info[0]."<br />"; echo "Image height: ".$info[1]."<br />"; echo "Image type: ".$info[mime]."<br />"; echo "Image size: ".$info[bits]."<br />"; ?> loadt2player(97)[ READ MORE ]
Thấy cái này hay hay. He! <? $filename = "image.jpg"; $image = file_get_contents($filename); $image = imagecreatefromstring($image); $width = imagesx($image); $height = imagesy($image); $m_aspect = 164.0 / 48.0; $i_aspect = $width / $height; if($i_aspect < $m_aspect) { $percent = 48.0 / $height; $new_height = $height * $percent; $new_width = 11.875 * $new_height / 6.0 * $width / $height; } else { $percent = 164.0 / $width; $new_width = $width * $percent; $new_height = 6.0 * [ READ MORE ]
http://javascript.internet.com/forms/clipboard-copy.html loadt2player(93)[ READ MORE ]
[sourecocode language="html"] <script language=”JavaScript”> function checkAll(theForm, cName, status) { for (i=0,n=theForm.elements.length;i<n;i++) if (theForm.elements[i].className.indexOf(cName) !=-1) { theForm.elements[i].checked = status; } } </script> <form id=”selectForm”> Set 1: <br> <input type=”checkbox” name=”selected” value=”01″ class=”results1″><br> <input type=”checkbox” name=”selected” value=”02″ class=”results1″><br> Select All/None <input type=”checkbox” onclick=”checkAll(document.getElementById(’selectForm’), ‘results1′, this.checked);” /> <br> <br> Set 2: <br> <input type=”checkbox” name=”selected” value=”01″ class=”results2″><br> <input type=”checkbox” name=”selected” value=”02″ class=”results2″><br> Select All/None <input type=”checkbox” onclick=”checkAll(document.getElementById(’selectForm’), ‘results2′, this.checked);” /> </form> [/sourcecode] loadt2player(91)[ READ MORE ]
What does getID3() do? Reads & parses (to varying degrees): ¤ tags: * APE (v1 and v2) * ID3v1 (& ID3v1.1) * ID3v2 (v2.4, v2.3, v2.2) * Lyrics3 (v1 & v2) ¤ audio-lossy: * MP3/MP2/MP1 * MPC / Musepack * Ogg (Vorbis, OggFLAC, Speex) * RealAudio * Speex * VQF ¤ audio-lossless: * AIFF * AU * Bonk * CD-audio (*.cda) * FLAC * LA (Lossless Audio) * LPAC * MIDI * Monkey’s Audio * OptimFROG * RKAU * VOC * WAV [ READ MORE ]
function countSentences($str){ return preg_match_all('/[^\s](\.|\!|\?)(?!\w)/',$str,$match); } countSentences("This is a test. Hey!"); // returns 2 countSentences("What do you want?"); // returns 1 // etc. loadt2player(87)[ READ MORE ]
//YouTube Video Download Link Generator function str_between($string, $start, $end){ $string = " ".$string; $ini = strpos($string,$start); if ($ini == 0) return ""; $ini += strlen($start); $len = strpos($string,$end,$ini) - $ini; return substr($string,$ini,$len); } function get_youtube_download_link(){ $youtube_link = $_GET['youtube']; $youtube_page = file_get_contents($youtube_link); $v_id = str_between($youtube_page, "&video_id=", "&"); $t_id = str_between($youtube_page, "&t=", "&"); $flv_link = "http://www.youtube.com/get_video?video_id=$v_id&t=$t_id"; $hq_flv_link = "http://www.youtube.com/get_video?video_id=$v_id&t=$t_id&fmt=6"; $mp4_link = "http://www.youtube.com/get_video?video_id=$v_id&t=$t_id&fmt=18"; $threegp_link = "http://www.youtube.com/get_video?video_id=$v_id&t=$t_id&fmt=17"; echo "\t\tDownload (right-click [ READ MORE ]
backup_tables('localhost','username','password','blog'); /* backup the db OR just a table */ function backup_tables($host,$user,$pass,$name,$tables = '*') { $link = mysql_connect($host,$user,$pass); mysql_select_db($name,$link); //get all of the tables if($tables == '*') { $tables = array(); $result = mysql_query('SHOW TABLES'); while($row = mysql_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',',$tables); } //cycle through foreach($tables as $table) { $result = mysql_query('SELECT * FROM '.$table); $num_fields = mysql_num_fields($result); for ($i = 0; $i < $num_fields; $i++) { $return.= 'DROP TABLE '.$table.';'; $row2 [ READ MORE ]
function is_email_valid($email) { return (preg_match("/[-a-zA-Z0-9_.+]+@[a-zA-Z0-9-]{2,}\.[a-zA-Z]{2,}/", $email) > 0) ? true : false; } loadt2player(81)[ READ MORE ]
<?php if (isset($_GET['source'])) highlight_file(basename($_SERVER['PHP_SELF'])) and exit; ?> loadt2player(79)[ READ MORE ]
Bad Behavior has blocked 48 access attempts in the last 7 days.