akbarg64
جمعه 18 اردیبهشت 1394, 09:52 صبح
سلام.یه صفحه php ساختم در لوکال به درستی نمایش داده میشه و خوب هم کار میکنه.اما وقتی می فرستم روی سرورصفحه سفید نشون داده میشه.این هم کد هاش.ممنون میشم راهنمایی کنید
<?php
error_reporting(E_ERROR|E_WARNING);
$user = $_POST["normal_user"];
$pass = $_POST["normal_password"];
$conn = pg_connect("host=127.0.0.1 port=5432 dbname=IBSng user=ibs password=123456");
if (!$conn) {
echo "An error occured.\n";
exit;
}
$result = pg_query($conn, "SELECT * FROM normal_users where normal_username='$user' and normal_password='$pass'");
if (!$result) {
echo "An error occured.\n";
exit;
}
while ($row = pg_fetch_row($result)) {
$_SESSION['user_login']=$txt_login;
header("Location: default.php?user=$user");
}
?>
<html>
<body>
</table>
<form name="form1" method="post" action="">
<table width="279" height="103" border="1" align="center" class="MainTable">
<tr>
<td><input name="normal_user" type="text" class="textbox" id="normal_user"></td>
<td>User Name</td>
</tr>
<tr>
<td><label for="normal_password">
<input name="normal_password" type="password" class="textbox" id="normal_password">
</label></td>
<td><span>Password </span></td>
</tr>
<tr class="RowF">
<td class="RowF"><div align="center">
<input name="btn" type="submit" class="button" id="btn" value="Submit">
</div></td>
<td> </td>
</tr>
</table>
<div align="center"></div>
</form>
</body>
</html>
<?php
error_reporting(E_ERROR|E_WARNING);
$user = $_POST["normal_user"];
$pass = $_POST["normal_password"];
$conn = pg_connect("host=127.0.0.1 port=5432 dbname=IBSng user=ibs password=123456");
if (!$conn) {
echo "An error occured.\n";
exit;
}
$result = pg_query($conn, "SELECT * FROM normal_users where normal_username='$user' and normal_password='$pass'");
if (!$result) {
echo "An error occured.\n";
exit;
}
while ($row = pg_fetch_row($result)) {
$_SESSION['user_login']=$txt_login;
header("Location: default.php?user=$user");
}
?>
<html>
<body>
</table>
<form name="form1" method="post" action="">
<table width="279" height="103" border="1" align="center" class="MainTable">
<tr>
<td><input name="normal_user" type="text" class="textbox" id="normal_user"></td>
<td>User Name</td>
</tr>
<tr>
<td><label for="normal_password">
<input name="normal_password" type="password" class="textbox" id="normal_password">
</label></td>
<td><span>Password </span></td>
</tr>
<tr class="RowF">
<td class="RowF"><div align="center">
<input name="btn" type="submit" class="button" id="btn" value="Submit">
</div></td>
<td> </td>
</tr>
</table>
<div align="center"></div>
</form>
</body>
</html>