Forum Moderators: open

Message Too Old, No Replies

what should I do for this error tracking?

         

chacko

9:50 am on Feb 23, 2006 (gmt 0)

10+ Year Member



Warning: Failed opening 'library/config.php' for inclusion (include_path='.;E:/phpdev/php/includes;E:/phpdev/php/class') in e:\phpdev\www\database\upload.php on line 30

chacko

10:12 am on Feb 23, 2006 (gmt 0)

10+ Year Member



Warning: Failed opening 'library/config.php' for inclusion (include_path='.;E:/phpdev/php/includes;E:/phpdev/php/class') in e:\phpdev\www\database\upload.php on line 30

<form method="post" enctype="multipart/form-data">
<table width="350" border="0" cellpadding="1" cellspacing="1" class="box">
<tr>
<td width="246">
<input type="hidden" name="MAX_FILE_SIZE" value="2000000">
<input name="userfile" type="file" id="userfile">
</td>
<td width="80"><input name="upload" type="submit" class="box" id="upload" value=" Upload "></td>
</tr>
</table>

<?php
if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0)
{
$fileName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$fileSize = $_FILES['userfile']['size'];
$fileType = $_FILES['userfile']['type'];

$fp = fopen($tmpName, 'r');
$content = fread($fp, filesize($tmpName));
$content = addslashes($content);
fclose($fp);

if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
}

include 'library/config.php';
include 'library/opendb.php';

$query = "INSERT INTO upload (name, size, type, content ) ".
"VALUES ('$fileName', '$fileSize', '$fileType', '$content')";

mysql_query($query) or die('Error, query failed');
include 'library/closedb.php';

echo "<br>File $fileName uploaded<br>";
}
?>

Romeo

10:45 am on Feb 23, 2006 (gmt 0)

10+ Year Member



You have put this statement in line 30
include 'library/config.php',
but this file could not be found in the default locations given in the error message.

Expanding the include statement to reflect the correct path to the 'config.php' file should help.
Perhaps the other 2 includes you have in that program may need a similar check, too.

Regards,
R.