Solved

php, mysqp, image upload, errors out when image it over 1.5 megs

Posted on 2009-04-11
21
557 Views
Last Modified: 2013-12-12
Hello,

I am uploading images to my server and have the info inserted into the db.

It seems to just bounce back to the upload page when the image is over 1.5-2 megs, I would really like to have it so that it will upload and resize an image of about 5 megs.

I would also like to have it so that it will upload .png images and change them to jpg images, if that is possible.
<?

include ('db.php');

session_start();

//echo("in postsignup <BR>");

function errorHandling($tableName, $errorMsg, $errorNumber)

{

    rollback();

    header("Location: upload_images.php?msg=There was error  $errorMsg <BR> Error Number is $errorNumber in the following table $tableName <BR>");

}

$userid = $_GET['userid'];

if (!isset($userid))

{

    $userid = $_SESSION["userid"];

}

if (!isset($userid))

{

    $userid = $_SESSION['userid'];

}

$secretword = $_SESSION['secretword'];

 

//$userid = $_POST['userid'];

$propid = $_POST['propid'];

$finished = $_GET['finished'];

if (!isset($finished))

{

    $finished = $_POST['finished'];

}

elseif (!isset($finished))

{

    $finished = "false";

}

function convertImageToShow($filePath)

{

    // GD Function List

    $gd_function_suffix = array('image/pjpeg' => 'JPEG', 'image/jpeg' => 'JPEG',

        'image/gif' => 'GIF', 'image/bmp' => 'bmp', 'image/wbmp' => 'WBMP',

        'image/x-png' => 'PNG');

    $show_dir = "prop_images";

    $image_stats = getimagesize($filePath);

    $pos = strrpos($filePath, '/');

    $fileName = substr($filePath, $pos + 1);

    $width1 = $image_stats[0];

    $height1 = $image_stats[1];

    if ($width1 > $height1)

    {

        $newwidth = "410";

        $percent = ($newwidth / $width1);

        $newheight = number_format($height1 * $percent);

    }

    else

    {

        $newheight = "315";

        $percent = ($newheight / $height1);

        $newwidth = number_format($width1 * $percent);

    }

    $function_suffix = $gd_function_suffix[$image_stats['mime']];

    $function_to_read = "imagecreatefrom" . $function_suffix;

    $function_to_write = "image" . $function_suffix;

    $newwidth = $width1 * $percent;

    $newheight = $height1 * $percent;

    $source = $function_to_read($filePath);

    if ($source)

    {

        $show = imagecreatetruecolor($newwidth, $newheight);

        imagecopyresized($show, $source, 0, 0, 0, 0, $newwidth, $newheight, $width1, $height1);

        $function_to_write($show, "$show_dir" . "/$fileName");

        imageDestroy($show);

        imageDestroy($source);

    }

    else

    {

        echo ("Error converting the file to show size " . $fileName . "<BR />");

    }

    //echo("File completed ");

}

 

 

function convertImageToReduced($filePath)

{

    // GD Function List

    $gd_function_suffix = array('image/pjpeg' => 'JPEG', 'image/jpeg' => 'JPEG',

        'image/gif' => 'GIF', 'image/bmp' => 'bmp', 'image/wbmp' => 'WBMP',

        'image/x-png' => 'PNG');

    $reduced_dir = "prop_reduced";

    $image_stats = getimagesize($filePath);

    $pos = strrpos($filePath, '/');

    $fileName = substr($filePath, $pos + 1);

    $width1 = $image_stats[0];

    $height1 = $image_stats[1];

    if ($width1 > $height1)

    {

        $newwidth = "300";

        $percent = ($newwidth / $width1);

        $newheight = number_format($height1 * $percent);

    }

    else

    {

        $newheight = "250";

        $percent = ($newheight / $height1);

        $newwidth = number_format($width1 * $percent);

    }

    //echo("File type is " . $fileName . $image_stats['mime'] ."<BR />");

    $function_suffix = $gd_function_suffix[$image_stats['mime']];

    $function_to_read = "imagecreatefrom" . $function_suffix;

    $function_to_write = "image" . $function_suffix;

    $newwidth = $width1 * $percent;

    $newheight = $height1 * $percent;

    $source = $function_to_read($filePath);

 

    if ($source)

    {

        $reduced = imagecreatetruecolor($newwidth, $newheight);

        imagecopyresized($reduced, $source, 0, 0, 0, 0, $newwidth, $newheight, $width1,

            $height1);

        $function_to_write($reduced, "$reduced_dir" . "/$fileName");

        imageDestroy($reduced);

        imageDestroy($source);

    }

    else

    {

        echo ("Error converting the file to thumbnail " . $fileName . "<BR />");

    }

    //echo("File completed ");

}

 

function convertImageToThumbnail($filePath)

{

    // GD Function List

    $gd_function_suffix = array('image/pjpeg' => 'JPEG', 'image/jpeg' => 'JPEG',

        'image/gif' => 'GIF', 'image/bmp' => 'bmp', 'image/wbmp' => 'WBMP',

        'image/x-png' => 'PNG');

 

 

 

    $thumb_dir = "prop_thumbs";

    $image_stats = getimagesize($filePath);

    $pos = strrpos($filePath, '/');

    $fileName = substr($filePath, $pos + 1);

    $width1 = $image_stats[0];

    $height1 = $image_stats[1];

 

 

 

 

 

    if ($width1 > $height1)

    {

        $newwidth = "200";

        $percent = ($newwidth / $width1);

        $newheight = number_format($height1 * $percent);

    }

    else

    {

        $newheight = "150";

        $percent = ($newheight / $height1);

        $newwidth = number_format($width1 * $percent);

    }

 

 

 

 

    //echo("File type is " . $fileName . $image_stats['mime'] ."<BR />");

    $function_suffix = $gd_function_suffix[$image_stats['mime']];

    $function_to_read = "imagecreatefrom" . $function_suffix;

    $function_to_write = "image" . $function_suffix;

    $newwidth = $width1 * $percent;

    $newheight = $height1 * $percent;

    $source = $function_to_read($filePath);

 

    if ($source)

    {

        $thumb = imagecreatetruecolor($newwidth, $newheight);

        imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width1, $height1);

        $function_to_write($thumb, "$thumb_dir" . "/tb_$fileName");

        imageDestroy($thumb);

        imageDestroy($source);

    }

    else

    {

        echo ("Error converting the file to thumbnail " . $fileName . "<BR />");

    }

    //echo("File completed ");

}

