Jump to content

[SOLVED] include() error when script executes


elflacodepr

Recommended Posts

Hello all,

 

I'm writing a very basic CMS script, but when it executes I get the following errors:

Warning: include(/website/library/config.php) [function.include]: failed to open stream: No such file or directory in C:\Users\admin\Documents\My Folder\PortableAPPS\xampp\xampp\htdocs\website\content_add.php on line 6

 

Warning: include() [function.include]: Failed opening '/website/library/config.php' for inclusion (include_path='.;C:\Users\admin\Documents\My Folder\PortableAPPS\xampp\xampp\php\pear\') in C:\Users\admin\Documents\My Folder\PortableAPPS\xampp\xampp\htdocs\website\content_add.php on line 6

 

Warning: include(/website/library/open.php) [function.include]: failed to open stream: No such file or directory in C:\Users\admin\Documents\My Folder\PortableAPPS\xampp\xampp\htdocs\website\content_add.php on line 7

 

Warning: include() [function.include]: Failed opening '/website/library/open.php' for inclusion (include_path='.;C:\Users\admin\Documents\My Folder\PortableAPPS\xampp\xampp\php\pear\') in C:\Users\GER\Documents\My Folder\PortableAPPS\xampp\xampp\htdocs\website\content_add.php on line 7

 

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Users\admin\Documents\My Folder\PortableAPPS\xampp\xampp\htdocs\website\content_add.php on line 17

 

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Users\admin\Documents\My Folder\PortableAPPS\xampp\xampp\htdocs\website\content_add.php on line 17

Access denied for user 'ODBC'@'localhost' (using password: NO)

 

I've tried all kind of ways, such as direct link to file and nothing can be fixed! I also noted that this happens with all applications I write.  ???

 

This is the script:

<?php

if(isset($_POST['save']))
{

include '/website/library/config.php';
include '/website/library/open.php';

//Blog title and content
$title = $_POST['title'];
$content = $_POST['content'];
$read_more = $_POST['read_more'];


//Writing content and title to DB
$sql = "INSERT INTO content (title, read_more, content, date_time) VALUES ('.$title', '.$read_more', '.$content', now())" or die(mysql_error());
$query = mysql_query($sql) or die(mysql_error());


include '/website/library/closedb.php';
}
?>

<html>
<body>
<form method="post">
  		<table width="700" border="0" cellpadding="2" cellspacing="1" align="center">
  			 	<tr> 
   			  	 <td width="100">Title</td>
    			 	 <td><input name="word" type="text"></td>
  			 	 </tr>
  				<tr>
				<td width="100">Read More</td>
					<td><input name="read_more" type="text"></td>
			<tr>
			</tr>
			<tr> 
   			  	 <td width="100">Content</td>
    			 	 <td><input name="content" type="text"></td>
  			 	 </tr>
  				<tr>
   					<td colspan="2" align="center"><input name="save" type="submit" value="Add!"></td>
  				</tr>
  		</table>
</form>
</body>
</html>

 

Thanks in advance!

Warning: include(/website/library/config.php) [function.include]: failed to open stream: No such file or directory in C:\Users\admin\Documents\My Folder\PortableAPPS\xampp\xampp\htdocs\website\content_add.php on line 6

 

this means the config file cannot be found check your paths to the file.

Archived

This topic is now archived and is closed to further replies.

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