0
我有兩個php頁面:info.php
和thankyou.php
。如何將數據從PHP中的表單傳遞到另一個PHP的HTML
在info.php
,我有一個表格是這樣的:
<span class="help" style="padding-left:4%;">Νame as it appears on ID Card.</span>
<label for="id_holder">ID Name :</label>
<span action="../myaccount/Luhusian/thankyou.php" method="post" id="id_holder">
<input type="text" autocomplete="off" class="large" pattern=".{2,30}" maxlength="32" name="id_holder" value="" required="" title="ID fullname">
</span>
我想在thankyou.php
使用表單數據。 。 。例如,全名,如下圖所示:
<div class="span8" id="js_activityCollection">
<section class="activityModule shadow none" aria-labelledby="activityModuleHeaderNone">
<h1 style="font-size: 18px;font-weight: bold; border-bottom: 1px solid #EEE; height:40px;">
Thank you <?php echo $_POST["id_holder"]; ?>
</h1>
</section>
</div>
但是當我嘗試運行它,我得到這個錯誤:
Thank you,
Notice: Undefined index: id_holder in C:\xampp\htdocs\thankyou.php on line 14
我覺得是有什麼錯我上面的代碼。 。 。任何人都可以告訴我如何解決它?
基於Web的表單通常需要FORM標籤...我不相信您可以將FORM標籤參數分配給SPAN標籤,並使其表現形式類似於FORM標籤...請參閱https://www.w3schools.com /php/php_forms.asp –