lokie538 Posted December 21, 2008 Share Posted December 21, 2008 Hi, I had this problem yesterday: http://www.phpfreaks.com/forums/index.php/topic,230891.msg1069963.html#msg1069963 The answer I got solved the problem where it goes back to uploadindex with a problem. Today I turned on my computer and it is accepting png files and not coming up with an error if $_POST['title'] is empty? Any reasons why this wont be working today when It was working last night? This is really annoying. If the code has not been edited it should work the same!! if($_POST['title']=="") { header ( "Location: uploadindex.php?stat=title" ); } $host = "localhost"; $user = $_SESSION['user']; $passwd = $_SESSION['passwd']; $dbname = "1300facepainting"; $painter = $user; $cxn = mysqli_connect($host, $user,$passwd,$dbname) or die ( "Location: error.html" ); $query = "SELECT max(picid) FROM images Limit 0,1"; $result = mysqli_query($cxn,$query) or die ("Couldnt execute queryLOL11111."); $row = mysqli_fetch_assoc($result); $oldname = $row['max(picid)']; $newname = ($oldname+1); // This is the temporary file created by PHP $uploadedfile = $_FILES['uploadfile']['tmp_name']; $uploadedfiletype = $_FILES['uploadfile']['type']; if (!($uploadedfiletype =="image/pjpeg" OR $uploadedfiletype =="image/jpeg" OR $uploadedfiletype =="image/jpg")){ header ( "Location: uploadindex.php?stat=jpg" ); }; Link to comment https://forums.phpfreaks.com/topic/137877-solved-code-problem-was-working-now-isnt/ Share on other sites More sharing options...
redarrow Posted December 21, 2008 Share Posted December 21, 2008 needed a space " " <<<<<<<<< <?php if($_POST['title']==" ") { header ( "Location: uploadindex.php?stat=title" ); } ?> another way <?php if(empty($_POST['title'])) { header ( "Location: uploadindex.php?stat=title" ); } ?> Link to comment https://forums.phpfreaks.com/topic/137877-solved-code-problem-was-working-now-isnt/#findComment-720645 Share on other sites More sharing options...
lokie538 Posted December 22, 2008 Author Share Posted December 22, 2008 Ok cool, i didnt know that you could use empty( Thanks! Im still having problems, where it allows .png to be uploaded tho :'( Link to comment https://forums.phpfreaks.com/topic/137877-solved-code-problem-was-working-now-isnt/#findComment-721183 Share on other sites More sharing options...
lokie538 Posted December 22, 2008 Author Share Posted December 22, 2008 wtf its not allowing my to upload pngs now? This is strange! Link to comment https://forums.phpfreaks.com/topic/137877-solved-code-problem-was-working-now-isnt/#findComment-721292 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.