#!/usr/bin/php
<?
$Database = "flee";
$Table = "Upload_table";
echo "\n";
echo "<HEAD>\n";
echo "<TITLE>ML97---Upload area</TITLE>\n";
echo "</HEAD>\n";
echo "<BODY BACKGROUND=\"../image/b5.gif\">\n";
/******************************************************
perform actions
******************************************************/
if($ACTION != "")
{
if($ACTION == "POST" AND $inputFile_name!="" )
{
$conn=@mysql_pconnect("mydb", "myid", "mypasswd")
or die("<center><h3>Can not make connection to database, please try again later !</h3></center>");
@mysql_select_db($Database, $conn) or die("Can not select database !");
$inputTitle = ereg_replace("'", "''", $inputTitle);
$inputBody = ereg_replace("'", "''", $inputBody);
$inputPoster = ereg_replace("'", "''", $inputPoster);
if ( $inputTitle=="" )
{
echo "<center><h3>You wanna Upload what, please input a title</h3></center>";
}
$Query = "INSERT INTO $Table ";
$Query .= "VALUES(0, '$inputTitle', ";
$Query .= "'$inputPoster', ";
$Query .= "'$inputBody', ";
$Query .= "'$inputFile_name'); ";
echo "query is $Query";
$res=@($Query, $conn) or die("Could not send mysql query to server");
copy( "$inputFile", "/web/sites/184/flee/www.ml97.f2s.com/pub/"."$inputFile_name");
echo "<center><h3>Thanks $inputPoster for ur uploading !</h3></center>";
echo "<br><br>result is '$result'";
}
}
echo "</BODY>\n";
echo "\n";
?>
I just amended a couple of your sql statements. I cant say 100% that it will fix your error... You dident post it. oh well. the above should work.
Mark.