我正在嘗試使用 uni 連接到 oracle 服務器。我認為它確實連接但是我無法從表中選擇以檢查登錄憑據(jù)是否相同以便登錄。我也嘗試過其他方法,但這是我迄今為止最接近的方法。問題出在 oci_bin 部分,它顯示錯誤,但我不知道有其他方法可以解決這個問題。<?phpsession_start();if(!isset($_POST['username']) || !isset($_POST['password'])) { header("Location: ../session.php");}putenv("ORACLE_SID=teaching");if ($Connection = oci_connect("w4e09", "melih312")) { print "Connection OK \n";} if(isset($_SESSION['loggedin'])) header("Location: ../secret.php"); $Statement = oci_parse($Connection, 'select * from Company where address = :un_bv and email = :pw_bv' ); Oci_bind_by_name($s, ":un_bv", $_POST['username']); Oci_bind_by_name($s, ":pw_bv", $_POST['password']); oci_execute($s); $r = oci_fetch_array($s, OCI_ASSOC);}if ($r) { $_SESSION['loggedin']=TRUE; $_SESSION['username']="admin";}else { // No rows matched so login failed login_form('Login failed. Valid usernames/passwords ' . 'are "chris/tiger" and "alison/red"');}header("Location: secret.php");?>
為 login.php 連接到 oracle 服務器
寶慕林4294392
2021-07-21 17:02:18