2013-04-03 74 views
0

如何獲取此表格的電子郵件中的數據?通過電子郵件接收表格數據

<form class="pa"> 
    <fieldset> 
     <label>Name <em>*</em></label> 
     <input type="text" placeholder=""> 
     <label>Email <em>*</em></label> 
     <input type="text" placeholder=""> 
     <label>Age <em>*</em></label> 
     <input type="text" placeholder=""> 
     <label>Phone <em>*</em></label> 
     <input type="text" placeholder=""> 
     <label>Zip Code <em>*</em></label> 
     <input type="text" placeholder=""> 
     <a class="submit pa" href="#"><img src="wp-content/themes/child/img/submit.png"</a> 
    </fieldset> 
</form> 

回答

1

您需要一個服務器端腳本來接受表單數據併發送一封電子郵件。你可以做這個PHP和其他幾種語言。根據您的示例代碼判斷您使用的是WordPress,因此您可以查看ContactForm plugin

+0

id絕對確保你包括爲避免你的服務器端的電子郵件的腳本可利用的漏洞某種客戶端驗證。 – 2013-04-03 22:59:41

+0

謝謝,聯繫人7工作。 – 2013-04-03 23:41:22

0

包裝你輸入的的東西,如

<form class="pa" action="yourscript.php" method="post"> 
    . 
    . 
    <label for="name">Name <em>*</em></label> 
    <input type="text" placeholder="" id="name" name="name"> 
    . 
    <input type="submit" value="Submit" /> 
    <!-- remove the a tag because that won't submit your form data or use type="image" --> 
    <input type="image" src="wp-content/themes/child/img/submit.png" /> 
</form> 

然後使用$_POST['name']檢索值 必須添加name=''每個輸入已送他們到你的腳本如<input type="text" id="name" name="name">,他們必須是不同的,否則他們可能會被覆蓋。 也是你的標籤將需要for=是可用的,它使用的input<label for="name">Name <em>*</em></label>