Location: PHPKode > projects > PortalXP - Teacher Edition > PortalXP/PortalXP/admin/upload.php
<?PHP
 
require('config.php');
require('connect.php');
$teacher_id = $HTTP_POST_VARS["teacher_id"];

$sql2 = "SELECT firstname, lastname FROM teacher where teacher_id = $teacher_id";
$result2 = mysql_query($sql2);	
$myrow2 = mysql_fetch_array($result2);

?>

<TITLE><?php echo $domain ?> - Upload PDF/DOC Files</TITLE>

<?php
if (isset($file1_name) != "") {

        @copy("$file1" , "$uploadpath/$teacher_id-$file1_name")

        or die("Couldn't Upload Your File.");

} else {

$sql = "INSERT INTO downloads (teacher_id,filename) VALUES ('$teacher_id','$filename')";

$result = mysql_query($sql);

die("

<TITLE><?php echo $domain ?> - admin utilities</TITLE>

<HEAD>

<title>Upload Files to Server</title>

Your file has been uploaded to the server. <p>

<center><a href='javascript: self.close()'>Click to Close Window</a></center>

");

}

?>

<TITLE><?php echo $domain ?> - admin utilities</TITLE>

<HEAD>

<title>Upload Files to Server</title>

<? INCLUDE("top-mini.php")?>

<link REL="stylesheet" TYPE="text/css" HREF="../portalxp.css">

<FORM ENCTYPE="multipart/form-data" ACTION="<?php echo $PHP_SELF?>" METHOD="POST">

<P><CENTER><B><FONT FACE="Verdana">Upload</FONT></B></CENTER></P>

<P><CENTER><TABLE WIDTH="450" BORDER="0" CELLSPACING="0" CELLPADDING="0">

  <TR>

    <TD WIDTH="100%" BGCOLOR="#000000">

    <TABLE WIDTH="450" BORDER="0" CELLSPACING="1" CELLPADDING="2">

      <TR>

        <TD COLSPAN="2" BGCOLOR="#295e85">

        <B><FONT COLOR="#ffffff" SIZE="-1" FACE="Verdana">Select Files</FONT></B></TD>

      </TR><?php echo $html; ?>

      <TR>

        <TD COLSPAN="2" BGCOLOR="#295e85">

        <B><FONT COLOR="#ffffff" SIZE="-1" FACE="Verdana">File & Upload Info</FONT></B></TD>

      </TR>
	  
      <TR>

      <TD BGCOLOR="#295e85"><FONT COLOR="#ffffff" SIZE="-1" FACE="Verdana">Teacher ID:</FONT></TD>

      <TD BGCOLOR="#ffffff"><?php echo $teacher_id ?> - <?php echo $myrow2["lastname"] ?>, <?php echo $myrow2["firstname"] ?>

      </TR>

      <TR>

      <TD BGCOLOR="#295e85"><FONT COLOR="#ffffff" SIZE="-1" FACE="Verdana">File Name:</FONT></TD>

      <TD BGCOLOR="#ffffff"><INPUT NAME="filename" TYPE="text" SIZE="39" value="<?php echo "$file1_name"; ?>">

      </TR>

    </TABLE></TD>

  </TR>

</TABLE></CENTER></P>

<input type="Hidden" name="teacher_id" value="<?php echo $teacher_id ?>">
<P><CENTER><INPUT NAME="doupload" TYPE="submit" VALUE="Input Information"></CENTER></FORM>

<H3>File Upload Successful!</H3>

<P>Successfully Sent: <?php echo "$file1_name"; ?> , a <?php echo "$file1_size"; ?> byte file with the extension type of <?php echo "$file1_type"; ?> </P>

<? INCLUDE("bottom.php")?>

</div>
Return current item: PortalXP - Teacher Edition