簡體   English   中英

PHP,mysql-注冊和登錄-用戶登錄

[英]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 !");
?>

任何想法? 謝謝!!

mysql_connect PHP函數用於連接mysql數據庫而不是oracle

請遵循以下有關oracle的教程頁面。

PHP-ORACLE Tut-1

PHP-ORACLE Tut-2

采用

if ($username && $password)

相反,如果

if (username&&password)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM