我正在使用xampp(apache)php并希望在本地测试我的html电子邮件表单。当我在action
标记中使用此form
时,它会有效(我会收到“感谢您与我们联系”确认):
<form id="contactus" action="http://www.html-form-guide.com//files/contact-form/simple-form-1-1/contactform.php" novalidate method="post" accept-charset="UTF-8" >
注意: action
中使用的网址是从指导电子邮件表单设计的网站获取的。
但我无法正确编码action
以使其使用我的本地.php文件运行。我已经尝试了所有这些(基于stackoverflow帖子中的建议),没有一个有效:
action="contactform.php"
action="http://localhost/contactform.php"
action="<?php echo site_url('contactform'); ?>"
我将.php和.html电子邮件文件放在同一个文件夹中。目录路径为: c:\ xampp \ htdocs \ contactform.php &amp; c:\ xampp \ htdocs \请联系us.html
我正在测试的方法是使用Cntrl + O在Chrome中打开Contact us.html。我可以看到电子邮件表格。当我输入姓名,电子邮件地址和虚拟消息时,我使用action="http://www.html-form-guide.com//files/contact-form/simple-form-1-1/contactform.php"
但不能使用上面的1,2和3。谢谢你的帮助。
最后,使用localhost / contactform.php打开.php文件没有问题。
更新:如果这有助于我的XAMP控制面板中的脚本:
22::37:25 [main] Initializing Control Panel
22::37:25 [main] Windows Version: Windows 8 64-bit
22::37:25 [main] XAMPP Version: 5.6.8
22::37:25 [main] Control Panel Version: 3.2.1 [ Compiled: May 7th 2013 ]
22::37:25 [main] You are not running with administrator rights! This will work for
22::37:25 [main] most application stuff but whenever you do something with services
22::37:25 [main] there will be a security dialogue or things will break! So think
22::37:25 [main] about running this application with administrator rights!
22::37:25 [main] XAMPP Installation Directory: "c:\xampp\"
22::37:25 [main] Checking for prerequisites
22::37:25 [main] All prerequisites found
22::37:25 [main] Initializing Modules
22::37:25 [Apache] Initializing module...
22::37:25 [Apache] Checking for module existence...
22::37:25 [Apache] Checking for required tools...
22::37:25 [Apache] Checking for service (name="Apache2.4"): Service not installed
22::37:25 [Apache] Service Path: Service Not Installed
22::37:25 [Apache] Checking default ports...
22::37:25 [mysql] Initializing module...
22::37:25 [mysql] Checking for module existence...
22::37:25 [mysql] Checking for required tools...
22::37:25 [mysql] Checking for service (name="mysql"): Service not installed
22::37:25 [mysql] Service Path: Service Not Installed
22::37:25 [mysql] Checking default ports...
22::37:25 [filezilla] Initializing module...
22::37:25 [filezilla] Checking for module existence...
22::37:25 [filezilla] Checking for required tools...
22::37:25 [filezilla] Checking for service (name="FileZillaServer"): Service not installed
22::37:25 [filezilla] Service Path: Service Not Installed
22::37:25 [filezilla] Checking default ports...
22::37:25 [mercury] Initializing module...
22::37:25 [mercury] Checking for module existence...
22::37:25 [mercury] Checking for required tools...
22::37:25 [mercury] Checking default ports...
22::37:25 [Tomcat] Initializing module...
22::37:25 [Tomcat] Checking for module existence...
22::37:25 [Tomcat] Checking for required tools...
22::37:25 [Tomcat] Checking for service (name="Tomcat7"): Service not installed
22::37:25 [Tomcat] Service Path: Service Not Installed
22::37:25 [Tomcat] Checking default ports...
22::37:25 [main] Enabling autostart for module "Apache"
22::37:25 [main] Enabling autostart for module "MySQL"
22::37:25 [main] Starting Check-Timer
22::37:25 [main] Control Panel Ready
22::37:26 [Apache] Autostart active: starting...
22::37:26 [Apache] Checking default ports...
22::37:26 [Apache] Attempting to start Apache app...
22::37:26 [Apache] Executing "c:\xampp\apache\bin\httpd.exe"
22::37:26 [Apache] Return code: 0
22::37:26 [mysql] Autostart active: starting...
22::37:26 [mysql] Checking default ports...
22::37:26 [mysql] Attempting to start MySQL app...
22::37:26 [mysql] Executing ""c:\xampp\mysql\bin\mysqld.exe" --defaults-file="c:\xampp\mysql\bin\my.ini" --standalone"
22::37:26 [mysql] Return code: 0
22::37:26 [Apache] Status change detected: running
22::37:26 [mysql] Status change detected: running
答案 0 :(得分:0)