Jump to content

if statement not working:


rofl90

Recommended Posts

heres my login.php

 

<?php
error_reporting(E_ALL);
$dbhost = 'x';
$dbuser = 'x';
$dbpass = 'x;
$dbname = 'x';
mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());

mysql_select_db($dbname);
$message = $_GET['a'];
if(!empty($message)) {
echo $message;
}
else {
?>
<form action="validate.php" method="post"> <fieldset>
<label>Your IP is <?php echo $_SERVER['REMOTE_ADDR']; ?>, and has been logged, unauthorised attempts to access will be logged, and steps will be taken. <br /></label>
<br />
<fieldset>
<legend>Name</legend>
<input type="text" name="userid" id="user" />
</fieldset>
(not case sensitive eg cHaRLiE becomes 'Charlie') <br />
<br />
<fieldset><legend> Password</legend>
<input type="password" name="password" id="password" />
</fieldset>
(cAsE sEnSiTiVe) <br />
<br />
<input type="submit" id="submit" value="Login" />
<input name="ip" type="hidden" id="hidden" value="<?php $ip = $_SERVER['REMOTE_ADDR']; echo $ip; ?>" />
<br />
<br />
Backend time out currently set at: <?php $result = mysql_query("SELECT * FROM settings") or die(mysql_error()); 
$row = mysql_fetch_array($result);
$timing = $row['timeout']; echo $timing / 60; ?> minutes.<br />
</fieldset></form>
<?php } ?>

it is like

 

login.php?a=Login has failed

Link to comment
https://forums.phpfreaks.com/topic/94828-if-statement-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.