问题描述
美好的一天
我是PHP的初学者.我想用用户输入创建一个PHP网页.我检查了链接 http://www.w3schools.com/php/php_forms.asp []创建带有用户输入的html和php的表单. br/>
这是代码
//HTML FORM
Good day
I am a beginner in PHP. I want to create a PHP webpage with user input. I checked the link http://www.w3schools.com/php/php_forms.asp[^]on w3schools to create a form with html and php with user input.
Here is the code
//HTML FORM
<html>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
//PHP FORM(welcome.php)
//PHP FORM (welcome.php)
<html>
<body>
Welcome <?php echo $_POST["fname"]; ?>!<br />
You are <?php echo $_POST["age"]; ?> years old.
</body>
</html>
如何修改不需要创建两个网页(PHP和HTML)的代码?所有代码都必须在单个页面上.我不想从html页面获取welcome.php.
How can I modify the code that I do not need to create two webpages(PHP and HTML)? All the code must be on a single page. I do not want to get the welcome.php form the html page.
推荐答案
如何修改不需要创建两个网页(PHP和HTML)的代码?所有代码都必须在单个页面上.我不想从html页面中获取welcome.php.
How can I modify the code that I do not need to create two webpages(PHP and HTML)? All the code must be on a single page. I do not want to get the welcome.php form the html page.
<form action="<?php
这篇关于在单个页面上创建html和php页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!