just wondering why iam getting this error
iam guessing its giving me the error, as it cant find it ?
Undefined index: txtusername
im not good at php, so it was just a copy & paste job from hotscripts ?
also, if any1 knows if it can be "cleaned" up a bit ? please let me know
and iam new 🙂
thanks!
<?php
$username = "user";
$password = "pass";
if($_POST['txtusername'] != $username || $_POST['txtpassword'] != $password) {
?>
<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<label for="txtusername">Username:</label><br />
<input type="text" title="Enter your Username" name="txtusername" value="admin" size="10" /><br />
<label for="txtpassword">Password:</label><br />
<input type="password" title="Enter your password" name="txtpassword" size="10"/><br />
<input type="submit" name="Submit" value="Login" />
</form>
<?php
}
else {
?>
<?php
header( 'Location: http://sitename.com' ) ;
?>
<?php
}
?>