dou760663
2015-06-17 09:33
采纳率: 100%
浏览 77
已采纳

从HTML文件WAMP运行php脚本

So I have been following this tutorial here

I have installed WAMP and the server is up and running just fine. (As the green light in the taskbar indicates).

In the www folder I have the following 2 files:

        <!DOCTYPE html>
        <html>
        <head>
        <title>First Form</title>
        </head>
        <body>

             <form action="postForm.php" method="post">

             <TextArea 

                name="microBlog" id="microBlog" cols="30" rows=“10">

             </TextArea>  

             <input type="submit">          

            </form>

        </body>
        </html>

and

    <!DOCTYPE html>
    <html>
     <head>
      <title>PHP Test</title>
     </head>
     <body>

        <?php 

            $microBlog = $_POST['microBlog'];          
            echo $microBlog;  

        ?> 

     </body>
    </html> 

However, when I run the html file and input "hello" into the field, clicking the submit button returns a blank screen.

Here is the html screen on open:

enter image description here

and on clicking submit the following is in the address bar:

file:///C:/wamp/www/postForm.php

Any ideas why the blank screen?

Does the PHP (postForm) file require HTML tags or can I get rid of them?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题