admin管理员组文章数量:1122833
I have a php contact form that I use with all websites, so ideally I want to avoid using a plug in. The files used include:
• contact.php - A file with php/html write up which displays the form fields.
• contact-form.php - A file that contact.php connects to to send the information.
I've created the equivalent of contact.php as a static page in the Wordpress login.
The code within contact.php which connect to contact-form.php is as follows:
<form method="post" action="/contact-form.php" >
What I would like to know is how I would connect to this file in the instance of Wordpress - locating files in Wordpress is something which has always confused me...
Thanks
I have a php contact form that I use with all websites, so ideally I want to avoid using a plug in. The files used include:
• contact.php - A file with php/html write up which displays the form fields.
• contact-form.php - A file that contact.php connects to to send the information.
I've created the equivalent of contact.php as a static page in the Wordpress login.
The code within contact.php which connect to contact-form.php is as follows:
<form method="post" action="/contact-form.php" >
What I would like to know is how I would connect to this file in the instance of Wordpress - locating files in Wordpress is something which has always confused me...
Thanks
Share Improve this question asked Mar 1, 2013 at 14:42 howardrockshowardrocks 1034 bronze badges1 Answer
Reset to default 0You could put both the form and processing logic in the same file and submit the form to the same page by omitting the action attribute. Check $_POST vars to see if the form has been submitted and do your processing, otherwise display the form.
if( isset( $_POST['somevar'] ) ) :
// process submission
else :
// show form
endif;
本文标签: phpPath for contact form file
版权声明:本文标题:php - Path for contact form file 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736287995a1928000.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论