PhP help!!!

My Error in a menu include

Warning: include(…\menu egister.php) [function.include]: failed to open stream: Invalid argument in C:\Abyss Web Server\htdocs\members\register.php on line 26

Warning: include() [function.include]: Failed opening ‘…\menu egister.php’ for inclusion (include_path=’.;C:\php5\pear’) in C:\Abyss Web Server\htdocs\members\register.php on line 26

MY code

 if (isset($_POST['submitBtn'])){
  // Get user input
  $username  = isset($_POST['username']) ? $_POST['username'] : '';
  $password1 = isset($_POST['password1']) ? $_POST['password1'] : '';
  $password2 = isset($_POST['password2']) ? $_POST['password2'] : '';
  // Try to register the user
  $error = registerUser($username,$password1,$password2);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">

<title>Rawhi M - Register</title>
<link href="style/style.css" rel="stylesheet" type="text/css" />
<h1 align="center">Register</h1>
<?php include("..\menu\register.php"); ?>
<div id="main">
<?php if ((!isset($_POST['submitBtn'])) || ($error != '')) {?>
      <div class="caption">Register user</div>
      <div id="icon">&nbsp;</div>
      <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="registerform">
        <table width="100%">
          <tr><td>Username:</td><td> <input class="text" name="username" type="text"  
          <tr><td>Password:</td><td> <input class="text" name="password1" type="password" 
          <tr><td>Confirm password:</td><td> <input class="text" name="password2" 
type="password" /></td></tr>
          <tr><td colspan="2" align="center"><input class="text" type="submit" 
name="submitBtn" value="Register" /></td></tr>
    if (isset($_POST['submitBtn'])){
      <div class="caption">Registration result:</div>
      <div id="icon2">&nbsp;</div>
      <div id="result">
        <table width="100%"><tr><td><br/>
 if ($error == '') {
  echo " User: $username was registered successfully!<br/><br/>";
  echo ' <a href="login.php">You can login here</a>';
 else echo $error;
 <div id="source">Rawhi M</div>

You need to either use forward slashes in path, or escape backslashes. Because combination \r is interpreted as CR (carriage return).

[php]<?php include("..\\menu\\register.php"); ?>[/php]

correct too:
[php]<?php include("../menu/register.php"); ?>[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service