Jump to content

Help


mlahatte

Recommended Posts

I'm not good at php at all. I am helping a friend with his website. His old website was done years ago in php. He has the website set up where his secretary can login to an admin page and upload .mp3's of audio's and they will be displayed on an audio download page for people to download them. However the system stopped working for them. I updated his main page and did it all in flash. I wanted to retain the old php pages where the secretary can still upload mp3's and have php auto update the download page with them. But I'm unable to get the old php back working. I keep getting the error "Column 'file' cannot be null"

Here is the code:

 

<?php require_once('../Connections/dl.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}

$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
  $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}

if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO audios (title, author, description, file) VALUES (%s, %s, %s, %s)",
                       GetSQLValueString($HTTP_POST_VARS['title'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['author'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['description'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['file'], "text"));

  mysql_select_db($database_dl, $dl);
  $Result1 = mysql_query($insertSQL, $dl) or die(mysql_error());

  $insertGoTo = "index.php";
  if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
  }
  chmod("../update/uploads/" . $HTTP_POST_VARS['file'], 0777);
  copy("../update/uploads/" . $HTTP_POST_VARS['file'],"../update/audiorams/" . $HTTP_POST_VARS['file']);
  chmod("../update/audiorams/" . $HTTP_POST_VARS['file'], 0644);
  unlink("../update/uploads/" . $HTTP_POST_VARS['file']);
  header(sprintf("Location: %s", $insertGoTo));
}


if ($HTTP_COOKIE_VARS['dl'] == 1)
{
}
else
{
header('Location: index.php');
}
include('../inc/dbcodes.php');

// Connect to MySQL
if (! mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS))
{
die('Failed to connect to host, please try later.');
}
else
{
// Connect to DB
mysql_select_db(MYSQL_DB);
?>
<html>
<head>
<title>Landrum International</title>
<meta http-equiv="Content-Type" content="text/html;">
<!-- Fireworks MX Dreamweaver MX target.  Created Wed Jul 26 03:02:29 GMT-0500 (Central Daylight Time) 2006-->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<style type="text/css">
<!--
.style1 {
font-size: 36px;
font-weight: bold;
}
-->
</style>
</head>
<body bgcolor="#ffffff">
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="800">
<!-- fwtable fwsrc="blue&white.png" fwbase="index2.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
  <tr>
   <td><img src="../image/spacer.gif" width="8" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="12" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="15" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="564" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="12" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="15" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="1" height="1" border="0" alt=""></td>
  </tr>

  <tr>
   <td colspan="6" bgcolor="#ffffff"><img src="../image/spacer.gif" width="800" height="6" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="1" height="6" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="21" bgcolor="#ffffff"><img src="../image/spacer.gif" width="8" height="594" border="0" alt=""></td>
   <td colspan="4"><div align="center" class="style1">Admin Audio Upload Page</div></td>
   <td rowspan="21" bgcolor="#ffffff"><img src="../image/spacer.gif" width="15" height="594" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="1" height="180" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="18" valign="top"> </td>
   <td colspan="3" rowspan="20" valign="top"> 
   

<table width="392" border="2" align="center" cellpadding="10" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF">
        <tr align="center" valign="middle">
          <td align="center" valign="middle"><div align="center">
            <p><strong>New Audio</strong>        </p>
	      
            
            <form action="<?php echo $editFormAction; ?>" method="post" enctype="multipart/form-data" name="form1">
              <table align="center">
                <tr valign="baseline">
                  <td nowrap align="right">Title:</td>
                  <td><input type="text" name="title" value="" size="32">                  </td>
                </tr>
                <tr valign="baseline">
                  <td nowrap align="right">Author:</td>
                  <td><input type="text" name="author" value="" size="32">                  </td>
                </tr>
                <tr valign="baseline">
                  <td nowrap align="right">Description:</td>
                  <td><input type="text" name="description" value="" size="32">                  </td>
                </tr>
                <tr valign="baseline">
                  <td nowrap align="right">Audio File:</td>
                  <td>
			  <?php
$dir = "../update/uploads";
$dh  = opendir($dir);
while (false !== ($filename = readdir($dh))) {
   $files[] = $filename;
}

sort($files);
$num_files = count($files);

?>
			  <label>
			  <input type="file" name="fileField" id="fileField">
			  </label></td>
                </tr>
                <tr valign="baseline">
                  <td nowrap align="right"> </td>
                  <td><input type="submit" value="Insert Record">                  </td>
                </tr>
              </table>
              <input type="hidden" name="MM_insert" value="form1">
            </form>
            <p> </p>
          </div>          </td>
        </tr>
      </table>

     
    </div></td>
   <td><img src="../image/spacer.gif" width="1" height="35" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="19" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="16" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="11" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="24" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="12" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="23" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="31" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="3" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="1" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="23" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="11" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="25" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="28" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="26" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="3" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="24" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="11" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="2" bgcolor="#ffffff"> </td>
   <td><img src="../image/spacer.gif" width="1" height="25" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="63" border="0" alt=""></td>
  </tr>
</table>
</body>
</html>
<?php
}
?>

Link to comment
Share on other sites

