well I give up....... been all day trying to make this work out......... it's a simple upload function............. when I upload the file it goes runs the DIE function......... no idea why..... I've tried everything ......thanks in advance.....
oh when I run the is_uploaded function it executes the else "echo "All is ok so far ......<br><br>";......... so at that point it seems everything is fine.......
even ran a bunch of echoes to see if there was a problem...... folder is 777 btw.....
thanks in advance
<?
//phpinfo();
echo getcwd();
if (!$question || !$answer)
{
echo "Fill all fields";
echo "<a href='creategallery.php'>Go back</a>";
}
$db = @mysql_pconnect("localhost", "login", "password");
if (!$db)
{
echo "Error";
exit;
}
if (mysql_select_db("database_com"))
{
echo "<font face=Arial, Helvetica, sans-serif size=2>Connection successful </font><br><br>";
}
$sql = "insert into test_questions (question, answer, imagefile) values ('$question', '$answer', '$filename')";
$estado = mysql_query($sql, $db);
$qry = mysql_fetch_array($estado);
if (!$estado)
{
print "Problem while executing .......<PRE>$sql</PRE>";
print mysql_error();
exit;
}
echo "<br><br>".$filename;
echo "<br><br>".$question."<br><br>";
if (!is_uploaded_file($filename))
{
echo "Problem uploading the file";
} else {
echo "All is ok so far ......<br><br>";
}
if ($poster_name != "")
{
move_uploaded_file("$filename", "/store/home/site/html/qa/$poster_name") or die("Couldn't Upload Your File.");
} else {
die("YOU HAVEN'T UPLOADED ANYTHING!");
}
if (!$total)
{
$total = mysql_insert_id();
$sql = "update test_questions set imagefile = '$poster_name' where id = $total";
$result = mysql_query($sql,$conn);
echo $qry[question];
echo "<center><font face='arial' size='2'><b>Cool addition man !</b></font></center><br><br><br>";
echo "<center><font face='arial' size='2'><b><a href='add.html'>Add another question</a></b></font></center><br>";
}
?>