我在这里看到很多关于MySQL的问题,但是在使用OCI时呢?
最简单的方法是创建一个函数来除去A-Z 0-9以外的字符串中的所有字符并通过它运行$_POST
吗?
我可以举个例子吗?
<?php
include("core/connection.php");
if (!empty($_POST)) {
$stid = oci_parse($conn, "SELECT CustomerNo FROM Customers WHERE Username = '" . $_POST['username'] . "' AND Password = '" . $_POST['password'] . "'");
oci_execute($stid);
$count = oci_fetch_all($stid, $res);
if ($count > 0) {
session_start();
$row = oci_fetch_array($stid, OCI_NUM);
$_SESSION['account'] = $row['0'];
header("Location: index.php");
}
oci_free_statement($stid);
oci_close($conn);
}
?>