Access denied using password YES (no replies)

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.
Submitted by programmer on Fri, 08/15/2008 - 12:03.

I get error "That Access denied using password Yes when uploading excel file.But the Code work perfect in my local machine!Take a look of this peace of code and help me solve this

<?php
<br />
$uploadDir 'C:/Program Files/xampp/htdocs/supplychain/supply/Uploaded Files/';
<
br />

<
br />
if(isset(
$_POST['upload']))
<
br />
{
<
br />
$fileName $_FILES['userfile']['name'];
<
br />
$tmpName $_FILES['userfile']['tmp_name'];
<
br />
$fileSize $_FILES['userfile']['size'];
<
br />
$fileType $_FILES['userfile']['type']; 
<
br />
if (
file_exists("Uploaded Files/" $_FILES["userfile"]["name"]))
<
br />
      {
<
br />
      echo 
$_FILES["file"]["name"] . " already exists. ";
<
br />
      }
<
br />
    else
<
br />
      {
<
br />

<
br />
$filePath $uploadDir $fileName;
<
br />

<
br />
$result move_uploaded_file($tmpName$filePath);
<
br />
if (!
$result) {
<
br />
echo 
"Error uploading file";
<
br />
exit;
<
br />
}
<
br />

<
br />
mysql_connect("localhost","root","") or die("no connection");
<
br />
mysql_select_db("supplychain");
<
br />
if(!
get_magic_quotes_gpc())
<
br />
{
<
br />
$fileName addslashes($fileName);
<
br />
$filePath addslashes($filePath);
<
br />

<
br />
$query="load data infile '$filePath' into table product_detail  FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'";
<
br />
//$quey = "INSERT INTO db_coursework VALUES ('$fileName', '$fileSize', '$fileType', '$filePath')";
<br />
mysql_query($query) or die('Error, query failed : ' mysql_error());
<
br />
//mysql_query($quey) or die('Error, query failed : ' . mysql_error());
<br />
echo 
"<br><font color='red'>Files uploaded<br></font>";
<
br />
}
<
br />
}
<
br />
?>

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.