Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 刚上手PHP,最基本问题

刚上手PHP,最基本问题

Jun 23, 2016 pm 02:26 PM

我用的是wampserver,然后就可以写.php文件了。
比如可以写a.php文件,然后在浏览器输入 "localhost/a.php" 然后就正常运行。
但是我想仿照w3cschool上这个例子:
建立一个html文件如下:




Name: 

E-mail: 







然后建立一个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打开,明白啦~

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

11 Best PHP URL Shortener Scripts (Free and Premium) 11 Best PHP URL Shortener Scripts (Free and Premium) Mar 03, 2025 am 10:49 AM

11 Best PHP URL Shortener Scripts (Free and Premium)

Introduction to the Instagram API Introduction to the Instagram API Mar 02, 2025 am 09:32 AM

Introduction to the Instagram API

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Working with Flash Session Data in Laravel

Build a React App With a Laravel Back End: Part 2, React Build a React App With a Laravel Back End: Part 2, React Mar 04, 2025 am 09:33 AM

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

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

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

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

12 Best PHP Chat Scripts on CodeCanyon

Notifications in Laravel Notifications in Laravel Mar 04, 2025 am 09:22 AM

Notifications in Laravel

See all articles