Hey everyone I'm trying to create a blog using php and for a certain page, I am "including" an "init.php" file that doesn't seem to recognize...I have three folders within another folder called "test5" and within that folder I have the folders called: "func" "resources" and "simple".
Now in the folder labeled "resources" are files called ".htacces", "config.php", and "init.php".
The only script in the folder labeled "func" is "blog.php"..
In the folder labeled "simple", I have the files labeled, "add_category.php", "edit_post.php", "category_list.php", "category.php", "add_post.php" and "add_category".
The issue is when I open the "add_category.php" the error shows as follows:
"Warning: include_once(resources/init.php) [function.include-once]: failed to open stream: No such file or directory in C:\Program Files (x86)\EasyPHP-5.3.8.1\www\test5\simple\add_category.php on line 2"
and
"Warning: include_once() [function.include]: Failed opening 'resources/init.php' for inclusion (include_path='.;C:\php\pear') in C:\Program Files (x86)\EasyPHP-5.3.8.1\www\test5\simple\add_category.php on line 2"
here is add_category.php
<?php
include_once('resources/init.php');
if ( isset($_POST['name'])) {
$name = trim($_POST['name']);
if ( empty($name)) {
$error = "You must submit a category name!";
} else if (category_exists($name)){
$error = "That category already exists!";
} else if (strlen($name) > 24) {
$error = "Category names can only be up to 24 characters!";
}
if ( ! isset($eror)){
add_category($name);
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title> Add a Category </title>
</head>
<body>
<h1> Add a Category </h1>
<form action="" method="post">
<div>
<label for="name"> Name </label>
<input type="text" name="name" value="">
</div>
<div>
<input type="submit" value="Add Category">
</div>
</form>
</body>
</html>
and here is init.php
<?php
include_once('resources/config.php');
mysql_connect(DB_HOST, DB_USER, DB_PASS);
mysql_connect(DB_NAME);
include_once('func/blog.php');
if there is any confusion, I'll try to answer as best as I can because to me this is a complicated process, but ANY help would greatly be appreciated!! :D