Julian Posted September 21, 2006 Share Posted September 21, 2006 Hi guys...I have this script that checks for an image. But if the image is there I want the script to continue with the rest keeping the image already uploaded. Can anyboy help me with this.... Here's code:if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")){ $file_type = $_FILES['imgfile']['type']; $file_name = $_FILES['imgfile']['name']; $file_size = $_FILES['imgfile']['size']; $file_tmp = $_FILES['imgfile']['tmp_name']; if(!is_uploaded_file($file_tmp)){ exit(); //I don't want to exit but continue with the rest of the scrip just don't execute what's related to the image. } $getExt = explode ('.', $file_name); $file_ext = $getExt[count($getExt)-1]; bla,bla,bla..... etc....... I want the script continues here: $insertSQL = sprintf("UPDATE.......Really appreciated your help..... Alaways the best. Quote Link to comment Share on other sites More sharing options...
paul2463 Posted September 21, 2006 Share Posted September 21, 2006 if you do not want to carry out any action if the "if" statement is true the put nothing there i.e[code]if ( the file is uploaded) {} else {do something}[/code]or a better way to do it is to reverse the if statement so you only carry out something if it is true i.e[code]if ( the file is not uploaded) {do this}[/code]you do not need an else statement at all then and it will carry on with the rest of the code.hope that helps Quote Link to comment Share on other sites More sharing options...
Julian Posted September 21, 2006 Author Share Posted September 21, 2006 Worked just fine... Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.