K, I replaced all that and now I get the error: Unknown column 'fileField' in 'field list'

 

Here is the new code:

 

<?php require_once('../Connections/dl.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}

$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
  $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO audios (title, author, description, fileField) VALUES (%s, %s, %s, %s)",
                       GetSQLValueString($_POST['title'], "text"),
                       GetSQLValueString($_POST['author'], "text"),
                       GetSQLValueString($_POST['description'], "text"),
                       GetSQLValueString($_POST['fileField'], "text"));

  mysql_select_db($database_dl, $dl);
  $Result1 = mysql_query($insertSQL, $dl) or die(mysql_error());

  $insertGoTo = "index.php";
  if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
  }
  chmod("../update/uploads/" . $_POST['file'], 0777);
  copy("../update/uploads/" . $_POST['file'],"../update/audiorams/" . $_POST['file']);
  chmod("../update/audiorams/" . $_POST['file'], 0644);
  unlink("../update/uploads/" . $_POST['file']);
  header(sprintf("Location: %s", $insertGoTo));
}


if ($_COOKIE['dl'] == 1)
{
}
else
{
header('Location: index.php');
}
include('../inc/dbcodes.php');

// Connect to MySQL
if (! mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS))
{
die('Failed to connect to host, please try later.');
}
else
{
// Connect to DB
mysql_select_db(MYSQL_DB);
?>
<html>
<head>
<title>Landrum International</title>
<meta http-equiv="Content-Type" content="text/html;">
<!-- Fireworks MX Dreamweaver MX target.  Created Wed Jul 26 03:02:29 GMT-0500 (Central Daylight Time) 2006-->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<style type="text/css">
<!--
.style1 {
font-size: 36px;
font-weight: bold;
}
-->
</style>
</head>
<body bgcolor="#ffffff">
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="800">
<!-- fwtable fwsrc="blue&white.png" fwbase="index2.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
  <tr>
   <td><img src="../image/spacer.gif" width="8" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="12" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="15" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="564" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="12" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="15" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="1" height="1" border="0" alt=""></td>
  </tr>

  <tr>
   <td colspan="6" bgcolor="#ffffff"><img src="../image/spacer.gif" width="800" height="6" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="1" height="6" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="21" bgcolor="#ffffff"><img src="../image/spacer.gif" width="8" height="594" border="0" alt=""></td>
   <td colspan="4"><div align="center" class="style1">Admin Audio Upload Page</div></td>
   <td rowspan="21" bgcolor="#ffffff"><img src="../image/spacer.gif" width="15" height="594" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="1" height="180" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="18" valign="top"> </td>
   <td colspan="3" rowspan="20" valign="top"> 
   

<table width="392" border="2" align="center" cellpadding="10" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF">
        <tr align="center" valign="middle">
          <td align="center" valign="middle"><div align="center">
            <p><strong>New Audio</strong>        </p>
	      
            
            <form action="<?php echo $editFormAction; ?>" method="post" enctype="multipart/form-data" name="form1">
              <table align="center">
                <tr valign="baseline">
                  <td nowrap align="right">Title:</td>
                  <td><input type="text" name="title" value="" size="32">                  </td>
                </tr>
                <tr valign="baseline">
                  <td nowrap align="right">Author:</td>
                  <td><input type="text" name="author" value="" size="32">                  </td>
                </tr>
                <tr valign="baseline">
                  <td nowrap align="right">Description:</td>
                  <td><input type="text" name="description" value="" size="32">                  </td>
                </tr>
                <tr valign="baseline">
                  <td nowrap align="right">Audio File:</td>
                  <td>
			  <?php
$dir = "../update/uploads";
$dh  = opendir($dir);
while (false !== ($filename = readdir($dh))) {
   $files[] = $filename;
}

sort($files);
$num_files = count($files);

?>
			  <label>
			  <input type="file" name="fileField" id="fileField">
			  </label></td>
                </tr>
                <tr valign="baseline">
                  <td nowrap align="right"> </td>
                  <td><input type="submit" value="Insert Record">                  </td>
                </tr>
              </table>
              <input type="hidden" name="MM_insert" value="form1">
            </form>
            <p> </p>
          </div>          </td>
        </tr>
      </table>

     
    </div></td>
   <td><img src="../image/spacer.gif" width="1" height="35" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="19" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="16" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="11" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="24" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="12" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="23" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="31" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="3" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="1" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="23" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="11" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="25" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="28" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="26" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="3" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="24" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="11" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="2" bgcolor="#ffffff"> </td>
   <td><img src="../image/spacer.gif" width="1" height="25" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="63" border="0" alt=""></td>
  </tr>
</table>
</body>
</html>
<?php
}
?>

Link to comment
Share on other sites

K, I corrected the database now I get the error when trying to upload: Column 'fileField' cannot be null

 

I'm not leaving that field blank, It's a file field from dreamweaver and it has a browse button next to it.. so I select a simple test .mp3 file from desktop in that field and try to upload it and get that "Column 'fileField' cannot be null" error...

Link to comment
Share on other sites

It completes like it uploaded the file and then the page refreshes itself and all fields are blank, but the file was not uploaded to the page... ?

