Hi all, im trying to make a new webpage open if a persons password is equall to COOP, i have used the code

header('Location: loginfull.php')

to do this but i need to call through the EmployeeID and Password when this link is opened, any one have any idea how ?

The entire code is below if its needed :

<body>
<table width="744" height="458" border="1">
  <tr>
    <td height="63" colspan="3" bgcolor="#8BCB6A"><p><img src="CO-OP title.gif" width="407" height="64" /></p></td>
  </tr>
  <tr>
    <td width="97" bgcolor="#003366"><</td>
    <td width="519" bgcolor="#003366"><table width="519" height="294" border="1" >
      <tr>
        <td width="509" bgcolor="#E0EEFE"><p align="center">Welcome to the Co-operative Automated rota system, please enter a new password below :
            
        </p>
            <form action="loginfull.php"  method=POST >
              <div align="center">
                <p>
                  <input type="hidden" name="EmployeeID" value=" <?php echo $EmployeeID; ?>" >
                  <input type="hidden" name="Password2" value=" <?php echo $Password; ?>" >
                  New Password :
                  <input name="Password" type="password" value="" size="30" />
                </p>
                <p>
                  Re Type New Password :
                  <input name="Password1" type="password" value="" size="30" />
                    </p>
					<?php
					if ($password1 != $password) {
$error= 'Your Password do not match';
}
?>
                <p>&nbsp;</p>
              </div>
              </form>
          <input type="submit" name="submit"value ="    Confirm    " /></td>
		  
      </tr>
    </table></td>
    <td width="106" bgcolor="#003366">&nbsp;</td>
  </tr>
</table>
<input type="hidden" name="EmployeeID" value=" <?php echo $EmployeeID; ?>" >
<input type="hidden" name="Password" value=" <?php echo $Password; ?>" >
<?php
}
else {
echo ;
header('Location: loginfull.php')
"<?EmployeeID=$EmployeeID&Password=$Password&connection=$connection'><a/>"

?>

<?php
}
?>
</body>
</html>
<?php
}}
else {
echo "incorrect userID and password";
?>
<a href="loginpage.php">Try Again<a/>
<?php
}

}
else{
echo "Sorry you are currently not a member, please contact your manager";
?>
<a href="loginpage.php">Try again<a/>
<?php
}
}
else{
echo "Error selecting database";
}
//else{ echo "Error connecting to mysql";}
?>

How about storing the values in session variables so they you can access them after the redirect.

Hi,the code you have posted is very messy
You can pass values between two pages or within same page using javascript's redirecting technique with query strings.

location.href="yourpage.extension?query=queryValue1&query2=queryValue2";

It will redirect to the page you want to call,just put it in your Login button or on a similar button like this
onClick="location.href='yourpage.extension?query=queryValue1&query2=queryValue2';"


For your code,you can have something like this...


onClick="location.href='yourpage.extension?empId=' + document.getElementById('EmployeeID').value; + '&pass=' + document.getElementById('Password').value ;"

And add an ID attribute in both of your textboxes name EmployeeId and Password.

Hope it helps..... :)


Mark it as solved if it helps,so it can help others..