if ($userid > 0 && $finished != "true")

{

 

    if (isset($_POST['vtourlink']))

    {

        if (trim($_POST['vtourlink']) != "http://")

        {

            $vtourlink = urlencode(trim($_POST['vtourlink']));

        }

        else

        {

            $vtourlink = "";

        }

        mysql_query("update propertyotherdetails set  virtuallink = '$vtourlink'  where propid  = '$propid' ") or

            errorHandling("

                propertyotherdetails", mysql_error(), mysql_errno());

    }

 

 

    //Images section code

    //$id = $_GET['id'];

    $images_dir = "prop_enlarge";

    //$show_dir = "prop_images";

    $reduced_dir = "prop_reduced";

    $thumb_dir = "prop_thumbs";

 

    // initialization

    $result_final = "";

    $photoCounter = 0;

    $overSizeImage = "false";

 

 

    // List of our known photo types

    $known_photo_types = array('image/pjpeg' => 'jpg', 'image/jpeg' => 'jpg',

        'image/gif' => 'gif', 'image/bmp' => 'bmp', 'image/x-png' => 'png');

 

    // GD Function List

    $gd_function_suffix = array('image/pjpeg' => 'JPEG', 'image/jpeg' => 'JPEG',

        'image/gif' => 'GIF', 'image/bmp' => 'WBMP', 'image/x-png' => 'PNG');

    $imagesQuery = "SELECT count( image_id ) as totalNoOfImages  FROM images WHERE propid =" .

        $propid;

    $query = mysql_query($imagesQuery);

    $propertyRow = mysql_fetch_array($query);

 

    $photos_uploaded1 = $_FILES['propPhotos'];

 

 

    //echo("The image received is " . count($photos_uploaded1));

    while ($photoCounter <= count($photos_uploaded1))

    {

        //echo("Test" . $photos_uploaded1['size'][$photoCounter]);

        if ($photos_uploaded1['size'][$photoCounter] > 4194304)

        {

            $overSizeImage = "true";

            //echo("Test Succesfull" . $photos_uploaded1['size'][$photoCounter]);

            break;

        }

        else

        {

 

            if ($photos_uploaded1['size'][$photoCounter] > 0)

            {

 

                //echo("The image received is " . $photos_uploaded1['size']);

                if (!array_key_exists($photos_uploaded1['type'][$photoCounter], $known_photo_types))

                {

                    $result_final .= "File " . ($photoCounter + 1) . " is not a photo<br />";

                    //echo("The image inserted is " . $result_final);

                }

                else

                {

 

                    if (!isset($propertyRow['totalNoOfImages']))

                    {

                        mysql_query("INSERT INTO images(propid, filename,mainImage) VALUES('$propid', '0','y')") or

                            errorHandling("images", mysql_error(), mysql_errno());

                        $new_id = mysql_insert_id();

                    }

                    else

                    {

                        mysql_query("INSERT INTO images(propid, filename,mainImage) VALUES('$propid', '0','n')") or

                            errorHandling("images", mysql_error(), mysql_errno());

                        $new_id = mysql_insert_id();

                    }

                    //echo("The image inserted is " . $new_id);

 

                    $filetype = $photos_uploaded1['type'][$photoCounter];

                    $extention = $known_photo_types[$filetype];

                    $filename = $new_id . "." . $extention;

 

                    // Store the orignal file

                    copy($photos_uploaded1['tmp_name'][$photoCounter], $images_dir . "/" . $filename);

                    //Enlarge Feature

                    convertImageToShow($images_dir . "/" . $filename);

                    //reduce size

                    convertImageToReduced($images_dir . "/" . $filename);

                    //make thumbnail

                    convertImageToThumbnail($images_dir . "/" . $filename);

 

                    mysql_query("UPDATE images SET filename='" . addslashes($filename) .

                        "' WHERE image_id='" . addslashes($new_id) . "'");

                }

 

            }

        }

        $photoCounter++;

    }

 

}

// run the query again... to make sure we have the same count as in the database...

$imagesQuery = "SELECT count( image_id ) as totalNoOfImages  FROM images WHERE propid =" .

    $propid;

$query = mysql_query($imagesQuery);

$propertyRow = mysql_fetch_array($query);

if ($overSizeImage == "true")

{

    header("Location: upload_images.php?propid=$propid&noOfImages=" . $propertyRow['totalNoOfImages'] .

        "&msg=Image is very large!.Please try a different image");

}

else

    if ($userid > 0 && $finished == "true")

    {

        header("Location: https://domainX.com/ccprocessing.php?propid=$propid&userid=$userid");

    }

    else

        if ($userid > 0)

        {

            if ($propertyRow['totalNoOfImages'] < 12)

            {

                header("Location: upload_images.php?propid=$propid&noOfImages=" . $propertyRow['totalNoOfImages'] .

                    "&msg=" . $propertyRow['totalNoOfImages'] . " images added successfully");

            }

            else

            {

                header("Location: https://domainX.com/ccprocessing.php?propid=$propid");

            }

        }

        else

        {

            header("Location: upload_images.php?propid=$propid&noOfImages=" . $propertyRow['totalNoOfImages'] .

                "&msg=Image is very large!.Please try a differnt image");

        }

 

?>

Open in new window

0
Comment
Question by:movieprodw
  • 11
  • 10
21 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 24126239
Please post the form you use to upload the files, and maybe we can help.

The issue with file size is that there are multiple constraints.  
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 24126250
Have a look at this sample script and note the "max file size" fields.  You may want to look at phpinfo() to see what the default value might be.  Look in the PHP CORE section for "upload_max_filesize".
<?php // RAY_upload_example.php

error_reporting(E_ALL);
 

// MANUAL REFERENCE PAGES

// http://docs.php.net/manual/en/features.file-upload.php

// http://docs.php.net/manual/en/features.file-upload.common-pitfalls.php

// http://docs.php.net/manual/en/function.move-uploaded-file.php

// http://docs.php.net/manual/en/function.getimagesize.php
 

// ESTABLISH THE NAME OF THE 'uploads' DIRECTORY

$uploads = 'uploads';
 

// ESTABLISH THE BIGGEST FILE SIZE WE CAN ACCEPT

$max_file_size = '8192000';  // EIGHT MEGABYTE LIMIT ON UPLOADS
 

// ESTABLISH THE KINDS OF FILE EXTENSIONS WE CAN ACCEPT

$file_exts = array('jpg', 'gif', 'png', 'txt');
 

// ESTABLISH THE NUMBER OF FILES WE CAN UPLOAD

$nf = 3;
 
 
 

// THIS IS A LIST OF THE POSSIBLE ERRORS THAT CAN BE REPORTED in $_FILES[]["error"]

$errors	= array(

	0=>"Success!",

	1=>"The uploaded file exceeds the upload_max_filesize directive in php.ini",

	2=>"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form",

	3=>"The uploaded file was only partially uploaded",

	4=>"No file was uploaded",

	6=>"Missing a temporary folder",

	7=>"Cannot write file to disk"

);
 
 
 

// IF THERE IS NOTHING IN $_POST, PUT UP THE FORM FOR INPUT

if (empty($_POST))

{

	?>

	<h2>Upload a file</h2>
 

	<!--

		SOME THINGS TO NOTE ABOUT THIS FORM...

		NOTE THE CHOICE OF ENCTYPE IN THE HTML FORM STATEMENT

		MAX_FILE_SIZE MUST PRECEDE THE FILE INPUT FIELD

		INPUT NAME= IN TYPE=FILE DETERMINES THE NAME YOU FIND IN $_FILES ARRAY

	-->
 

	<form name="UploadForm" enctype="multipart/form-data" action="<?=$_SERVER["REQUEST_URI"]?>" method="POST">

	<input type="hidden" name="p" value="1" />

	<input type="hidden" name="MAX_FILE_SIZE" value="<?=$max_file_size?>" />

	<p>

	Find the file(s) you want to upload and click the "Upload" button below.

	</p>
 

	<?php for ($n = 0; $n < $nf; $n++)

		{

			echo "<input name=\"userfile$n\" type=\"file\" size=\"80\" /><br/>\n";

		}

	?>

	<br/>Check this box <input autocomplete="off" type="checkbox" name="overwrite" /> to <b>overwrite</b> existing files.

	<input type="submit" name="_submit" value="Upload" />

	</form>

	<?php

	die();

}
 
 
 

else // WE HAVE GOT SOMETHING IN $_POST

{
 

// THERE IS POST DATA - PROCESS IT

	echo "<h2>Results: File Upload</h2>\n";
 

// ACTIVATE THIS TO SEE WHAT IS COMING THROUGH

//	echo "<pre>"; var_dump($_FILES); var_dump($_POST); echo "</pre>\n";
 

// ITERATE OVER THE CONTENTS OF $_FILES

	foreach ($_FILES as $my_uploaded_file)

	{
 

// SKIP OVER EMPTY SPOTS - NOTHING UPLOADED

		$error_code	= $my_uploaded_file["error"];

		if ($error_code == 4) continue;
 

// SYNTHESIZE THE NEW FILE NAME

		$f_type	= trim(strtolower(end    (explode( '.', basename($my_uploaded_file['name'] )))));

		$f_name	= trim(strtolower(current(explode( '.', basename($my_uploaded_file['name'] )))));

		$my_new_file	= getcwd() . '/' . $uploads . '/' . $f_name .'.'. $f_type;

		$my_file	= $uploads . '/' . $f_name .'.'. $f_type;
 

// OPTIONAL TEST FOR ALLOWABLE EXTENSIONS

		if (!in_array($f_type, $file_exts)) die("Sorry, $f_type files not allowed");
 

// IF THERE ARE ERRORS

		if ($error_code != 0)

		{

			$error_message = $errors[$error_code];

			die("Sorry, Upload Error Code: $error_code: $error_message");

		}
 

// GET THE FILE SIZE

		$file_size	= number_format($my_uploaded_file["size"]);
 

// MOVE THE FILE INTO THE DIRECTORY

// IF THE FILE IS NEW

		if (!file_exists($my_new_file))

		{

			if (move_uploaded_file($my_uploaded_file['tmp_name'], $my_new_file))

			{

				$upload_success = 1;

			}

			else

			{

				$upload_success = -1;

			}
 

// IF THE FILE ALREADY EXISTS

		}

		else

		{

			echo "<br/><b><i>$my_file</i></b> already exists.\n";
 

// SHOULD WE OVERWRITE THE FILE? IF NOT

			if (empty($_POST["overwrite"]))

			{

				$upload_success = 0;
 

// IF WE SHOULD OVERWRITE THE FILE, TRY TO MAKE A BACKUP

			}

			else

			{

				$now	= date('Y-m-d');

				$my_bak = $my_new_file . '.' . $now . '.bak';

				if (!copy($my_new_file, $my_bak))

				{

					echo "<br/><b>Attempted Backup Failed!</b>\n";

				}

				if (move_uploaded_file($my_uploaded_file['tmp_name'], $my_new_file))

				{

					$upload_success = 2;

				}

				else

				{

					$upload_success = -1;

				}

			}

		}
 

// REPORT OUR SUCCESS OR FAILURE

		if ($upload_success == 2) { echo "<br/>It has been overwritten.\n"; }

		if ($upload_success == 1) { echo "<br/><b><i>$my_file</i></b> has been saved.\n"; }

		if ($upload_success == 0) { echo "<br/><b>It was NOT overwritten.</b>\n"; }

		if ($upload_success < 0)  { echo "<br/><b>ERROR <i>$my_file</i> NOT SAVED - SEE WARNING FROM move_uploaded_file() COMMAND</b>\n"; }

		if ($upload_success > 0)

		{

			echo "$file_size bytes uploaded.\n";

			if (!chmod ($my_new_file, 0755))

			{

				echo "<br/>chmod(0755) FAILED: fileperms() = ";

				echo substr(sprintf('%o', fileperms($my_new_file)), -4);

			}

			echo "<br/><a href=\"$my_file\">See the file $my_file</a>\n";

		}

// END ITERATOR

	}

}

?>

Open in new window

0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 24126268
Also, please tell us who your hosting company is, and whether PHP has GD support (it probably does, most installations are at GD 2+ nowadays).

The issue of converting from a PNG to a JPG is covered in the image processing functions which are documented here:
http://us.php.net/manual/en/ref.image.php

The general idea for the conversion is to use imagecreatefrompng() to create an image resource and imagejpeg() to write a JPG from the image resource.  You can add more to it, rotating and resizing, etc., but that covers the basics.

Best regards, ~Ray
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24126877
Hello,

I am uploading the main page with the file upload on it, its kind of a mess, it was inherited from another programmer.


<?php

include('db.php');
 

session_start();
 

if (empty($_SESSION["userid"]))

{

   header("Location: /login.php");

   exit;

}
 

header('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');

		$custid = $_GET['custid'];

		$msg = $_GET['msg'];

		if(!isset($custid))

			$custid = $_POST['custid'];
 

		if(!isset($custid)){

			$custid = $_SESSION['custid'];

		}

        $propid = $_SESSION['propid'];

        if(!isset($propid))

         $propid = $_POST['propid'];

        $noOfImages = $_GET['noOfImages'];

        $msg = $_GET['msg'];

        if(!isset($noOfImages)){

                $noOfImages = 0;

        }

        $imgResult = mysql_query("SELECT filename, mainImage FROM images WHERE propid = '$propid'") or die(mysql_error());

        $totalImgResult = mysql_num_rows($imgResult);

        

        function showListedProperty($img,$imageNumber,$imgId,$mainImage,$caption){

                $listedProperty = "";

                $listedProperty = $listedProperty . "<table width=\"254\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";

                $listedProperty = $listedProperty . "                <tr>\n";

                $listedProperty = $listedProperty . "                        <td bgcolor=\"#e6e6e6\">";

                $listedProperty = $listedProperty . "                                <p class=\"font\">&nbsp;Image $imageNumber</p>";

                $listedProperty = $listedProperty . "                        </td>";

                $listedProperty = $listedProperty . "                </tr>";

                $listedProperty = $listedProperty . "                <tr height=\"1\">";

                $listedProperty = $listedProperty . "                        <td bgcolor=\"#c8c8c8\" height=\"1\"></td>\n";

                $listedProperty = $listedProperty . "                </tr>";

                $listedProperty = $listedProperty . "                <tr height=\"165\">";

                $listedProperty = $listedProperty . "                        <td bgcolor=\"#f6f6f6\" height=\"165\">";

                $listedProperty = $listedProperty . "                                <div align=\"center\">";

                $listedProperty = $listedProperty . "                                        <img src=\"prop_reduced/" . $img ."\" alt=\"\" height=\"150\" width=\"200\" border=\"0\"></div>";

                $listedProperty = $listedProperty . "                        </td>";

                $listedProperty = $listedProperty . "                </tr>";

                $listedProperty = $listedProperty . "                <tr height=\"20\">";

                $listedProperty = $listedProperty . "                        <td bgcolor=\"#f6f6f6\" height=\"20\">";

                $listedProperty = $listedProperty . "                                <div align=\"center\">\n";

                $listedProperty = $listedProperty . "                                        <font size=\"2\" face=\"Helvetica, Geneva, Arial, SunSans-Regular, sans-serif\">";

                $caption =          (isset($caption )&& strlen($caption) > 0)?$caption:"No Caption";

                $listedProperty = $listedProperty . "<textarea wrap=\"hard\"   onkeyup  = \"checkLength(this)\"  maxlength = \"80\" rows=\"2\" cols=\"25\"  updatebutton = \"updateCaption$imgId\" id = \"caption$imgId\" >$caption</textarea>";

                $listedProperty = $listedProperty . "                                </font></div>";

                $listedProperty = $listedProperty . "                        </td>";

                $listedProperty = $listedProperty . "                </tr>";

                $listedProperty = $listedProperty . "                <tr height=\"20\">";

                $listedProperty = $listedProperty . "                        <td bgcolor=\"#f6f6f6\" height=\"20\">";

                $listedProperty = $listedProperty . "                                <div align=\"center\">";

                $listedProperty = $listedProperty . "                                        <font size=\"2\" face=\"Helvetica, Geneva, Arial, SunSans-Regular, sans-serif\">";

                if($mainImage == "y"){

                        $listedProperty = $listedProperty . "* Main Image";

                }

                $listedProperty = $listedProperty . "                                       <input type=\"button\" id = \"updateCaption$imgId\"  name=\"updateCaption\" value=\"Update Caption\" onClick=\"updateImageCaption('". $imageNumber."','".$imgId ."', 'caption".$imgId."')\">";                
 

                $listedProperty = $listedProperty . "                                </font></div>";

                $listedProperty = $listedProperty . "                        </td>";

                $listedProperty = $listedProperty . "                </tr>";

                $listedProperty = $listedProperty . "                <tr>";             

                $listedProperty = $listedProperty . "                        <td bgcolor=\"#f6f6f6\">";

                $listedProperty = $listedProperty . "                                <div align=\"center\">";

                $listedProperty = $listedProperty . "                                       <input type=\"button\" name=\"deleteButton\" value=\"Delete Image\" onClick=\"deleteImage('". $imgId . "')\">";

                $listedProperty = $listedProperty . "                                       <input type=\"button\" name=\"makeMain\" value=\"Make Main\" onClick=\"setAsMainImage('". $imgId ."')\">";

                $listedProperty = $listedProperty . "                                   </div>";

                $listedProperty = $listedProperty . "                        </td>";

                $listedProperty = $listedProperty . "                </tr>";

                $listedProperty = $listedProperty . "        </table>";

                return $listedProperty;

        }

        function showListedProperties($propid){

                $listedProperties = "";

                if(!isset($propid) || trim($propid) == "" ){

                        return $listedProperties;

                }

                $photo_result = mysql_query("SELECT filename ,image_id,mainImage,caption FROM images WHERE propid = '$propid'") or die(mysql_error());

                $totalImages = mysql_num_rows($photo_result);

                //echo("This is in show listed properties " . $totalImages);

                $counter = 1;

                while($img = mysql_fetch_array($photo_result)){

                    //showListedProperty($img[0]);

                    if($counter == 1){

                        $listedProperties .= "<table width=\"122\" border=\"0\" cellspacing=\"6\" cellpadding=\"0\">";

                        $listedProperties .= "<tr>";

                        $listedProperties .= "<td class=\"border\">";

                        $listedProperties .= showListedProperty($img[0],$counter,$img[1],$img[2],$img[3]);

                        $listedProperties .= "</td>";

                        if($totalImages == 1){

                            $listedProperties .= "</tr>";

                            $listedProperties .= "</table>";

                        }

                    }

                    if($counter == 2){

                        $listedProperties .= "<td class=\"border\">";

                        $listedProperties .= showListedProperty($img[0],$counter,$img[1],$img[2],$img[3]);

                        $listedProperties .= "</td>";

                        if($totalImages == 2){

                                $listedProperties .= "</tr>";

                                $listedProperties .= "</table>";

                        }

                    }

                    if($counter == 3){

                        $listedProperties .= "</tr>";

                        $listedProperties .= "<tr>";

                        $listedProperties .= "<td class=\"border\">";

                        $listedProperties .= showListedProperty($img[0],$counter,$img[1],$img[2],$img[3]);

                        $listedProperties .= "</td>";

                        if($totalImages == 3){

                            $listedProperties .= "</tr>";

                            $listedProperties .= "</table>";

                        }

                    }

                    if($counter == 4){

                        $listedProperties .= "<td class=\"border\">";

                        $listedProperties .= showListedProperty($img[0],$counter,$img[1],$img[2],$img[3]);

                        $listedProperties .= "</td>";

                        if($totalImages == 4){

                            $listedProperties .= "</tr>";

                            $listedProperties .= "</table>";

                        }

                    }

                    if($counter == 5){

                        $listedProperties .= "</tr>";

                        $listedProperties .= "<tr>";

                        $listedProperties .= "<td class=\"border\">";

                        $listedProperties .= showListedProperty($img[0],$counter,$img[1],$img[2],$img[3]);

                        $listedProperties .= "</td>";

                        if($totalImages == 5){

                            $listedProperties .= "</tr>";

                            $listedProperties .= "</table>";

                        }

                    }

                    if($counter == 6){

                        $listedProperties .= "<td class=\"border\">";

                        $listedProperties .= showListedProperty($img[0],$counter,$img[1],$img[2],$img[3]);

                        $listedProperties .= "</td>";

                        if($totalImages == 4){

                            $listedProperties .= "</tr>";

                            $listedProperties .= "</table>";

                        }

                    }

                    if($counter == 7){

                        $listedProperties .= "</tr>";

                        $listedProperties .= "<tr>";

                        $listedProperties .= "<td class=\"border\">";

                        $listedProperties .= showListedProperty($img[0],$counter,$img[1],$img[2],$img[3]);

                        $listedProperties .= "</td>";

                        if($totalImages == 5){

                            $listedProperties .= "</tr>";

                            $listedProperties .= "</table>";

                        }

                    }

                    if($counter == 8){

                        $listedProperties .= "<td class=\"border\">";

                        $listedProperties .= showListedProperty($img[0],$counter,$img[1],$img[2],$img[3]);

                        $listedProperties .= "</td>";

                        if($totalImages == 4){

                            $listedProperties .= "</tr>";

                            $listedProperties .= "</table>";

                        }

                    }

                    if($counter == 9){

                        $listedProperties .= "</tr>";

                        $listedProperties .= "<tr>";

                        $listedProperties .= "<td class=\"border\">";

                        $listedProperties .= showListedProperty($img[0],$counter,$img[1],$img[2],$img[3]);

                        $listedProperties .= "</td>";

                        if($totalImages == 5){

                            $listedProperties .= "</tr>";

                            $listedProperties .= "</table>";

                        }

                    }

                    if($counter == 10){

                        $listedProperties .= "<td class=\"border\">";

                        $listedProperties .= showListedProperty($img[0],$counter,$img[1],$img[2],$img[3]);

                        $listedProperties .= "</td>";

                        if($totalImages == 4){

                            $listedProperties .= "</tr>";

                            $listedProperties .= "</table>";

                        }

                    }

                    if($counter == 11){

                        $listedProperties .= "</tr>";

                        $listedProperties .= "<tr>";

                        $listedProperties .= "<td class=\"border\">";

                        $listedProperties .= showListedProperty($img[0],$counter,$img[1],$img[2],$img[3]);

                        $listedProperties .= "</td>";

                        if($totalImages == 5){

                            $listedProperties .= "</tr>";

                            $listedProperties .= "</table>";

                        }

                    }

                    if($counter == 12){

                        $listedProperties .= "<td class=\"border\">";

                        $listedProperties .= showListedProperty($img[0],$counter,$img[1],$img[2],$img[3]);

                        $listedProperties .= "</td>";

                        $listedProperties .= "</tr>";

                        $listedProperties .= "</table>";

                    }

                    $counter= $counter + 1;

                }

                return $listedProperties;

        }

?>

<html>

<head>

<SCRIPT LANGUAGE="JavaScript" >

        function NewWindow(mypage, myname, w, h, scroll) {

                var winl = (screen.width - w) / 2;

                var wint = (screen.height - h) / 2;

                winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'

                win = window.open(mypage, myname, winprops)

                if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

        }

        function submitForm(){

                //document.getElementById('finished').value = "true";

                document.forms.form.action = "post_images.php?finished=true";

                document.forms.form.submit();

        }

        function deleteImage(image_id){

                //document.getElementById('image_id').value = image_id;

                var url = "post_imagedelete.php?image_id=" + image_id;

                document.forms.form.action = url;

                document.forms.form.submit();

        }

        function setAsMainImage(image_id){

                var url = "post_imagemain.php?image_id=" + image_id;

                document.forms.form.action = url;

                document.forms.form.submit();

        }

        function updateImageCaption(imagenumber,image_id,captionId){

            var captionValue = document.getElementById(captionId);

            if(captionValue== 'No Caption'){return;}

            var ecode = encodeURI(captionValue.value);

            var url = "post_imagecaption.php?image_id=" + image_id+"&imageNumber=" + imagenumber+ "&caption="+ecode;

            document.forms.form.action = url;

            document.forms.form.submit();

        }

        function checkLength(textbox){

            var currentText = textbox.value;

            if (textbox.value.length > textbox.getAttribute('maxlength')){

                 alert(" Maximun number of characters allowed in a caption is "+textbox.getAttribute('maxlength'));

                textbox.value=textbox.value.substr(0,textbox.getAttribute('maxlength'));

            }

        }
 

</SCRIPT></head>

<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">

<div align="center">

  <table class="mainborder" width="450" border="0" cellspacing="0" cellpadding="0" bgcolor="white" height="100%">

    <tr height="10">

					<td align="center" valign="top" height="10">

        <div align="center">

                </div>

      </td>

				</tr>

    <tr>

    <form action="post_images.php" method="post" enctype="multipart/form-data" name="form">

						<td align="center" valign="top">

        <div align="center">

          <br/>

          <font class="font">

<? echo($msg); ?>

                    </font>

          <br/>

          <br/>

          <table width="500" border="1" cellspacing="0" cellpadding="0" bordercolor="#c8c8c8">

            <tr height="21">

              <td style="border: none" class="font" colspan="2" valign="bottom" bgcolor="#f6f6f6" height="21">Image Upload</td>
 
 

            </tr>

            <tr height="1">

              <td style="border: none" colspan="2" bgcolor="#c8c8c8" height="1">              </td>

            </tr>
 

<? if($totalImgResult == 0 ){?>

					

						

					

					

						

					
 

            

            <tr height="30">

										<td style="border: none" bgcolor="white" height="30">

                <div align="center">

												<br>

												<font size="2" color="black" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Images can be uploaded at anytime in the Member Area. We do strongly<br>

													 suggest that you upload at least one image of the property now.<br>

												</font><font size="2" color="#620000" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><br>

												</font></div>

              </td>

									</tr>

					<?}?><? if($totalImgResult >= 12){ ?>

                      <tr height="1">

              <td style="border: none" colspan="2" bgcolor="#c8c8c8" height="1">              </td>

            </tr>

            <tr height="30">

										<td style="border: none" bgcolor="white" height="30">

                <div align="center">

                  <font size="2" color="#620000" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">                    Your have reached your maximum

                    <br/>

                    please delete one to upload another.

</font>

                </div>

              </td>

									</tr>
 

<?}else { ?>

                      <tr height="30">

              <td style="border: none" colspan="2" bgcolor="white" height="30">

                <div align="center">

                  <input name="propPhotos[]" type="file" id="main_image" size="27"/>

                  <input name="MAX_FILE_SIZE" type="hidden" value="5242880"/>

                </div>

              </td>

            </tr>

            <tr>

              <td style="border: none" colspan="2" bgcolor="white">

                <div align="center">

                  <input type="submit" name="Submit" size="30" value="Upload Image"/>

                </div>

              </td>

            </tr>
 

<?} ?>

                      <tr>

										<td style="border: none" bgcolor="white">

                <div align="right">                </div>

              </td>

									</tr>

          </table>

          <br/>

          <table width="500" border="1" cellspacing="0" cellpadding="0" bordercolor="#c8c8c8">

            <tr height="21">

              <td style="border: none" class="font" valign="bottom" bgcolor="#f6f6f6" height="21">Uploading Guidelines</td>

            </tr>

            <tr height="1">

              <td style="border: none" bgcolor="#c8c8c8" height="1">              </td>

            </tr>

            <tr>

              <td style="border: none" class="font" bgcolor="white"><font size="2">

                  <br/>

                </font><font size="2" color="white">_</font><font color="#990000">

                </font><font size="2" color="#990000">- Only upload</font><font color="#990000">

                </font><font size="2" color="#990000">                  JPEG/JPG images

                  <br/>

											</font><font size="2" color="white">_</font><font color="#990000">

                </font><font size="2" color="#990000">- Only upload images that are</font><font color="#990000">

                </font><font size="2" color="#990000">under 3 megs</font><font color="#990000">

                </font><font size="2" color="#990000"><br/>

											</font><font size="2" color="white">_</font><font color="#990000">

                </font><font size="2" color="#990000">                  - Only upload images that you shot/purchased

                  <br/>

											</font><font size="2" color="white">_</font><font color="#990000">

                </font><font size="2" color="#990000">                  - Only upload images that are of the listed property

                  <br/>

											</font><font size="2"><br/>

											</font></td>

            </tr>

          </table>

          <p align="center">          </p>

          <? if($totalImgResult > 0) { ?>

          <p>

            <font size="3">

              <br/>

                        </font>

            <font class="font">              Your Current Images:

              <br/>

            </font>

          </p>

          <table width="450" border="0" cellspacing="0" cellpadding="0">

            <tr>

              <td>

                <div align="center">

                    <? 

                    echo(showListedProperties($propid));

                    ?>

                </div>

              </td>

            </tr>

          </table>

            <? 

                }

            ?>

          <p>

            <br/>

            <input type="hidden" name="userid" value="<?=$_SESSION["userid"]?>" />

            <input type="hidden" name="propid" value="<?=$propid?>" />

            <input type="hidden" name="image_id" value=""/>

            <input type="hidden" name="finished" value=""/>

            

            <? if($totalImgResult == 0 ){?>

					

						

			<input type="submit" name="returnToMembersArea" value="Upload Later" onclick="submitForm()"/>
 
 

								
 

<?}else { ?>

			<input type="submit" name="returnToMembersArea" value="Continue" onclick="submitForm()"/>
 
 

<?} ?>

            

            

            

            <br>

            <br>

          </p>

        </div>

      </td>
 

    </tr>

    <tr>

      <td align="center" valign="bottom">

        <div align="center">

                </div>

      </td>

    </tr>

  </table>

</div>

</form></body>

</html>

Open in new window

0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 24126907
As I mentioned above, "Have a look at this sample script and note the "max file size" fields."

MAX_FILE_SIZE must precede the input statement for the file.  Look near line 325.  I think you might want to move that BEFORE the input type="file" statement and try again.

This is no guarantee.  Your hosting company may throttle this.  But it's a change that definitely needs to be done.

best, ~Ray
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24126916
Ok, I will test that, its a dedicated server so it should not be a problem, that that is a whole new thread :-)
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 24126926
Good - a dedicated server will be easier to control.  Be sure to check PHPINFO.
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24126948
Ray, I switched them but its still erroring with the image is over 1.5ish megs
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24126965
its odd because it inserts the information into the db, its does not produce an image but it inserts 'filename' = 0
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 24127096
Try using var_dump() to print the contents of $_POST and $_FILES so you can see what is going on in there.  Pay attention to the error number fields.  I don't think I can debug 437 lines of code for you, but if you look carefully over the example I posted above, you may find that the script you're working on does not do all the right things in the right order!

