Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 是否向表中添加用户会话?_Php_Html_Forms - Fatal编程技术网

Php 是否向表中添加用户会话?

Php 是否向表中添加用户会话?,php,html,forms,Php,Html,Forms,我试图将用户会话添加到一个表中,该表在用户填写表单时填写。然后我想只显示他们在主页上创建的表单 <?php require_once("/extlib/vdaemon/vdaemon.php"); require_once("./core/config.php"); ?> <html> <head> <style type="text/css"> body { background: #e4e4e4; } .form {

我试图将用户会话添加到一个表中,该表在用户填写表单时填写。然后我想只显示他们在主页上创建的表单

<?php 
require_once("/extlib/vdaemon/vdaemon.php");

require_once("./core/config.php");


 ?>


<html>
<head>
<style type="text/css">
body {
    background: #e4e4e4;
}

.form {
    width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 45px;
    border: 1px solid #c2c2c2;
}

.error {
    color: #AA0000
}
.controlerror {
    background-color: #ffffdd;
    border: 1px solid #AA0000;
}

.input {
    width: 300px;
    height: 35px;
    margin-left: 10px;
}
</style>
</head>
<body>
<div class="form">
<?php
$msg = $_GET['msg'];

if ( $msg == '1' ) {
    echo '<p>Your information was submitted successfully.</p>';
}
?>

<form action="core/process.php" method="post" id="registration" >
<input type="hidden" name="formID" value="Product_Tracker" />

**<input type="hidden" name="id_user" value="$_SESSION['id_user']" />**

<p>Name of product:<input type="text" name="Name of Product" class="input" />

<p>Please select the tests that were done on the product.</p>   
<p>In Circuit Test (ICT): Yes: <input type="radio" name="ICT" value="yes" /> No: <input type="radio" name="ICT" value="no" /></p>
<p>Visual Inspection: Yes: <input type="radio" name="Visual Inspection" value="yes" /> No: <input type="radio" name="Visual Inspection" value="no" /></p>
<p>XRAY: Yes: <input type="radio" name="XRAY" value="yes" /> No: <input type="radio" name="XRAY" value="no" /></p>
<p>Automated Optical Inspection (AOI): Yes: <input type="radio" name="AOI" value="yes" /> No: <input type="radio" name="AOI" value="no" /></p>
<!--<p>Checkbox1 <input type="checkbox" name="checkbox" value="checkbox1" /> Checkbox2: <input type="checkbox" name="checkbox" value="checkbox2" /></p>-->



<input type="submit" value="Submit" />
<p>
<a href='access-controlled.php'>Back</a>
</p>
</form>
</div>
</body>
</html>
<?php VDEnd(); ?>

当我在创建表单时查看phpMyAdmin时,id\u用户是$\u SESSION['id\u user'],而不是创建它的用户的名称

您没有回显$\u SESSION['id\u user']的值,请尝试以下操作

<input type="hidden" name="id_user" value="<?php echo $_SESSION['id_user']"; ?> />

我在显示他们创建的mysql\u select\u dbdatabase的表单时遇到问题,$con$结果=mysql\u querySELECT id\u user,product\u Tracker中的产品名称,其中id\u user=$\u SESSION['Name\u of_user'];虽然$row=mysql_fetch_assoc$result{echo$row['Name_of_Product'];echo;我只是想显示_Product的列名,但您应该回答另一个问题,提供更多详细信息,以及您遇到的错误