i have a page that includes 3 different files.
menu and footer include fine. but with newmember i get the error:
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 ---------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="CSS/styleMain.css" rel="stylesheet" type="text/css" />
<?php include('menu.php'); ?>
<form action="register2.php" method="post">
<input type="text" name="userName" size="10" />
<input type="password" name="pass1" />
<input type="password" name="pass2" />
<input type="submit" name="sub1" value="next" />
<?php include('footer.html'); ?>
// new member.php ------------------------
$_SESSION['username'] = $_REQUEST['userName'];
$_SESSION['pass1'] = $_REQUEST['pass1'];
$_SESSION['pass2'] = $_REQUEST['pass2'];
$_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'];
$link = mysql_connect($host, $user, $password);
echo "Unable to connect";
$result = mysql_select_db("iwp_d003703a");
echo "No database";
$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
$Var = 'This is a string';
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.
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…