Best regards, ~Ray
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 1

Author Comment

by:movieprodw
ID: 24127122
Thanks Ray, I will I was just cooking for Easter and thought I would post it and see if anything jumped out at you.

Thank you for all of your help and I will let you know what happens!

0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 24127124
Thanks and good luck with it!  ~Ray
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24142207
Well this could be our answer:

Sorry, Upload Error Code: 1: The uploaded file exceeds the upload_max_filesize directive in php.ini
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24142295
This answers that:
post_max_size       8M
upload_max_filesize      2M      
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24142611
set it to 32 and I am able to upload the files now.

I also do not want to go through that old code.

I need to have the files renamed and the name and property id inserted into the db.

Can you please assist me with that, then I will have to figure out how to resize them.
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24142627
Oh, I am using the new code provided by Ray
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 24152985
Renaming the files and inserting the property ID (wherever that comes from - maybe $_POST["propid"]) would be done somewhere near lines 88 thru 92.  You probably want to use str_pad() to give the property ID some leading zeros if it is numeric.  Then you can have file names that line up in neat columns because the elements of the file name will all be the same length.  Makes for easier debugging, etc.
http://us3.php.net/manual/en/function.str-pad.php

HTH, ~Ray

PS... Resizing images is really a different issue - you can look up the GD functions in PHP and you will find lots of them with a description of them.  Here are a couple of local functions that should put you on the right track.
// FUNCTION TO DETERMINE IF GD IS AT LEVEL 2 OR MORE

