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 ini_set("upload_max_filesize","10M"); ini_set("post_max_size","10M"); ini_set("max_execution_time","10M"); ini_set("max_input_time","10M"); $dateposted =date("Y-m-d"); if(isset($_REQUEST['submit'])) { extract($_REQUEST); $c1 = rand(0,9);$c2 = rand(0,9);$c3 = rand(0,9);$c4 = rand(0,9); $rand = $c1.$c2.$c3.$c4; $dir_path = "booksummaries/".$rand.$_FILES['pdf']['name']; $c1 = rand(0,9);$c2 = rand(0,9);$c3 = rand(0,9);$c4 = rand(0,9); $rand = $c1.$c2.$c3.$c4; $dir_path1 = "booksummaries/".$rand.$_FILES['image']['name']; if($_FILES['pdf']['name'] && $_FILES['image']['name']){ move_uploaded_file($_FILES['pdf']['tmp_name'],$dir_path); move_uploaded_file($_FILES['image']['tmp_name'],$dir_path1); $in="UPDATE ".BOOKSS...

Image effects php code

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

Image conversion from one to another PHP

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

PHP image color effects

imagefilter (PHP 5) imagefilter -- Applies a filter to an image Description bool imagefilter ( resource src_im, int filtertype [, int arg1 [, int arg2 [, int arg3]]] ) imagefilter() applies the filter filtertype to the image, using arg1, arg2 and arg3 where necessary. filtertype can be one of the following: * IMG_FILTER_NEGATE: Reverses all colors of the image. * IMG_FILTER_GRAYSCALE: Converts the image into grayscale. * IMG_FILTER_BRIGHTNESS: Changes the brightness of the image. Use arg1 to set the level of brightness. * IMG_FILTER_CONTRAST: Changes the contrast of the image. Use arg1 to set the level of contrast. * IMG_FILTER_COLORIZE: Like IMG_FILTER_GRAYSCALE, except you can specify the color. Use arg1, arg2 and arg3 in the form of red, blue, green. The range for each color is 0 to 255. * IMG_FILTER_EDGEDETECT: Uses edge detection to highlight the edges in the image. * I...

Dynamic Listbox selection

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

Find the difference between start date and end date in php using mktime and explode functions

Image
Find the difference between start date and end date in php using mktime and explode functions   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);   $hou...

POPULAR POSTS ::

Add multiple upload box

String Separation

The top Web development PHP frameworks

Only number restrictions

HTML Document structure and it's Syntax format

Add and Separate more records by comma operator

Addslashes