Okay, I have two accounts with this shared web host. I uploaded the same files to both accounts that are exactly the same. Both of the Uploads.php are in the same directory as a folder called 'File'. I can get it to work on my other account but not on this one for some strange reason. I'm curious if it's maybe because the other account has a domain name and this new one is not set up yet? That still doesn't make sense because I don't have the code using the domain name but it's the only thing I can think of.
<?
require("Connect.php");
require("Func.php");
$connectmysql = mysql_connect($host,$user,$password) or die ($cantconnectmysqlmessage);
$db = mysql_select_db($database,$connectmysql) or die ($cantconnectdatabasemessage);
?>
<html><head><title>Uploads Page</title><LINK REL="STYLESHEET" HREF="style.css"></head><body>
<?
function file_delete($file)
{
chmod($file, 0777);
if(unlink($file))
{
return true;
}else{
return false;
}
}
// START REMOVE ACTION
if ((isset($_GET["confirm"])) && ($_GET["confirm"] == "yes"))
{
$DispunlinkQuery = "SELECT * FROM $uploadtable WHERE ID='{$_GET['id']}'";
$DispunlinkResult = mysql_query($DispunlinkQuery) or die(mysql_error().'<br />');
while ($Row = mysql_fetch_assoc($DispunlinkResult))
{$file="../apcnew/Files/" . $Row['DetailedFileName'];
file_delete($file);}
$removequery = "DELETE FROM `$uploadtable` WHERE ID='{$_GET['id']}'";
$removeresult = mysql_query($removequery) or die(mysql_error().'<br />');
}
// END REMOVE ACTION
//if(isset( $Submit ))
if (((isset($_POST["submit"])) && ($_POST["submit"] == "Submit")))
{
// Central Standard Time
$month = date("m");
$day = date("d");
$year = date("Y");
$hour = date("H");
$hour = $hour - 1;
$min = date("i");
$sec = date("s");
$timenow = date("" . $year . "-" . $month . "-" . $day . " " . $hour . ":" . $min . ":" . $sec . "");
// Central Standard Time
if (!($_POST["FileGroup"] <> ""))
{
echo "You must select a FILE GROUP";
echo "<br><br><a href='http://mysite.com/Admin/Upload.php' target='body'>Back</a>";
}
else
if (!($_POST["FileName"] <> ""))
{
echo "You must enter a FILE NAME";
echo "<br><br><a href='http://mysite.com/Admin/Upload.php' target='body'>Back</a>";
}
else
{
//If the Submitbutton was pressed do:
//if ($_FILES['uploadfile']['type'] == "image/gif"){
copy ($_FILES['uploadfile']['tmp_name'], "Files/".$_FILES['uploadfile']['name'])
or die ("Could not copy");
$Size=($_FILES['uploadfile']['size'])/1000000;
$DetailedFileName=$_FILES['uploadfile']['name'];
$FileGroup = $_POST["FileGroup"];
$FileName = addslashes($_POST["FileName"]);
$upload_query = "INSERT INTO $uploadtable
(TimeStamp, FileGroup, FileName, DetailedFileName)
VALUES
('$timenow', '$FileGroup', '$FileName', '$DetailedFileName')";
if (!($upload_result = mysql_query($upload_query)))
{
$mcrmessage = mysql_error();
echo "$mcrmessage<br>";
die();
}
ELSE
{
$Page=$_SERVER["PHP_SELF"];
Transition($Page);
}
}
}
else
{
//If the Submitbutton was not pressed do:
echo "<form name='form1' method='post' action='".$_SERVER["PHP_SELF"]."' enctype='multipart/form-data'>";
echo "<br><select name='FileGroup'><Option Value=''>----------<Option Value='FORM'>FORM<Option Value='MANUAL'>MANUAL</select> FILE GROUP";
echo "<br><input type='text' name='FileName'> FILE NAME";
echo "<br><input type='file' name='uploadfile'>";
echo "<br>";
echo "<input type='submit' name='submit' value='Submit'><Br><br>";
// START DISPLAY EVERYTHING QUERY
$DispQuery = "SELECT * FROM $uploadtable ORDER BY FileName ASC";
$DispResult = mysql_query($DispQuery) or die(mysql_error().'<br />');
while ($Row = mysql_fetch_assoc($DispResult))
{
$editlink = '<a href="UploadEdit.php?mode=edit&id='.$Row['ID'].'">Edit Link Name</a>';
$removefile = '<a href="UploadDelete.php?mode=removefile&id='.$Row['ID'].'">Remove File</a>';
?>
<table width="600" cellpadding="0" cellspacing="0" border="0" bordercolor="#000000">
<tr>
<td colspan="4" width="100%"><hr></td>
</tr><tr>
<td width="40%"><a href="../apcnew/Files/<?echo $Row["DetailedFileName"];?>" target="_Blank"><?echo stripslashes($Row["FileName"]);?></a></td><td width="15%"><p align=center><?echo $Row["FileGroup"];?></td><td width="15%"><p align=center><?echo $removefile;?></td><td width="20%"><p align=center><?echo $editlink;?></td>
</tr><tr>
<td colspan="3" width="100%"><?echo $Row["DetailedFileName"];?></td>
</tr>
</table>
<?
}
// END DISPLAY EVERYTHING QUERY
}
?>
</form>
</body>
</html>