I have a question about this function.
I'm using a MySQL database so I created a file named db_conn.php so it can be called wherever needed.
I have...
I was having issues when the db_conn.php page had no opening and closing PHP tags, but once I added them, the page worked good, why did I need those tags?PHP Code:<?
if($_POST['name'] != "") {
require_once("db_conn.php");
session_start();
$user = $_POST['name'];
$pass = $_POST['pass'];
$result = mysql_query("SELECT * FROM users WHERE name = '$user' AND password = '$pass'") or die(mysql_error());
$row = mysql_fetch_array( $result );
}
?>
<span id="navbar">
<?php
if($row) {
$_SESSION['id'] = $row['id'];
header("Location: editable.php");
exit;
} else {
?>



Reply With Quote





Bookmarks