Posts

Showing posts from August, 2011

Access key

< input title="Save [Alt+S]" accesskey="S" class="crmbutton small save" name="submit" id="submit" value="Submit" style="width: 70px;" type="submit" >

Image Upload php

//upload file size <br />ini_set("upload_max_filesize","10M"); <br />ini_set("post_max_size","10M"); <br />ini_set("max_execution_time","10M"); <br />ini_set("max_input_time","10M"); <br />$dateposted =date("Y-m-d"); <br /> <br /> <br /> <br />if(isset($_REQUEST['submit'])) <br />{ <br />extract($_REQUEST); <br /> <br />$c1 = rand(0,9);$c2 = rand(0,9);$c3 = rand(0,9);$c4 = rand(0,9); <br />$rand = $c1.$c2.$c3.$c4; <br />$dir_path = "booksummaries/".$rand.$_FILES['pdf']['name']; <br /> <br />$c1 = rand(0,9);$c2 = rand(0,9);$c3 = rand(0,9);$c4 = rand(0,9); <br />$rand = $c1.$c2.$c3.$c4; <br />$dir_path1 = "booksummaries/".$rand.$_FILES['image']['name']; <br /> <br /> <br />if($_FILES['pdf']['name

Image effects php code

<?php session_start(); <br /> <br /> <br /> <br /> $filename= $dir_path; <br />$path_info = pathinfo($filename); <br />$banner_imagex= $path_info['extension']; <br /> <br />if($chkbox1 =='1'){ <br /> <br />copy($dir_path,'album/gray/'.$file); <br />$filename='album/gray/'.$file; <br /> <br />if($banner_imagex=='png'){ <br /> $im = imagecreatefrompng($filename); <br /> <br /> if($im && imagefilter($im, IMG_FILTER_GRAYSCALE)) <br /> { <br /> <br /> imagepng($im, $filename); <br /> }else <br /> { echo 'Conversion to grayscale failed.'; } <br /> <br /> imagedestroy($im); <br /> <br /> $effect_path=$filename; <br /> } <br />if($banner_imagex=='jpg'){ <br /> <br /> $im = imagecre

Image conversion from one to another PHP

<?php session_start(); <br /> <br /> <br /> <br /> $filename= $dir_path; <br />$path_info = pathinfo($filename); <br />$banner_imagex= $path_info['extension']; <br /> <br />if($chkbox1 =='1'){ <br /> <br />copy($dir_path,'album/gray/'.$file); <br />$filename='album/gray/'.$file; <br /> <br />if($banner_imagex=='png'){ <br /> $im = imagecreatefrompng($filename); <br /> <br /> if($im && imagefilter($im, IMG_FILTER_GRAYSCALE)) <br /> { <br /> <br /> imagepng($im, $filename); <br /> }else <br /> { echo 'Conversion to grayscale failed.'; } <br /> <br /> imagedestroy($im); <br /> <br /> $effect_path=$filename; <br /> } <br />if($banner_imagex=='jpg'){ <br /> <br /> $im = imagecre

PHP image color effects

imagefilter <br /> <br />(PHP 5) <br />imagefilter -- Applies a filter to an image <br />Description <br />bool imagefilter ( resource src_im, int filtertype [, int arg1 [, int arg2 [, int arg3]]] ) <br /> <br />imagefilter() applies the filter filtertype to the image, using arg1, arg2 and arg3 where necessary. <br /> <br />filtertype can be one of the following: <br /> <br /> * <br /> <br /> IMG_FILTER_NEGATE: Reverses all colors of the image. <br /> * <br /> <br /> IMG_FILTER_GRAYSCALE: Converts the image into grayscale. <br /> * <br /> <br /> IMG_FILTER_BRIGHTNESS: Changes the brightness of the image. Use arg1 to set the level of brightness. <br /> * <br /> <br /> IMG_FILTER_CONTRAST: Changes the contrast of the image. Use arg1 to set the level of contrast. <br /> * <br /> <br /> IMG_FILTER_COLO

Dynamic Listbox selection

function validate() <br />{ <br /> <br /> <br />for(var i=0;i< document.form.FirstList.length;i++) <br />{ <br />document.form.SecondList[i].selected=true; <br />} <br /> <br /> <br />for(var i=0;i< document.form.SecondList.length;i++) <br />{ <br />document.form.SecondList[i].selected=true; <br />} <br /> <br /> <br /> <br /> <br />var title2=document.form.title2.value; <br />if(title2=="") <br />{ <br />alert("Enter the Title");document.form.title2.focus();return false; <br />} <br /> <br />var description2=document.form.description2.value; <br />if(description2=="") <br />{ <br />alert("Enter the Description");document.form.description2.focus();return false; <br />} <br /> <br />var status2=document.form.status2.value; <br />if(status2==""

Date and Time difference function

/*/// Find the difference (MYSQL DATETIME/DATE Format)  function find_difference($start_date,$end_date){ list($date,$time) = explode(" ",$start_date); if($time == NULL){$time = '00:00:00';} $startdate = explode("-",$date); $starttime = explode(":",$time); list($date,$time) = explode(" ",$end_date); if($time == NULL){$time = '00:00:00';} $enddate = explode("-",$date); $endtime = explode(":",$time); //Get unix timestamp in seconds $secons_dif = mktime($endtime[0],$endtime[1],$endtime[2],$enddate[1],$enddate[2],$enddate[0]) - mktime($starttime[0],$starttime[1],$starttime[2],$startdate[1],$startdate[2],$startdate[0]); //We will return it in seconds, minutes, hours, days, weeks, months, years //put the word floor before () to round to the nearest whole number. $seconds = $secons_dif; $minutes = ($secons_dif/60); $hours = ($secons_dif/60/60); $days = ($secons_dif/60/60/24); $

POPULAR POSTS ::

Add multiple upload box

String Separation

Only number restrictions

Addslashes

Add and Separate more records by comma operator

The top Web development PHP frameworks

HTML Document structure and it's Syntax format