如何在提交表单时将会话传递到数据库中。我试着让每个人都明白这一点。谢谢你的协助。我不太明白。
PHP-我也有会话启动。
<?php
require('Conn.php');
$statement = $link->prepare("INSERT INTO Database(Client_FN, email) VALUES( :CFN, :Email)");
$ClientFN = $_POST['Client_FN']; <-- I want to insert $_SESSION['first_name'] into the database. - Not sure how to do this?
$ClientEmail = $_POST['email'];
$statement->execute(array(
":CFN" => "$ClientFN");
":Email" => "$ClientEmail");
// Echo Successful attempt
echo "<p Data added to database.</p></br></br>";
$statement = null;
$link = null;
?>
HTML
<label> Name: <input name="Client_FN" type="text"
class="form-control" id="" value="<?php echo $_SESSION['first_name']; ?>"> </label> </div>
<label> Name: <input name="email" type="text"
class="form-control" id="" value=""> </label> </div>