PHP can't find variable

Rai

New Member
So Im relatively new to PHP from ASP. And After converting alot of ASP code into PHP I have come across a problem where my PHP code seems unable to find the hidden variable I have set. It worked fine in ASP and was just wondering the best way to resolve this.Start of the Form:\[code\]<form name="LogIn" action="login.php" method="post"> <td bgColor=#ffffff> <table align="center" cellSpacing="2" cellPadding="2" border="0"> <tr> <td>&nbsp;</td> <td align="right"><font color="#4d71a1">User name:</font>&nbsp;</td> <td><input name="UserName" size="25" type="Text" autocomplete="OFF"></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td align="right"><font color="#4d71a1">Password:</font>&nbsp;</td> <td><input name="Password" size="25" type="Password" autocomplete="OFF"></td> <td>&nbsp;</td> </tr>\[/code\]PHP script:\[code\]<? if ($_POST["BtnPress"]=="Pressed"){if ($_POST["Username"]=="*****" && $_POST["password"]=="*********"){$_SESSION['AdminID']="1";header("Location: "."index.php");} else{print "<font color=#ff0000>Sorry you cannot access this part of the site.</font>";} } ?> \[/code\]then the rest of the form:\[code\]<tr> <td align="center" colspan="4"> <input type="hidden" name="BtnPress" value="http://stackoverflow.com/questions/12244240/Pressed"> <input type="Submit" value="http://stackoverflow.com/questions/12244240/Log In" class="mybutton" onclick="return CheckForm();"> </td> </tr> </table> </td> </form>\[/code\]The PHP seems unable to find the variable BtnPress, its a similar problem throughout alot of my translated ASP to PHP script. Sorry if it is a simple solution but can anyone tell me where I am going wrong?
 
Back
Top