我使用xampp(apache)php,並且想要在本地測試我的html電子郵件表單。當我使用這個action
在form
標記它的工作(我得到一個「感謝您與我們聯繫」確認):不能在本地主機上運行xampp php來測試html電子郵件表格
<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文件。我已經嘗試了所有的這些(基於計算器職位的建議),還沒有工作:
action="contactform.php"
action="http://localhost/contactform.php"
action="<?php echo site_url('contactform'); ?>"
我有我的.PHP和.html電子郵件文件在同一個文件夾中。該目錄路徑是:C:\ XAMPP \ htdocs中\ contactform.php & C:\ XAMPP \ htdocs中\聯繫us.html
的方式,我測試使用CNTRL + O打開與我們聯繫Chrome中的.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
第一個選項應該工作 – gbestard
注意'zzz'文件夾... – Masiorama
如果您直接使用chrome打開.html文件,它不會工作。啓動服務器。並轉到localhost/contactus.html – Mathivanan