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!

Link to comment
Share on other sites

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.

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.