function get_gd_info($display=FALSE)

{
 

// IS GD INSTALLED AT ALL?

   if (!function_exists("gd_info"))

   {

      if ($display) echo "<br/>GD NOT INSTALLED\n";

      return FALSE;

   }
 

// IF GD IS INSTALLED GET DETAILS

   $gd = gd_info();
 

// IF DISPLAY IS REQUESTED, PRINT DETAILS

   if ($display)

   {

      echo "<br/>GD DETAILS:\n";

      foreach ($gd as $key => $value)

      {

         if ($value === TRUE)  $value = 'YES';

         if ($value === FALSE) $value = 'NO';

         echo "<br/>$key = $value \n";

      }

   }
 

// RETURN THE VERSION NUMBER

   $gd_version = ereg_replace('[^0-9\.]', '', $gd["GD Version"]);;

   return $gd_version;

}
 
 

// FUNCTION TO MAKE AN IMAGE INTO THE RIGHT SIZE FOR PAGE DISPLAY

// WILL WORK IF GD2 NOT INSTALLED, BUT WILL MAKE POORER IMAGES

function create_right_size_image($image, $width=720)

{

// IS GD HERE?

   $gdv = get_gd_info();

   if (!$gdv) return FALSE;
 

// GET AN IMAGE THING

   $source = imagecreatefromjpeg("$image");
 

// GET THE X AND Y DIMENSIONS

   $imageX = imagesx($source);

   $imageY = imagesy($source);
 

// IF NO RESIZING IS NEEDED

   if ($imageX <= $width)

   {

      return FALSE;

   }
 

// THE WIDTH IS TOO GREAT - MUST RESIZE

   $tnailX = $width;

   $tnailY = (int) (($tnailX * $imageY) / $imageX );
 

// WHICH FUNCTIONS CAN RESIZE / RESAMPLE THE IMAGE?

   if ($gdv >= 2)

   {

// IF GD IS AT LEVEL 2 OR ABOVE

      $target = imagecreatetruecolor($tnailX, $tnailY);

      imagecopyresampled ($target, $source, 0, 0, 0, 0, $tnailX, $tnailY, $imageX, $imageY);

   } else

   {

// IF GD IS AT A LOWER REVISION LEVEL

      $target = imagecreate($tnailX, $tnailY);

      imagecopyresized   ($target, $source, 0, 0, 0, 0, $tnailX, $tnailY, $imageX, $imageY);

   }

   return $target ;

}

