我想将带有相同格式文件的隐藏输入数据发送到 php 脚本,但问题是由于某种原因我无法读取它读取的隐藏数据:
<form id="C2" method="post" enctype="multipart/form-data" action='/phps/upload_file.php'>
<input type="hidden" name="ID" value="C2" />
Profile picute <input type="file" name="photo01" /><br>
Pic 2 <input type="file" name="photo02" /><br>
Pic 3 <input type="file" name="photo03" /><br>
<input type="submit" value="Send files" />
</form>
upload_file.php 的开头如下所示:
require_once('login.php');
$valid_formats = array("jpg", "png", "gif", "bmp","jpeg");
if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST")
{
$ID= $_REQUEST['ID'];
error_log("File ID:".$ID."\n\n"); // I see nothing in the log file
//*****Connect to SQL********
$db_server = mysqli_connect($db_hostname, $db_username, $db_password);
if(!$db_server) die("Unable to connect to MYSQL:" .mysqli_error());
mysqli_select_db($db_server, $db_database)
or die("Unable to select database:" . mysqli_error());
$query = "SELECT current_pn,pic_path FROM partnum WHERE PNID = " . '$ID';
$queried = mysqli_query($db_server, $query);
$array = mysqli_fetch_array($queried);
当我检查日志文件时,我什么也看不到。有人知道为什么吗?
谢谢, Zsolt