Archive

Archive for the ‘PhP’ Category

Sanitize MySQL Inputs

November 13th, 2009 No comments
Sanitize MySQL Inputs Prepare the data so that when it gets added to your SQL query it doesn’t break the server ( Defence SQL injection attack ). When a form has been submitted via GET or POST all data is stored in the ...

Increase PHP’s memory limit

August 16th, 2009 No comments
Increase PHP’s memory limit Three methods for increasing PHP memory limit on your server: in php.ini file memory_limit = 32M to your --------- in your default settings file ini_set('memory_limit', '32M'); --------- in your .htaccess file php_value memory_limit 32M
Categories: PhP, Tech Tags: , , , ,

Check if youtube video is still valid – YouTube API

August 6th, 2009 1 comment
Check if youtube video is still valid – YouTube API fast PHP function to check if youtube video is still valid: <?php function checkYoutubeId($id) { if (!$data = @file_get_contents("http://gdata.youtube.com/feeds/api/videos/".$id)) return false; if ($data == "Video not found") return false; return true; } function checkYoutube($vid) { if (strlen($vid) < 12) { return checkYoutubeId($vid); } $preg1 = '@www.youtube.com\/watch\?v=(.*?)$@'; if ( preg_match($preg1, $vid, ...

Factor Number in PHP

July 17th, 2009 No comments
Factor Number in PHP In number theory, integer factorization is the breaking down of a composite number into smaller divisors, which when multiplied together equal the original number. By the fundamental theorem of arithmetic, every positive integer number, greater than one has a unique ...

Modulo Operator in PHP

July 17th, 2009 No comments
Modulo Operator in PHP In computing, the modulo operation finds the remainder of mathematical division of one number by another. Given 2 numbers, a (dividend) and n (divisor), a modulo n is the remainder, on division of a by n. In php languages, the modulo ...

Remove HTML tags from POST and GET – PHP

April 6th, 2009 No comments
Remove HTML tags from POST and GET – PHP How to remove/Strip HTML tags from php $_POST variable: foreach ($_POST as $key => $value) { $_POST[$key] = addslashes(strip_tags($value)); } foreach ($_GET as $key => $value) { $_GET[$key] = addslashes(strip_tags($value)); } strip_tags - tries to return a string with all HTML and PHP tags stripped from a ...

My PHP – PhP.Net mirror

March 22nd, 2009 No comments
My PHP – PhP.Net mirror De multe ori poate ca am nevoie de ceva din manualul de php si nu-mi merge netul asa ca am facut o copie/mirror a site-ului php.net INitial am incercat sa folosesc rsync (pe windows) dar, nu a mers sa iau siteu'l ...

Mysql Query – Get Number of Rows in a Mysql Database Table

March 5th, 2009 No comments
Mysql Query – Get Number of Rows in a Mysql Database Table 1'st Solution, use Mysql COUNT(*) : $sql = "SELECT COUNT(*) FROM my_table"; $result = mysql_query($sql); $num = mysql_result($result, 0); echo $num; 2'nd solution: use TABLE_ROWS and TABLE_NAME from information_schema: $query = "select TABLE_ROWS from information_schema.tables where table_schema = 'my_data_base' AND TABLE_NAME = 'my_table' "; $result = mysql_query($query); $count ...

Dereferer – Hide the destination URL

March 4th, 2009 No comments
Dereferer – Hide the destination URL Free URL/Link Redirect - Hide the destination URL - You can hide the destination URL in many ways ... Try here => http://r.t2i.info/ Cine este curios verifica si o sa'si dea seama cam despre ce este vorba. In princpiu siteul respcetiv nu face ...

Video Downloader, UPDATE 2

March 2nd, 2009 No comments
Video Downloader, UPDATE 2 Ce mai este nou pe Video Downloader: Siteuri noi: CollegeHumor (NEW) Blastro (NEW) VideoMix.ro / video.rol.ro (NEW) PornHub (NEW) BlipTv (activat pentru ca nu era finalizat codul) Modificari in cod: returnarea de formate multiple in mod automat fara alegerea manuala. YouTube : FLV si MPEG Daylimotion: Default (MP4, FLV asu ...
GoCache - ByREV-Cache v1.0 - live served in : 0.476055 sec (gzip)