Hi, I want to create login web site for student entering data , The db stored in phpmyadmin cpanel on byethost6.com, just made three pages for authentication , index.php, connect.php , mysql_connect.inc.php . After input data into index.php, functionally changed to connect.php , without query database and response from code i set .
The infrormation provided i have done for login system . Hope people could help me , thanks!
Link : http://www.starofphilology.byethost6.com
SQL COLUMN :
sch-code
password
email
sch-name
address
district
sever config
Server host :sql307.byethost6.com
$db_name = “db_star”;
$db_user = “root”;
(index.php)
Registration Account:Paasword:
b[/b]
Student <?php session_start(); ?> <?phpinclude(“mysql_connect.inc.php”);
$id = $_POST[‘id’];
$pw = $_POST[‘pw’];
$sql = “SELECT * FROM account where schcode = ‘$id’”;
$result = mysql_query($sql);
$row = @mysql_fetch_row($result);
if($id != null && $pw != null && $row[1] == $id && $row[2] == $pw)
{
$_SESSION['schcode'] = $id;
echo 'Login successfully !';
echo '<meta http-equiv=REFRESH CONTENT=1;url=member.php>';
}
else
{
echo ‘Failed!’;
echo ‘<meta http-equiv=REFRESH CONTENT=1;url=index.php>’;
}
?>
b[/b]
<?php$db_server = “sql307.byethost6.com”;
$db_name = “db_star”;
$db_user = “root”;
$db_passwd = “123456”;
/
if(!@mysql_connect($db_server, $db_user, $db_passwd))
die("Doesn’t work ");
mysql_query(“SET NAMES utf8”);
if(!@mysql_select_db($db_name))
die(“Fail to connect the database”);
?>