在那里,我是PHP新手,学习自己的东西,我有一个简单的HTML表单如下:
<form action="file:///C|/wamp/www/welcome.php" method="POST">
Enter your name: <input type="text" name="name" />
Enter your age: <input type="text" name="age" />
<input type="submit"
<?php
# don't forget the library
include('simple_html_dom.php');
# this is the global array we fill with article information
$Prices = array();
getPrices('http://www.google.com/search?q=xbox+360&tbm=shop&hl=en&aq=f');
function getPrices($pag
我通常创建模块化的网站,网站的每一部分是一个.php文件,其中将包括在主页面。
使用echo在PHP文件中输出HTML是“更好”,还是每次需要访问php函数/变量时关闭PHP标记?>并打开它。
V1:
<?php
$v1=$_POST['name'];
echo "Your name is".$v1;
echo $v1." if you want, you can log out";
?>
V2:
<?php $v1=$_POST['name']; ?>
Your name i
我有一个表单,它在提交后将一些数据发送到我的数据库。此外,单击按钮时,PHP代码将创建一个新的PHP页面(它应该显示刚刚上载到数据库的相同内容)。一切正常(数据被发送,文件被创建),但是内容是以普通文本的形式出现的,而不是PHP代码。我认为看到代码和输出会更好地解释这一点:
// some PHP code that sends data to the database (not important and too much code to write)
// here is the code for creating the page (note: VERY simplified)
<