我到处看了看,似乎人们只想在提交表单后打开一个灯箱。但是,我想从灯箱提交表单。在我将表单放入灯箱之前,我的所有代码都有效,所以我想知道这是否可能。
表单提交代码(PHP):
if(isset($_POST['updatemain'])) {
$company = $_POST['conameu'];
$vault = $_POST['vnameu'];
$q = "UPDATE siteinformation SET SiteName = :company, VaultName = :vault";
$query = $db->prepare($q);
$results = $query->execute(array(
":company" => $company,
":vault" => $vault
));
header('Location: vault.php');
}
灯箱代码中的表格:
<div class="backdrop"></div>
<div class="box"><div class="close"><img src="images/close.png" /></div>
<fieldset>
<legend>Pick a Section to Work on</legend>
<div id="prompt">Select a Section:</div>
<div id="answer">
<select id="sectionchange">
<option value="main">Main Titles</option>
<option value="organ">Emergency Organizations</option>
<option value="number">Common Numbers</option>
<option value="website">Common Websites</option>
<option value="quicklink">Quick Links</option>
</select>
</div>
</fieldset>
<div id="mainsection">
<form id="updatemain" action="" method="post">
<fieldset>
<legend><strong>Main Title Information</strong></legend>
<div id="prompt">Client Company Name:</div><div id="answer"><input type="text" name="conameu" id="conameu" /></div>
<div id="prompt">Web Tool Name:</div><div id="answer"><input type="text" name="vnameu" id="vnameu" /></div>
<div id="prompt"><input type="submit" id="updatemain" value="Update Information" /></div>
</fieldset>
</form>
</div>
</div>
</div>
就像我说的那样,这很好,直到它在灯箱中,所以我在这一点上有点难过。
有任何想法吗?
在此先感谢您的时间!