Before I changed host this script worked fine.
Infact it still works fine on my old host even though its the same script?
I am so confused with this, Please help?
It keeps coming back with the error its not an image file
[PHP]<?php
include ($_SERVER[‘DOCUMENT_ROOT’].’/slorg/header.inc.php’);
$pagetitle = “Upload”;
$helpfaerie = mysql_fetch_array(mysql_query(“SELECT * FROM helpfaerie WHERE page = ‘upload’”));
$helpfaerie2 = mysql_fetch_array(mysql_query(“SELECT * FROM staff WHERE username = ‘$username’”));
if ($helpfaerie2[helpfaerie] == 1)
{
echo "<div id=“helpfaerie” style="overflow: auto; position:fixed; bottom:0; right:0; "><table width=“200” border=“0” cellspacing=“0” cellpadding=“4” style=“border-top: 1pt solid black;border-bottom: 1pt solid black;border-left: 1pt solid black;border-right: 1pt solid black; background-color:#ffffff;”>
$helpfaerie[text]
ECHO <<<END
Upload An Image | |
Name of Graphic: | <input type="text" name="name" |
Filed Under: |
</select"> |
Upload Image: | |
END;
?>[/PHP]
Then the 2nd page
[PHP]<?php
include ($_SERVER[‘DOCUMENT_ROOT’].’/slorg/addon.php’);
include ($_SERVER[‘DOCUMENT_ROOT’].’/dblink.php’);
$pagetitle = “Upload”;
$name = $_POST[‘name’];
$filedunder = $_POST[‘filedunder’];
$filedunder2 = $filedunder.‘img’;
$Image = $_FILES[‘Image’];
$directoryName = “$baseurl/images/$filedunder”;
if (!file_exists($directoryName)) { mkdir($directoryName, 0777); }
$directoryName2 = “$baseurl/images/$filedunder”;
if (!file_exists($directoryName2)) { mkdir($directoryName2, 0777); }
if (!eregi(“image/”, $_FILES[‘Image’][‘type’]))
{
die(header(“Location: $baseurl/slorg/upload.php?error=Please+only+use+image+files.”));
}
if ((!$name) OR (!$filedunder) OR (!$Image))
{
die(header(“Location: $baseurl/slorg/upload.php?error=Please+do+not+leave+any+info+blank.”));
}
else
{
mysql_query(“INSERT INTO $filedunder2 (madeby,name,date,submitted) VALUES (’$username’,’$name’,’$timestamp’,’$username’)”);
$insert_id = mysql_insert_id();
$image = $insert_id . “img.png”;
mysql_query("UPDATE $filedunder2 SET url = ‘$baseurl/images/$filedunder/$image’ WHERE id = ‘$insert_id’ ");
$file = $_FILES[‘Image’][‘tmp_name’];
$dest = $_SERVER[‘DOCUMENT_ROOT’].’/images/’.$filedunder.’/’.$insert_id.‘img.png’;
copy($file, $dest);
header(“Location: upload.php?error=Your+graphic+has+been+added!”);
}
?>
[/PHP]