Open in new window

0
 
LVL 1

Author Comment

by:movieprodw
ID: 24153062
Hello Ray,

I am having a heck of a time with this, I am not sure why its so hard for me to figure out.

Below is my entire code and I have it so that it uploads an image and inserts the info in the db which is great, I use the current time+seconds to name the image. I figured that there is little to no chance that two people will be loading the page at the same time... I did not know how to do the random number.

I would seriously kiss your feet if you could provide me with this code!

3 sizes and locations
/prop_enlarged/  700px 400px,  I would like it to say proportionate
/prop_listing/  340px 270px,  I would like it to say proportionate
/prop_thumb/  125px 90px,  I would like it crop to that size

<?php include('headera.php'); ?>
 

<?php

$propid = $_SESSION['propid'];

        

// define constant which contains the maximum file size in bytes

define('MAX_FILE_SIZE', 4000000);

 

if (array_key_exists('btn', $_POST)) {

 

// define new constant which contains the path the the upload folder

define('UPL_FLD','uploads/');

 

//Find the extension

$flext = pathinfo($_FILES['frmfile']['name']);

$ext = strtolower($flext['extension']);
 
 

// create new file name

$file = str_replace(' ', '_', $_POST['frmname'].'.'.$ext);

$file = strtolower($file);

 

// create variable and assign the formatted value of MAX_FILE_SIZE to it

$maxfs = number_format(MAX_FILE_SIZE/1024, 1).'KB';

$fsize = false;

 

// check the file size

if ($_FILES['frmfile']['size'] > 0 && $_FILES['frmfile']['size'] <= MAX_FILE_SIZE) {

 

        $fsize = true;

 

}

 

// allow MIME file types

$filetype = array('image/gif','image/jpeg','image/pjpeg','image/png');

$ftype = false;

 

// check if uploaded file type is allowed

foreach($filetype as $type) {

 

        if ($type == $_FILES['frmfile']['type']) {

        

                $ftype = true;

                break;

        

        }

 

}

 

if ($ftype && $fsize && $_POST['frmname'] != '') {

 

        switch($_FILES['frmfile']['error']) {

        

                case 0:

                // move file to the upload folder

                $upload = move_uploaded_file($_FILES['frmfile']['tmp_name'],UPL_FLD.$file);

 
 

                if ($upload) {

                

                        $msg = $_FILES['frmfile']['name'].' uploaded successfully';

                        

                        $img_name = $file;

                        

                        $query = "SELECT `propid` FROM `images` WHERE `propid` = $propid";

						$result = mysql_query($query);

						if (mysql_num_rows($result) > 0) {
 

						$sql = "INSERT into images (propid,userid,img_name,mainImage) VALUES ('$propid','$userid','$img_name','N')";

                        $result = mysql_db_query($dbname, $sql) or die("Failed Query of " . $sql);  //do the query

                        

  							 } else {

     

						$sql = "INSERT into images (propid,userid,img_name,mainImage) VALUES ('$propid','$userid','$img_name','Y')";

                        $result = mysql_db_query($dbname, $sql) or die("Failed Query of " . $sql);  //do the query

     

     

							}

					

						

                     

 

                                        

                } else {

                

                        $msg = 'Error.<br />Please try again.';

                }

                break;

                

                case 3:

                $msg = 'Error.<br />Please try again.';

                break;

                

                default:

                $msg = 'Error - please contact administrator';

                

        }

                

                

} elseif ($_FILES['frmfile']['error'] == 4) {

 

        $msg = 'Please select file';

 

} elseif ($_POST['frmname'] == '') {

 

        $msg = 'Please provide your full name';

        

} else {

 

        $msg = $_FILES['frmfile']['name'].' cannot be uploaded.<br />';

                        if(!$ftype) {

                                $msg .= 'Acceptable file formats are: .gif, .jpg, .png<br />';

                        }

                        if(!$fsize) {

                                $msg .= 'Maximum file size is '.$maxfs;

                        }

 

}

 

}

