Failed to open stream error

i have a page that includes 3 different files.

newmember.php

menu.php

footer.php

menu and footer include fine. but with newmember i get the error:

Warning: include(E:\users\d003703a\webpages
ewmember.php): failed to open stream: Permission denied in E:\users\d003703a\webpages\register1.php on line 2 Warning: include(): Failed opening ‘newmember.php’ for inclusion (include_path=‘.;C:\php5\pear’) in E:\users\d003703a\webpages\register1.php on line 2

newmember, menu and footer are all in the same directory, so why would this happen?

Is register1.php in newmembers or is it the page you are making now? Please post the code for newmember and register1.php in [ php ] tags.

// register1.php ---------------------------


<?php
include('newmember.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="CSS/styleMain.css" rel="stylesheet" type="text/css" />
<title>Untitled Document</title>
</head>

<body>
<div id="mainWrap">
	<?php include('menu.php'); ?>
	<ul id="registerBar">
		<li>Stage 1</li>
		<li>Stage 2</li>
		<li>Stage 3</li>
    </ul>
    <div id="stage1">
    	<form action="register2.php" method="post">
			<p>Name:</p>
			<input type="text" name="userName" size="10" />
			<p>Password:</p>
			<input type="password" name="pass1" />
			<p>Re-Enter Password:</p>
			<input type="password" name="pass2" />
			<p>
			<input type="submit" name="sub1" value="next" />
			</p>
        </form>
	</div>
</div>
<?php include('footer.html'); ?>
</body>
</html>

// new member.php ------------------------

<?php
session_start();
ERROR_REPORTING(E_ALL);
if(isset($_POST['sub1']))
{
	$_SESSION['username'] = $_REQUEST['userName'];
	$_SESSION['pass1'] = $_REQUEST['pass1'];
	$_SESSION['pass2'] = $_REQUEST['pass2'];
}

if(isset($_POST['sub2']))
{
	$_SESSION['fullname'] = $_REQUEST['full_name'];
	$_SESSION['email'] = $_REQUEST['email'];
	$_SESSION['day'] = $_REQUEST['days']; $_SESSION['month'] = $_REQUEST['months']; $_SESSION['year'] = $_REQUEST['years'];
	$_SESSION['address1'] = $_REQUEST['address1'];
	$_SESSION['address2'] = $_REQUEST['address2'];
	$_SESSION['address3'] = $_REQUEST['address3'];
	$_SESSION['address4'] = $_REQUEST['address4'];
}

$username = $_SESSION['username'];
$pass1 = $_SESSION['pass1'];
$fullname = $_SESSION['fullname'];
$email = $_SESSION['email'];
$day = $_SESSION['day'];
$address1 = $_SESSION['address1'];
$address2 = $_SESSION['address2'];
$address3 = $_SESSION['address3'];
$address4 = $_SESSION['address4'];
$emailcheck = $_SESSION['emailcheck'];
$termcheck = $_SESSION['termcheck'];

$host="localhost";
$user="d003703a";
$password="pass91";

$link = mysql_connect($host, $user, $password);

if(!$link) {
  echo "Unable to connect";
}

$result = mysql_select_db("iwp_d003703a");
if(!$result) {
  echo "No database";
}

if(isset($_POST['sub3']))
{
	$emailcheck = $_REQUEST['emailcheck'];
	$termcheck = $_REQUEST['termcheck'];
	$SQL = "INSERT INTO members (`username`, `password`, `fullname`, `email`, `dob`, `address`, `telephone`, `emailcheck`, `termcheck`) VALUES ('$username','$pass1','$fullname','$email','$day','$address1','$address2','$address3','$address4','$emailcheck','$termcheck')";
	$result = mysql_query($SQL);
}
?>

Did you not read that? - If you don’t help people to help you then you won’t get much help.


//This is why we ask for it in php tags
function it()
   {
   print $Var;
   }
function format()
   {
   $Var = 'This is a string';
   it($Var);
   }

Additionally you’ve not answered rguys question either. You’ve just done the ‘dump n run’ thing.

i did post the code in php tags?

and no register1 is what i am creating yes, newmember is the page with all the php code in it. register1 is the php. i am making a 3 page registration system

No, you posted in <? and ?> tags. That is not the same as rguy showed you. The forum has a sticky topic about posting guidelines. You might want to look at number 9. The title clearly says “Please read this” in it so you’ve clearly ignored it choosing instead to ‘dump n run’.

Please just edit your post and use the tags.

ah my bad…

As rguy has also said, please can you also post newmember.php too?

I can’t see anything glaring out at me in the code you’ve posted so this could be an OS problem for some reason.

Just a thought…

Before each include statement try using print getcwd();

Let us know the results.

i have sorted the problem now, i copied the code into a new .php file and included that. and it worked. seems that the newmember.php was just corrupt on creation

Odd… but I have known that to happen myself and it had me going round in circles for days…