Maybe concatation problem
Posted: Sat Nov 25, 2006 8:36 am
Hello all,
I am trying to echo the variable $sql at the end. The problem is,i can echo sql if i dont set it for anything,but if i do,it does not echo,here is the code:
I know tgar the submit is getting set. Im not really sure about the hash,because once i submit it,nothing shows up. Help anyone?
Thanks
I am trying to echo the variable $sql at the end. The problem is,i can echo sql if i dont set it for anything,but if i do,it does not echo,here is the code:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Proxy Logon</title>
</head>
<body>
<div align="center">
<p>Welcome To the Logon Page</p>
<p> </p>
<form id="form1" name="form1" method="post" action="<?php $_SERVER['PHP_SELF'] ?>">
<label>Hash
<input name="hash" type="text" size="6" maxlength="6" />
</label>
<p>
<label>
<input type="Submit" name="Submit" value="Submit" />
</label>
</p>
</form>
<p> </p>
<?php
//start PHP HERE
$submit = $_POST['Submit'];
$hash = $_POST['hash'];
if (isset($submit) && isset($hash)) {
echo $hash;
//check to see if it is a valid code
include "sql.php";
$sql = "SELECT time_left FROM times WHERE hash = .$hash. AND time_left > 0";
$query = mysql_query($sql);
$result = mysql_num_rows($query);
echo $sql;
}
?>
</div>
</body>
</html>Thanks