?>
 
 
 

<div id="memberblock">

<div id="memberleft">

<?php include('control_panel_tools.php'); ?>

</div>

<div id="memberright">

<h1>Upload Images</h1>
 
 
 

<?php if(isset($msg)) { echo '<p class="warning">'.$msg.'</p>'; } ?>
 

<form action="" method="post" enctype="multipart/form-data" name="frm_upload" id="frm_upload">

<input type="hidden" name="frmname" value="<?php echo date("YmdHis") ?>" id="frmname"  />

<input type="hidden" name="propid" value="<?=$propid?>" />

<label >File:</label>

<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo MAX_FILE_SIZE; ?>" />

<input name="frmfile" type="file" id="frmfile" size="30" />

<input type="submit" name="btn" id="btn" value="Upload" />

</form>
 

<?php echo $userid; ?>
 

	</div>

<?php include('footera.php'); ?>

Open in new window

0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 24153186
I am sorry, but I don't have time to write the code for this now.  If time is of the essence you should consider hiring a developer.  It is not hard to do this - just time consuming and tedious to get all the moving parts right.  It could be done in a few hours, assuming there are no other surprises, like you're using GoDaddy or something like that.

You also need to be aware that the sizes and locations information you recently posted here have nothing to do with the original post, which we have answered pretty thoroughly.  You might get a better answer if you post a different question when the subject changes away from the OP.  

One consideration you must address,whether to EE or to your paid developer, is what to do when the "proportional" image is the standard 3x2 aspect ratio of the 35mm camera and most professional DSLRs.  A proportional image will be 600px by 400px, not 700px by 400px.  So some truncation must occur, or some compromises must be made, etc.  It's all part of the design of the application, and it will save you a lot of money if you know that answer before you send the developers into the labs to write the code!

best of luck with it, ~Ray
0
 
LVL 1

Author Closing Comment

by:movieprodw
ID: 31569270
Thanks for the help, I will make another post for the other question
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 24153246
Thanks for the points.  I am sure it will all come together!  best, ~Ray
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now