Jump to content

tfh

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tfh's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Isnt there anyone here that can figure help me figure out what the problem is? It is still ignoring the statement [code]if( $PHOTO_Size == 0) { $photo_upload=FALSE; } [/code] I dont see a problem with it - as I see it - it should skip the TRUE statement if the file = 0 and not die... Please help... Thanks TFH
  2. Wow thanks for the super fast replies!!! Ober - I added the '@' and that fixed the line 91 error, however I still get the error message "Please enter a valid photo (Must be in .jpg or .gif format and less than 100K in size.) " - Question though, what did the @ do to fix the error? Here is how the code looks now [code] //Photo Validation $photo_upload=TRUE; if( $PHOTO_Size == 0) { $photo_upload=FALSE; } if( $PHOTO_Size >100000000) { //delete file @unlink($PHOTO_Temp); die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid photo (Must be in .jpg or .gif format and less than 100K in size.)</font></p>"); } if( $PHOTO_Mime_Type != "image/gif" AND $PHOTO_Mime_Type != "image/pjpeg" AND $PHOTO_Mime_Type != "image/jpeg" ) { @unlink($PHOTO_Temp); die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid photo (Must be in .jpg or .gif format and less than 100K in size.)</font></p>"); } [/code] I am now getting this error [quote]Please enter a valid photo (Must be in .jpg or .gif format and less than 100K in size.) [quote] I get this error if I put in a .jpg or .gif under 100k, and when I leave them blank..... Im sure I said it in the message earlier, but I am wanting the script to skip the upload if there is no image or article.. and of course upload them if they are there and less than 100k for photo and 500k for article... Thanks Again All - I need to know where to donate to this project as well - so much help in such real time! :) Thanks Again!!! TFH
  3. Hi All, Orio has been helping me via PM but it seems we are stuck. I am getting an error on what is line 91 of my script. Line 91 is noted below with "<--- THIS IS LINE 91." Here is the code: [code]//Photo Validation $photo_upload=TRUE; if( $PHOTO_Size == 0) { $photo_upload=FALSE; } if( $PHOTO_Size >100000000) { //delete file unlink($PHOTO_Temp); die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid photo (Must be in .jpg or .gif format and less than 100K in size.)</font></p>"); } if( $PHOTO_Mime_Type != "image/gif" AND $PHOTO_Mime_Type != "image/pjpeg" AND $PHOTO_Mime_Type != "image/jpeg" ) { unlink($PHOTO_Temp);     <------THIS IS LINE 91 WHERE THE ERROR OCCURS*** die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid photo (Must be in .jpg or .gif format and less than 100K in size.)</font></p>"); } [/code] Here is the error I get when trying to run the script from the form -- [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] Warning: unlink(): No such file or directory in /home/server/public_html/folder/FORM.php on line 91 Please enter a valid photo (Must be in .jpg or .gif format and less than 100K in size.) [/quote] Any help would be great! Does the unlink thing even need fixing? TFH
  4. I sent that part of the code to you in a PM - I hope that is ok - now that I did it... I was only able to send the part of code that I need to edit - the pm would not let me send the whole works. ;) Thanks TFH
  5. [!--quoteo(post=379859:date=Jun 4 2006, 07:54 AM:name=Orio)--][div class=\'quotetop\']QUOTE(Orio @ Jun 4 2006, 07:54 AM) [snapback]379859[/snapback][/div][div class=\'quotemain\'][!--quotec--] Well the best way of doing it (in my opinion) is something like this: [code]if($size != 0) { //upload here };[/code] [/quote] Ok so after the IF statement anything inside of { and } is the function, and the ';' means else or next? Thanks!!
  6. Hi All, I am new to PHP and am currently working on a php form. I have had some help creating the form with a php form creation program, however it is not doing everything I require. The form has several text fields, date fields and two upload fields. One upload field is for documents and the other for photos. Each goes to its own folder on the webserver. The upload fields are in the middle of the script, photo first and then the document field. The problem I have is that sometimes there will only be a photo uploaded, other times only a document and then probably more than not neither type of file will be uploaded with the rest of the information. I would like to he able to tell the script If the file size is 0 then goto the next function, not DIE, which is what it does now... I just dont understand the if the else statements enough yet. I have been searching this site, google, and several other sources (even took off to the local book store and read through some books), so I hope someone here can spell it out in english ;) [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /] Can anyone help me out? Here is a sample of the code as it is now - [code]if( $PHOTO_Size == 0) { die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid photo (Must be in .jpg or .gif format and less than 100K in size.)</font></p>"); } if( $PHOTO_Size >100000) [/code] and then later down it shows [code]if( $ARTICLE_Size == 0) { die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid article (must be less than 500K in size)</font></p>"); } if( $ARTICLE_Size >500000) { [/code] Thanks! [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /] TFH
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.