Jump to content

[SOLVED] Code problem - Was working, now isnt?


lokie538

Recommended Posts

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" ); };

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.