[英]PHP , mysql - Register & Login- User login
嗨,我想登錄我的數據庫,但我不能使用Apache2.2和Oracle Database 10g Express Edition:索引頁index.html:
<html><form action='login.php' method='POST' >
username: <input type='text' name='username'><br>
password: <input type='password' name='password'><br>
<input type='submit' value='log in'>
</form></html>
登錄頁面login.php:
<?php
$username = $_POST['username']
$password = $_POST['password']
if (username&&password)
{
$connect = mysql_connect("localhost","root","") or die("couldn't connect!");
mysql_select_db("operateurs") or die("couldn't find db ! )" ;
}
else
die ("please enter username and password !");
?>
當我單擊提交我得到這個:
<?php
$username = $_POST['username']
$password = $_POST['password']
if (username&&password)
{
$connect = mysql_connect("localhost","root","") or die("couldn't connect!");
mysql_select_db("operateurs") or die("couldn't find DB ! )" ;
}
else
die ("please enter username and password !");
?>
任何想法? 謝謝!!
采用
if ($username && $password)
相反,如果
if (username&&password)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.