Code:

 

<?php require_once('../Connections/dl.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . $_SERVER['QUERY_STRING'];
}

if ((isset($_FILES["MM_insert"])) && ($_FILES["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO audios (title, author, description, fileField) VALUES (%s, %s, %s, %s)",
                       GetSQLValueString($_FILES['title'], "text"),
                       GetSQLValueString($_FILES['author'], "text"),
                       GetSQLValueString($_FILES['description'], "text"),
                       GetSQLValueString($_FILES['fileField'], "text"));

  mysql_select_db($database_dl, $dl);
  $Result1 = mysql_query($insertSQL, $dl) or die(mysql_error());

  $insertGoTo = "index.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  chmod("../update/uploads/" . $_FILES['file'], 0777);
  copy("../update/uploads/" . $_FILES['file'],"../update/audiorams/" . $_FILES['file']);
  chmod("../update/audiorams/" . $_FILES['file'], 0644);
  unlink("../update/uploads/" . $_FILES['file']);
  header(sprintf("Location: %s", $insertGoTo));
}


if ($_COOKIE['dl'] == 1)
{
}
else
{
header('Location: index.php');
}
include('../inc/dbcodes.php');

// Connect to MySQL
if (! mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS))
{
die('Failed to connect to host, please try later.');
}
else
{
// Connect to DB
mysql_select_db(MYSQL_DB);
?>
<html>
<head>
<title>Landrum International</title>
<meta http-equiv="Content-Type" content="text/html;">
<!-- Fireworks MX Dreamweaver MX target.  Created Wed Jul 26 03:02:29 GMT-0500 (Central Daylight Time) 2006-->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<style type="text/css">
<!--
.style1 {
font-size: 36px;
font-weight: bold;
}
-->
</style>
</head>
<body bgcolor="#ffffff">
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="800">
<!-- fwtable fwsrc="blue&white.png" fwbase="index2.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
  <tr>
   <td><img src="../image/spacer.gif" width="8" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="12" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="15" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="564" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="12" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="15" height="1" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="1" height="1" border="0" alt=""></td>
  </tr>

  <tr>
   <td colspan="6" bgcolor="#ffffff"><img src="../image/spacer.gif" width="800" height="6" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="1" height="6" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="21" bgcolor="#ffffff"><img src="../image/spacer.gif" width="8" height="594" border="0" alt=""></td>
   <td colspan="4"><div align="center" class="style1">Admin Audio Upload Page</div></td>
   <td rowspan="21" bgcolor="#ffffff"><img src="../image/spacer.gif" width="15" height="594" border="0" alt=""></td>
   <td><img src="../image/spacer.gif" width="1" height="180" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="18" valign="top"> </td>
   <td colspan="3" rowspan="20" valign="top"> 
   

<table width="392" border="2" align="center" cellpadding="10" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF">
        <tr align="center" valign="middle">
          <td align="center" valign="middle"><div align="center">
            <p><strong>New Audio</strong>        </p>
	      
            
            <form action="<?php echo $editFormAction; ?>" method="post" enctype="multipart/form-data" name="form1">
              <table align="center">
                <tr valign="baseline">
                  <td nowrap align="right">Title:</td>
                  <td><input type="text" name="title" value="" size="32">                  </td>
                </tr>
                <tr valign="baseline">
                  <td nowrap align="right">Author:</td>
                  <td><input type="text" name="author" value="" size="32">                  </td>
                </tr>
                <tr valign="baseline">
                  <td nowrap align="right">Description:</td>
                  <td><input type="text" name="description" value="" size="32">                  </td>
                </tr>
                <tr valign="baseline">
                  <td nowrap align="right">Audio File:</td>
                  <td>
			  <?php
$dir = "../update/uploads";
$dh  = opendir($dir);
while (false !== ($filename = readdir($dh))) {
   $files[] = $filename;
}

sort($files);
$num_files = count($files);

?>
			  <label>
			  <input type="file" name="fileField" id="fileField">
			  </label></td>
                </tr>
                <tr valign="baseline">
                  <td nowrap align="right"> </td>
                  <td><input type="submit" value="Insert Record">                  </td>
                </tr>
              </table>
              <input type="hidden" name="MM_insert" value="form1">
            </form>
            <p> </p>
          </div>          </td>
        </tr>
      </table>

     
    </div></td>
   <td><img src="../image/spacer.gif" width="1" height="35" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="19" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="16" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="11" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="24" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="12" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="23" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="31" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="3" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="1" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="23" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="11" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="25" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="28" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="26" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="3" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="24" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="11" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="2" bgcolor="#ffffff"> </td>
   <td><img src="../image/spacer.gif" width="1" height="25" border="0" alt=""></td>
  </tr>
  <tr>
   <td><img src="../image/spacer.gif" width="1" height="63" border="0" alt=""></td>
  </tr>
</table>
</body>
</html>
<?php
}
?>

Link to comment
Share on other sites

Would it be easier to start from scratch? All that is needed is a simple admin page that the secretary can log into and upload files that will auto display on a page to the public.. she just needs to be able to label each file that she uploads. Is there an easy way to do that?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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