PHP - Upload Trips The Exceed Max_file_size Error When It Shouldn't
I'm working on a fairly straight forward facet of an image gallery application where the client can upload a zip file full of photos and it extracts them one by one to a temp folder, resizes it and moves it to the pic folder, creates a thumbnail, then deletes it from the temp folder
All that works fine, but I'm testing it in a situation where I'm uploading a 56 MB zip file, my max_file_size is 128 MB, and it gives me the 'max_file_size' error. Anyone else ever have this problem or have any ideas on how to solve it? Similar Tutorialsfiles that upload during insert/submit form was gone , only files upload during the update remain , is the way query for update multiple files is wrong ? $targetDir1= "folder/pda-semakan/ic/"; if(isset($_FILES['ic'])){ $fileName1 = $_FILES['ic']['name']; $targetFilePath1 = $targetDir1 . $fileName1; //$main_tmp2 = $_FILES['ic']['tmp_name']; $move2 =move_uploaded_file($_FILES["ic"]["tmp_name"], $targetFilePath1); } $targetDir2= "folder/pda-semakan/sijil_lahir/"; if(isset($_FILES['sijilkelahiran'])){ $fileName2 = $_FILES['sijilkelahiran']['name']; $targetFilePath2 = $targetDir2 . $fileName2; $move3 =move_uploaded_file($_FILES["sijilkelahiran"]["tmp_name"], $targetFilePath2); } $targetDir3= "folder/pda-semakan/sijil_spm/"; if(isset($_FILES['sijilspm'])){ $fileName3 = $_FILES['sijilspm']['name']; $targetFilePath3 = $targetDir3 . $fileName3; $move4 =move_uploaded_file($_FILES["sijilspm"]["tmp_name"], $targetFilePath3); } $query1=("UPDATE semakan_dokumen set student_id='$noMatrik', email= '$stdEmail', surat_tawaran='$fileName', ic='$fileName1',sijil_lahir='$fileName2',sijil_spm= '$fileName3' where email= '$stdEmail'");
I got 30 files to convert to png each in a dir containing 5 files I get the maximum execution time when i run the following code: Code: [Select] $dir = glob("images/*/*.png"); foreach($dir as $file) { $filename = $file; $files = getimagesize($filename); $img = imagecreatefrompng($filename); imagepng($img,$filename); } I was wondering if there was a way to have the MAX function NOT return a Date that is more than 2 days into the future (from the current day)? If there is a Date that is more than 2 days into the future I would like to return the one closest to the current day. Here is the code I have: Code: [Select] <?php mysql_connect("local", "xxx", "xxx") or die(mysql_error()); mysql_select_db("pricelink") or die(mysql_error()); // Get a specific result from the "ft9_fuel_tax_price_lines" table $query ="SELECT ItemNumber,TableCode,Cost, MAX(`Date`) as `max_date`, MAX(`Time`) as 'max_time' FROM `ft9_fuel_tax_price_lines` GROUP BY `ItemNumber`,`TableCode`"; $result = mysql_query($query) or die(mysql_error()); echo "<table border='1'>"; echo "<tr> <th>ItemNumber</th> <th>TableCode</th> <th>Date</th> <th>Time</th> <th>Cost</th> </tr>"; // keeps getting the next row until there are no more to get while($row=mysql_fetch_array($result)) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['ItemNumber']; echo "</td><td>"; echo $row['TableCode']; echo "</td><td>"; echo $row['max_date']; echo "</td><td>"; echo $row['max_time']; echo "</td><td>"; echo $row['Cost']; echo "</td></tr>"; } echo "</table>"; ?> Any help would be appreciated. Thanks! Hi Guys What code would you use to check that a form field does not exceed 100 characters? Thanks for any help. Why does it give me the "There was an error uploading the file, please try again!" error message? I've checked through the code, and I've looked to see what is wrong. I'm thinking it MIGHT be because of: $target_path = $target_path . $output; if(pathinfo(basename($_FILES['file']['name']), PATHINFO_EXTENSION)=="zip") { if(move_uploaded_file($output, $target_path)) { But, heres the full code: <?php session_start(); include("includes/mysql.php"); include("includes/config.php"); ?> <title><?php echo $title; ?></title> <?php if(!$_SESSION['user']) { echo "Your not allowed to upload plugins! <a href='index.php'>Go Home</a> or <a href='register.php'>Make an account</a>."; } else { echo "<a href='start_upload.php'>Upload</a> | <a href='search.php'>Search & Browse</a> | <a href='/news'>News & Announcements</a> | <a href='logout.php'>Logout</a><hr>"; $description = $_POST['description']; $description = mysql_real_escape_string($description); $ip = $_SERVER['REMOTE_ADDR']; $date = date('m-d-y'); $title = $_POST['title']; $title = mysql_real_escape_string($title); $user = $_SESSION['SESSION']; $target_path = "mods/"; $query = mysql_query("SELECT COUNT(id) FROM mods"); $finish_query = mysql_fetch_assoc($query); $output = $finish_query['COUNT(id)'] + 1; $target_path = $target_path . $output; if(pathinfo(basename($_FILES['file']['name']), PATHINFO_EXTENSION)=="zip") { if(move_uploaded_file($output, $target_path)) { echo "The mod ". basename($_FILES['file']['name']) . " has been uploaded. Check it out <a href='mods/". $output ."'>HERE.</a>"; mysql_query("INSERT INTO mods VALUES('', '$ip', '$date', '$title', '$description', '$user')"); } else{ echo "There was an error uploading the file, please try again!"; } } else { echo "You cannot use a .". pathinfo(basename($_FILES['file']['name']), PATHINFO_EXTENSION) ." extension! .zip is currently the only file extension allowed."; } } include("includes/footer.php"); ?> i have this in my php.ini Quote ;;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. ; http://php.net/file-uploads file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). ; http://php.net/upload-tmp-dir upload_tmp_dir = "c:/wamp/tmp" ; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize upload_max_filesize = 32M but when i upload i get error # 1 which is The uploaded file exceeds the upload_max_filesize directive in php.ini what am i doing wrong? <body> <form enctype="multipart/form-data" action="uploadfile.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="10485760" /> Choose a file to upload: <input name="file" type="file" /><br /> <input type="submit" value="Upload File" /> </form> </body> <?php include 'db_fns.php'; function RemoveExtension($strName) { $ext = strrchr($strName, '.'); if($ext !== false) { $strName = substr($strName, 0, -strlen($ext)); } return $strName; } $name = $_FILES["file"]['name']; $type = $_FILES["file"]['type']; $error = $_FILES["file"]['error']; $size = $_FILES["file"]['size']; $tmp = $_FILES["file"]["tmp_name"]; $date = date("Y-m-d"); echo $_FILES["file"]['error']; if($type == 'audio/mpeg' || $type == ' audio/mp3'){ $song_name = RemoveExtension($name); $query = "INSERT into uploads(song_name, created_at) VALUES ('$song_name', '$date')"; $result = mysqli_query($link, $query); $id = mysqli_insert_id($link); move_uploaded_file($tmp, "uploads/" . $id . ".mp3"); echo "your link is <a href='play.php?id=$id'> here</a>"; }else{ echo 'File must be in mp3 format'; } ?> This is my first time ever working with this type of stuff with PHP. So, I basically got this code from a tutorial at Tizag on how to upload files to your webiste. But everytime I do, I get an error message. I don't get a PHP error, I just get it from the code. "There was an error uploading the file, please try again!" <?php session_start(); include("includes/mysql.php"); include("includes/config.php"); ?> <title><?php echo $title; ?></title> <?php if(!$_SESSION['user']) { echo "Your not allowed to upload plugins! <a href='index.php'>Go Home</a> or <a href='register.php'>Make an account</a>."; } else { $description = $_POST['description']; $description = mysql_real_escape_string($description); $ip = $_SERVER['REMOTE_ADDR']; $date = date('m-d-y'); $title = $_POST['title']; $title = mysql_real_escape_string($title); $query = mysql_query("SELECT COUNT(id) FROM mods"); $finish_query = mysql_fetch_assoc($query); $output = $finish_query['COUNT(id)'] + 1; echo $output; $_FILES['uploadedfile']['name'] = $output; echo $_FILES['uploadfile']['name']; $target_path = "mods/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The mod ". basename( $_FILES['uploadedfile']['name']). " has been uploaded. Check it out HERE."; mysql_query("INSERT INTO mods VALUES('', '$ip', '$date', '$title', '$description', '$user')"); } else{ echo "There was an error uploading the file, please try again!"; } } include("includes/footer.php"); ?> hi, i am trying to code a file uploader in php using IIS server this is the code of the form: <html><body> <form method="post" enctype="multipart/form-data" action="processform.php"> <input type="hidden" name="MAX_FILE_SIZE" value="200000"> <input type="file" name="thefile"><br/> <input type="submit" value="Submit File...."> </form> </body></html> this is the code of processform.php <?php $upload_dir = "C:/Inetpub/wwwroot/cbt/upload/"; $upload_file = $upload_dir . basename($_FILES['thefile']['name']); if(copy($_FILE['thefile']['tmp_name'],$upload_file)){ echo "File copy was Successful!"; } else { echo "Oops... something went wrong..."; print_r($_FILES); } ?> now the problem is each time i try to click on the submit button after browsing any file it shows the message : Oops... something went wrong...Array ( [thefile] => Array ( [name] => 1.jpeg [type] => image/jpeg [tmp_name] => C:\temps\php13.tmp [error] => 0 [size] => 59592 ) ) help me guys...... wats the problem with the code ? Hi want to upload file using form's input type="file" then i want to display it on another page, As i am new to PHP i am doing this step by step so that I can test each step and go ahead. My first step is to upload file and check if its uploading in temp location.. I got same code from net.. I am using notepad++ thats why not sure abt syntax error, What I did is: <html> <body> <form action="index.php" method="POST" enctype="multipart/form-data"> Image: <input type="file" name="image"> <input type="submit" value="Upload"> </form> <?php mysql_connection("localhost","root","admin") or die(mysql_error()); mysql_select_db("searchdeals") or die(mysql_error()); echo $file = $_FILES['image']['tmp_name']; ?> </body> </html> Hi all, I'm using some code that I got from the net (I forget where but all credit to the author). I've tried to adapt it to suit my own needs (almost suceeded?). I have an upload page with 5 file uploads which is processed by this script: (I've annotated where I think the problems may be) UPLOAD FORM <table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#993399"> <tr> <form action="../uploads/upload2.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#993399"> <tr> <td><div align="center"><strong><h3>Upload your files</h3></strong></div></td> </tr> <tr> <td align="center">Select file <input name="ufile[]" type="file" id="ufile[]" size="50" /></td> </tr> <tr> <td align="center">Select file <input name="ufile[]" type="file" id="ufile[]" size="50" /></td> </tr> <tr> <td align="center">Select file <input name="ufile[]" type="file" id="ufile[]" size="50" /></td> </tr> <tr> <td align="center">Select file <input name="ufile[]" type="file" id="ufile[]" size="50" /></td> </tr> <tr> <td align="center">Select file <input name="ufile[]" type="file" id="ufile[]" size="50" /></td> </tr> <tr> <td align="center"><input type="submit" name="Submit" value="Upload" /></td> </tr> </table> </td> </form> </tr> </table> Here is "uploads.php" <?php $path1= "../uploads/".$HTTP_POST_FILES['ufile']['name'][0]; $path2= "../uploads/".$HTTP_POST_FILES['ufile']['name'][1]; $path3= "../uploads/".$HTTP_POST_FILES['ufile']['name'][2]; $path4= "../uploads/".$HTTP_POST_FILES['ufile']['name'][3]; $path5= "../uploads/".$HTTP_POST_FILES['ufile']['name'][4]; copy($HTTP_POST_FILES['ufile']['tmp_name'][0], $path1); copy($HTTP_POST_FILES['ufile']['tmp_name'][1], $path2); copy($HTTP_POST_FILES['ufile']['tmp_name'][2], $path3); copy($HTTP_POST_FILES['ufile']['tmp_name'][3], $path4); copy($HTTP_POST_FILES['ufile']['tmp_name'][4], $path5); include '../includes/smile.php'; echo "<table width=\"900\"height=\"180\"cellpadding=\"5\" cellspacing=\"5\" background=\"../images/upbg.png\" align=\"center\"> <tr><td align=center><img src=\"$path1\" width=\"100\" height=\"100\"></td>"; echo "<td align=center><img src=\"$path2\" width=\"100\" height=\"100\"></td>"; echo "<td align=center><img src=\"$path3\" width=\"100\" height=\"100\"></td>"; echo "<td align=center><img src=\"$path4\" width=\"100\" height=\"100\"></td>"; echo "<td align=center><img src=\"$path5\" width=\"100\" height=\"100\"></td></tr></table>"; $filesize1=$HTTP_POST_FILES['ufile']['size'][0]; $filesize2=$HTTP_POST_FILES['ufile']['size'][1]; $filesize3=$HTTP_POST_FILES['ufile']['size'][2]; $filesize4=$HTTP_POST_FILES['ufile']['size'][3]; $filesize5=$HTTP_POST_FILES['ufile']['size'][4]; if($filesize1 && $filesize2 && $filesize3 && $filesize4 && $filesize5 !=0) // possible error? { echo "<h3 align=center><img src=\"../images/niceone.png\"></h3>"; include '../includes/smilefoot.php'; } else { echo "<meta http-equiv='Refresh' content='0; url=../includes/fail.php'>"; // possible error? } ?> It took me an entire day to get it at this level of functionality where if you sucessfully upload your files you get a success message on the same page but otherwise are redirected to a failure page. The problem is, if you don't upload a file for each of the 5 form inputs, you get the succes message and then redirected to the fail page. Someone who actually knows something about php will probably see a solution straight away but I don't know anything much really and I have few ideas on how to fix this. I am beginning to suspect that it is my redirect method but I have no idea how to do it differently. I'd be really grateful if someone could explain what I'm doing wrong here, this is for my personal family site and I want it to be good. It took me a week to do the login! What I'd love to achieve is exactly the same as the attachment box(es) right below where I am typing now. I have attached my two relavent pages. Thanks in advance. Paul [attachment deleted by admin] Hello, i'm trying to upload a file through a page, on a local wamp server. Here's the code i'm using: Code: [Select] <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="Upload" /> </form>This is the form i'm using to pass my file Code: [Select] <?php if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Stored in: " . $_FILES["file"]["tmp_name"] . "<br />"; if (move_uploaded_file($_FILES["file"]["tmp_name"], $_SERVER['DOCUMENT_ROOT']. "/template_example/slideshow/images/" . $_FILES["file"]["name"])) { echo "Stored in: " . $_SERVER['DOCUMENT_ROOT'] . "localhost/template_example/slideshow/images/" . $_FILES["file"]["name"]; } } ?> The problem comes up if i try to upload an image file of size 1,07 MB. upload_max_filesize on my php.ini is at 2M. I also tried changing it to 2000M just to see if thats the problem. The error code i'm getting is 2 which means: Value: "2; The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form." from what i got on the internet. My operating system is windows XP SP2 and i have wamp server installed. Please help! I am trying to uploading images when i submit the images i get an error Code: [Select] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 6 How do i fix this my code is below. Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>upload</title> </head> <body> <?php //connect to MySQL $db = mysql_connect('localhost', 'user', 'pass') or die ('Unable to connect. Check your connection parameters.'); mysql_select_db('testdb', $db) or die(mysql_error($db)); //change this path to match your images directory $dir ='productimages'; //change this path to match your thumbnail directory $thumbdir = $dir . 'productthumb'; //change this path to match your fonts directory and the desired font putenv('GDFONTPATH=' . 'C:/Windows/Fonts'); $font = 'arial'; // handle the uploaded image if ($_POST['submit'] == 'Upload') { //make sure the uploaded file transfer was successful if ($_FILES['uploadfile']['error'] != UPLOAD_ERR_OK) { switch ($_FILES['uploadfile']['error']) { case UPLOAD_ERR_INI_SIZE: die('The uploaded file exceeds the upload_max_filesize directive ' . 'in php.ini.'); break; case UPLOAD_ERR_FORM_SIZE: die('The uploaded file exceeds the MAX_FILE_SIZE directive that ' . 'was specified in the HTML form.'); break; case UPLOAD_ERR_PARTIAL: die('The uploaded file was only partially uploaded.'); break; case UPLOAD_ERR_NO_FILE: die('No file was uploaded.'); break; case UPLOAD_ERR_NO_TMP_DIR: die('The server is missing a temporary folder.'); break; case UPLOAD_ERR_CANT_WRITE: die('The server failed to write the uploaded file to disk.'); break; case UPLOAD_ERR_EXTENSION: die('File upload stopped by extension.'); break; } } Hi. I have the following code: <?php $host=""; $username=""; $password=""; $db_name=""; $tbl_name="topic"; // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $name=$_POST['name']; $detail=$_POST['details']; $sql="INSERT INTO $tbl_name(topic, detail, datetime)VALUES('$name', '$detail', NOW())"; $result=mysql_query($sql); if($result){ echo("Topic created. "); $sql3="SELECT max(id) FROM $tbl_name"; $result3=mysql_query($sql3); $tbl_name2="top_img"; for($i=1; $i<11; $i++){ $uploaddir = '/imgs/'; $uploadfile = $uploaddir . basename($_FILES['img'.$i]['name']); echo '<pre>'; if (move_uploaded_file($_FILES['img'.$i]['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } }} echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; echo("<br><br><a href='site.html'>HOME</a>"); ?> And the error message: Quote Topic created. PHP Error Message Warning: move_uploaded_file(/imgs/Sunset.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/a7129718/public_html/test/add_topic.php on line 28 PHP Error Message Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php73HyFd' to '/imgs/Sunset.jpg' in /home/a7129718/public_html/test/add_topic.php on line 28 Free Web Hosting Possible file upload attack! Possible file upload attack! Possible file upload attack! Possible file upload attack! Possible file upload attack! Possible file upload attack! Possible file upload attack! Possible file upload attack! Possible file upload attack! Possible file upload attack! Here is some more debugging info:Array ( [img1] => Array ( [name] => Sunset.jpg [type] => image/jpeg [tmp_name] => /tmp/php73HyFd [error] => 0 [size] => 71189 ) [img2] => Array ( [name] => [type] => [tmp_name] => [error] => 4 [size] => 0 bla bla bla Any idea what the problem might be? Thanks in advance. Bye. Can anyone help me to fix this two error?
#upload directory path mysqli_select_db($conn, "test2") or die(mysql_error()); Thank you !
Hi Guys, What I am doing is making a backup of a folder by zipping it on a server which is outside of web root, downloading a local copy to a web accessible place and then uploading the zip file back to the non web folder. I am using phpseclib's sftp to achieve this. The error I have is that when the file is uploaded to the non web area, the file is 0 bytes and cannot be used, the copy stored on the web accesible area is fine? The code I am using: Code: [Select] <?php if(isset($_GET['backup'])) { $worldname = $_GET['backup']; //checks to see if upload if(!is_dir("backups")) //create backup directory if not exist { mkdir("backups", 0777); } mkdir("backups/".$worldname, 0777); //make filename directory $main_dest = "backups/".$worldname.""; //set backup destination $delpath = "backups/"; //path which will be deleted later $sftp = new Net_SFTP($host); $sftp->login($root_user, $root_pass); //login to sftp $get = "/root/minecraft/".$worldname."/"; //get correct directory for backup get_folder($sftp, $get, $main_dest ); //execute command Zip('backups/'.$worldname.'','backups/'.$worldname.''.date("dmy-H:i").'.zip'); //make zip of folder $sftp->put('/root/minecraft/backups/'.$worldname.''.date("dmy-H:i").'.zip','backups/'.$worldname.' '.date("dmy-H:i").'.zip',NET_SFTP_LOCAL_FILE); //put zip file from web folder to root/backup folder rrmdir($delpath); //delete old folder (function below) //unlink('backups/'.$worldname.''.date("dmy-H:i").'.zip'); deletes web copy header('Location: index.php'); } The line which is causing the issue is: Quote $sftp->put('/root/minecraft/backups/'.$worldname.''.date("dmy-H:i").'.zip','backups/'.$worldname.' '.date("dmy-H:i").'.zip',NET_SFTP_LOCAL_FILE); The function is basically $remotefile, $data, $mode Can anyone take a guess at what is causing the issue? PHP max upload size is 200mb, the files are around 5mb, the timeout is 360 seconds? Cheers Dave[/code] Need some help with this script. I'm looking to limit the type of file you can upload to my server the script uploads ok but i when i try t view the uploaded file but i get an error cant find file extension for this file what am i doing wrong as i'm very new to php . Thank for your help in advance Code: [Select] <?php $allowedExtensions = array("jpg","jpeg","gif","png","bmp"); foreach ($_FILES as $image) { if ($image['tmp_name'] > '') { if (!in_array(end(explode(".", strtolower($image['name']))), $allowedExtensions)) { die($image['name'].' is an invalid file type!<br/>'. '<a href="javascript:history.go(-1);">'. '<< Go Back</a>'); } } } $target = "testimages/"; $target = $target . basename( $_FILES['image']['name']); // $company=$_POST['company']; $image=($_FILES['image']['name']); mysql_connect("localhost", "user", "pass") or die(mysql_error()) ; mysql_select_db("testupload") or die(mysql_error()) ; mysql_query("INSERT INTO `table` (company, image) VALUES ('$company', '$image')") ; if(move_uploaded_file($_FILES['image']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory"; } else { echo "Sorry, there was a problem uploading your file."; } ?> Hi I have an upload script which uploads an image then resizes The error Code: [Select] Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 7776 bytes) in Dir/UploadScript.php on line 234 The code function $strNewFileName = date("YmdHis").rand(0,5000).".".$this->strFileExt; $this->strNewFileName = $strNewFileName; $strDir = $_SERVER['DOCUMENT_ROOT'].$this->strSaveDir.$strNewFileName; $strTNDir = $_SERVER['DOCUMENT_ROOT'].$this->strSaveDir."tn_".$strNewFileName; move_uploaded_file($this->arrUploadFile['tmp_name'], $strDir); $image_p = imagecreatetruecolor($this->intNewWidth, $this->intNewHeight); switch($this->strFileExt){ case "jpg": $image = imagecreatefromjpeg($strDir); break; case "gif": $image = imagecreatefromgif($strDir); break; case "png": $image = imagecreatefrompng($strDir); break; } imagecopyresampled($image_p, $image, 0, 0, 0, 0, $this->intNewWidth, $this->intNewHeight, $this->intCurWidth, $this->intCurHeight); $blnSuccessUpload = false; switch($this->strFileExt){ case "jpg": if(imagejpeg($image_p, $strTNDir)){ $blnSuccessUpload = true; } break; case "gif": if(imagegif($image_p, $strTNDir)){ $blnSuccessUpload = true; } break; case "png": if(imagepng($image_p, $strTNDir)){ $blnSuccessUpload = true; } } imagedestroy($image_p); return $blnSuccessUpload; the Line causing issues (234) is Code: [Select] $image = imagecreatefromjpeg($strDir); Now that image is created but the TN is not //Edit Just a note. I have ini_set('memory_limit', 16MB); if you notice the allocated memory is less than the memory allowed. Ok all I need some help with this. I have been stuck for two days. Basically I have a form that asks a registrant their gender and age, then my script spits out a list of race categories they qualify for. The situation calls for the registrant to be able to register for any category YOUNGER than them, but not older. Screen Shot #1 shows my database setup (this can be changed if you have any better ideas...) that holds the race category information. Here is the sql statement I am using to pull a female racer information, where $race_age is their submitted age. "SELECT * from counts where female=1 and $race_age < age_end and $race_age > age_start" This works, but doesn't pull any categories YOUNGER Than their age. I'm stumpped Thanks for any help in advance. |