Jump to content

anand.arjunan

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by anand.arjunan

  1. Hi all what are the default gloal variables in php and which which order it can excute
  2. function createfromsource($in,$img){ if ($in == 2) $src = @imagecreatefromjpeg($img); elseif ($in == 1) $src = @imagecreatefromgif($img); elseif ($in == 3) $src = @imagecreatefrompng($img); else return false; return $src; } //===================================================================================== function create_thumbnail($orgfilename, $orgfilepath, $thumbpath, $height, $width) // for thumbnail main page { $image = $orgfilename; $oldimage = $orgfilepath.$image; $newimage = $thumbpath.$image; copy($oldimage,$newimage); $size = @getimagesize($newimage); $curr_w=$size[0]; $curr_h=$size[1]; if($curr_w == $curr_h){ $curr_w = $width; $curr_h = $height; } if($curr_h > $height || $curr_w > $width) $scaler = 0.99; else $scaler = 0; if($curr_h > $curr_w && $curr_h > $height){ while($curr_h > $height){ $curr_h = $curr_h*$scaler; $curr_w = $curr_w*$scaler; } } elseif($curr_w > $curr_h && $curr_w > $width){ while($curr_w > $width){ $curr_h = $curr_h*$scaler; $curr_w = $curr_w*$scaler; } } $curr_h = ceil($curr_h); $curr_w = ceil($curr_w); if($size[2] == 1) $outputtype = "GIF"; if($size[2] == 2) $outputtype = "JPG"; if($size[2] == 3) $outputtype = "PNG"; //if($cpy) @copy($newimage,$oldimage); $im = @imagecreatetruecolor($curr_w, $curr_h); //$im = @imagecreate($curr_w, $curr_h); if(!$im) return false; switch($outputtype){ case "JPG"; $src_img = $this->createfromsource($size[2],$newimage); //ImageCopyResized($im,$src_img,0,0,0,0,$curr_w,$curr_h,imagesx($src_img),imagesy($src_img)); imagecopyresampled($im,$src_img,0,0,0,0,$curr_w,$curr_h,imagesx($src_img),imagesy($src_img)); imagejpeg($im,$newimage,80); break; case "PNG"; $src_img = $this->createfromsource($size[2],$newimage); //ImageCopyResized($im,$src_img,0,0,0,0,$curr_w,$curr_h,imagesx($src_img),imagesy($src_img)); imagecopyresampled($im,$src_img,0,0,0,0,$curr_w,$curr_h,imagesx($src_img),imagesy($src_img)); imagepng($im,$newimage); break; case "GIF"; $src_img = $this->createfromsource($size[2],$newimage); //ImageCopyResized($im,$src_img,0,0,0,0,$curr_w,$curr_h,imagesx($src_img),imagesy($src_img)); imagecopyresampled($im,$src_img,0,0,0,0,$curr_w,$curr_h,imagesx($src_img),imagesy($src_img)); imagegif($im,$newimage); break; default; return false; } imagedestroy ($im); }call the funtion like this way :create_thumbnail($filename,$source_path, $destination_thumb_path, $thumb_height, $thumb_width);
  3. Hi all,I nees thumbnail image sample coding help me.
  4. hi Lulzim i am using move file upload function how to use the 5mb size of file and view the avi or wmv or mpeg files please help me
  5. Hi friends how to upload the video file and view this file
  6. Hi all i got a print_r($_FILES);output is Array ( [file_1] => Array ( [name] => [type] => [tmp_name] => [error] => 4 => 0 ) [file_0] => Array ( [name] => AT.jpg [type] => image/pjpeg [tmp_name] => /tmp/php5K8RLS [error] => 0 => 3481 ) ) here how to get "AT.jpg" separatelymy coding is <form name="exap" enctype="multipart/form-data" method = "post"> <!-- The file element -- NOTE: it has an ID --> <input id="my_file_element" type="file" name="file_1[]" > <input type="button" onClick="return frm_sub();" value="submit"></form>...............
  7. Ya it is working fine the image was uploaded the image name was change like this 3e4e9af94bc4e358c56f58f18e6c1cb9.jpg but the image was not visible in browser please check and run this code
  8. anand.arjunan

    image error

    Hi all i have upload the image and rename the image but the image not visible in ie or any other browserPlease help me it is urgentsee my coding<?php$path=$_SERVER['DOCUMENT_ROOT'];$pro='/upload/';$uploadDir = $path.$pro;if(isset($_POST['upload'])){$fileName = $_FILES['userfile']['name'];$tmpName = $_FILES['userfile']['tmp_name'];$fileSize = $_FILES['userfile']['size'];$fileType = $_FILES['userfile']['type'];$filePath = $uploadDir . $fileName;// get the file extension first$ext = substr(strrchr($fileName, "."), 1); // make the random file name$randName = md5(rand() * time());$imag=$randName.'.' . $ext;// and now we have the unique file name for the upload file$filePath = $uploadDir . $randName . '.' . $ext;$result = move_uploaded_file($tmpName, $filePath);}?><form method="post" enctype="multipart/form-data"><table width="71%" border="0" cellpadding="1" cellspacing="1" class="box" align="center" ><tr> <td width="47%"><input type="hidden" name="MAX_FILE_SIZE" value="2000000"><input name="userfile" type="file" id="userfile"> </td><td width="53%"><input name="upload" type="submit" class="box" id="upload" value=" Upload "></td></tr></table></form>
  9. Hi CStrauss it is working fine but the uploaded image not shown in the ie or any other browser or photoshop any where please check it that code and view the image
  10. Hi all i Have upload the image and rename the image but the image not shown what is the error please help meSee my coding<?php $path=$_SERVER['DOCUMENT_ROOT']; $pro='/upload/'; $uploadDir = $path.$pro;if(isset($_POST['upload'])){$fileName = $_FILES['userfile']['name'];$tmpName = $_FILES['userfile']['tmp_name'];$fileSize = $_FILES['userfile']['size'];$fileType = $_FILES['userfile']['type'];$filePath = $uploadDir . $fileName;// get the file extension first$ext = substr(strrchr($fileName, "."), 1); // make the random file name $randName = md5(rand() * time()); $imag=$randName.'.' . $ext;// and now we have the unique file name for the upload file$filePath = $uploadDir . $randName . '.' . $ext;$result = move_uploaded_file($tmpName, $filePath);}?><form method="post" enctype="multipart/form-data"><table width="71%" border="0" cellpadding="1" cellspacing="1" class="box" align="center" ><tr> <td width="47%"><input type="hidden" name="MAX_FILE_SIZE" value="2000000"><input name="userfile" type="file" id="userfile"> </td><td width="53%"><input name="upload" type="submit" class="box" id="upload" value=" Upload "></td></tr></table></form>
  11. Hi all Hw to uploaded file name changed and the temp name is stored in databaseany example please
  12. Hi all i have error on mkdir and chmodsee my coding what s error i dint know please help me<?$fol=$_REQUEST['folder'];$samp=$_SERVER["DOCUMENT_ROOT"];$path=$samp.'/Automotive/a/';//echo $path;chmod($path, 0777);mkdir($path.$fol,0777);fopen($path.$fol.'/index.php', "w+",0777);chmod($path.$fol.'/index.php', 0777);?>Error is Warning: chmod failed: Operation not permitted in /var/www/html/Automotive/a/next.php on line 6Warning: mkdir() failed (Permission denied) in /var/www/html/Automotive/a/next.php on line 7Warning: fopen("/var/www/html/Automotive/a/saffa/index.php", "w+") - No such file or directory in /var/www/html/Automotive/a/next.php on line 9Warning: chmod failed: No such file or directory in /var/www/html/Automotive/a/next.php on line 10
  13. Hi all In my Project when the user login that time update the field value 1 when the user click logout that time the same field updated "0" if the user after Login Close the window means how to update the field
  14. Hi all,please see the coding how to pass the variables one page to another page if($_REQUEST['s_photo_gallery'] == '1'){?><? $qry="select * from register where ".$search_q."";?> <script language="javascript">window.location.href="search_profile.php"</script><? }?>in the red color query bulid in current page this query how to post search_profile.php in this page except search_profile.php?qry=<?$qry ?> if i have put this means the full query is visible to the browser
  15. Hi all,please see the coding how to pass the variables one page to another page if($_REQUEST['s_photo_gallery'] == '1') {?> <? $qry="select * from register where ".$search_q."";?> <script language="javascript">window.location.href="search_profile.php"</script> <? }?>in the red color query bulid in current page this query how to post search_profile.php in this page except search_profile.php?qry=<?$qry ?> if i have put this means the full query is visible to the browser
  16. anand.arjunan

    blog

    Hi all,In my project client need for blog module i dont have idea about this please help me any one.
  17. anand.arjunan

    blog

    in my project my clent need forum module and blog module i have complete forum modulebut i dont have idea about blog.
  18. anand.arjunan

    blog

    Hi Friends,In my project the client need is blog how to configure the blog module in my project any free download packageis available please help me
  19. Hi friends i need the 1 2 3 4 5 >> 54 type model paging Please forward the coding
  20. Hi i need the below code paging and per par page 3 rows and each row 3 colums total 9 records per page how to write the code please give sample codes$qry=("select * from register where gender='".$ser."' and countryid='".$coun."'"); $exc=mysql_query($qry); $gettotalusers=@mysql_num_rows($exc); for($i=0;$i<$gettotalusers;$i++) { $getuserdata=mysql_fetch_array($exc); $userid=$getuserdata['user_id']; $username=$getuserdata['uname']; $userimage=$getuserdata['user_image']; $FilePath="user_images/".$userimage; $date=$getuserdata['dob']; $dob = explode("-",$date); $year= $dob[0]; $age=(date('Y')-$year); ?><table width="185" height="160" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="192" align="left" valign="top" class="photo_border" scope="col"><table width="185" height="160" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="20" align="left" valign="middle" class="search_hesding" scope="col"><?=$username?></td> </tr> <tr> <td align="left" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="120" height="140" align="center" valign="middle" scope="col"><table width="110" height="120" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle" bgcolor="#FFFFFF" class="photobox" scope="col"><img src="<?= $FilePath; ?>" width="66" height="91"></td> </tr> </table></td> <td align="center" valign="middle" class="search_text" scope="col"><p>Active within 24 hours </p></td> </tr> </table></td> </tr> <tr> <td height="22" align="left" valign="middle" class="search_hesding"><table width="50%" border="0" cellspacing="0" cellpadding="0"> <tr align="left" valign="middle"> <th width="10" scope="col"> </th> <th scope="col"><img src="images/contact.gif" alt="contact" width="16" height="16"></th> <th scope="col"><img src="images/virtual.gif" alt="Send virtual kiss" width="16" height="16"></th> <th scope="col"><img src="images/favour.gif" alt="Add favorites" width="16" height="16"></th> </tr> </table></td> </tr> </table></td> </tr> <? }?> </table>
×
×
  • Create New...