刚上手PHP,最基本问题
Jun 23, 2016 pm 02:26 PM 我用的是wampserver,然后就可以写.php文件了。
比如可以写a.php文件,然后在浏览器输入 "localhost/a.php" 然后就正常运行。
但是我想仿照w3cschool上这个例子:
建立一个html文件如下:
然后建立一个php文件如下:
Welcome
Your email address is:
我把他们放到了我的www目录下,当我打开html文件的时候填写表格,填写完点击sumbit按钮,就会跳转到
file:///C:/wamp/www/php/welcome.php
显示不了传送的信息。如果我手动到 localhost/php/welcome.php就会报错说变量不存在(这是一定,因为没有传过来)。不知道怎么才能让他跳转到正确的localhost?
请问前辈,如何才能让数据正确在html文件和php文件之间传送呢?多谢!
回复讨论(解决方案)
Name:
E-mail:
上面的代码改为:
Name:
E-mail:
看看
file:///C:/wamp/www/php/welcome.php ???
你在桌面用浏览器打开的你的html文件?
你需要在浏览器地址栏输入: localhost/php/你的html文件
访问html页面的方式和访问php页面访问方式一样,都是http://localhost/xx.html,而不是双击直接打开访问
楼主请问你是用IE打开的吗?
file:///C:/wamp/www/php/welcome.php ???
你在桌面用浏览器打开的你的html文件?
你需要在浏览器地址栏输入: localhost/php/你的html文件
原来需要用localhost打开,明白啦~

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

11 Best PHP URL Shortener Scripts (Free and Premium)

Working with Flash Session Data in Laravel

Build a React App With a Laravel Back End: Part 2, React

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon
