我在看XHTML时书上说,尽量用id 代替name。我照着做了,可是当我使用$_POST这些获取text的值时无效,为什么?当然,请不要告诉我再加个name<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<?php
$text = $_REQUEST['texts'];echo $text;?>
<body>
<form action="123.php" method="post">
<input type="text" id="texts" name="texts" value="" />
<input type="submit" id="submit" value="提交" />
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<?php
$text = $_REQUEST['texts'];echo $text;?>
<body>
<form action="123.php" method="post">
<input type="text" id="texts" name="texts" value="" />
<input type="submit" id="submit" value="提交" />
</form>
</body>
</html>
解决方案 »
- 有谁会用这个网站是的主机 www.goodaddress.eu
- WINDOWS或LINXU APACHE PHP PDO ORACLE 的连接问题
- 新手关于数据库更新内容问题!
- 请教唠叨大哥一个问题,非常感谢
- 这是怎么做的!!
- php SAPI 模式 http 500 错误得问题求教
- 2003年了,您还没有自己的网站吗?
- 提一个简单的问题:公司有一套库存管理软件(语言pb7.0数据库sql server7),我在知道数据库连接密码,用户名,且知道表结构的情况下,能不能用p
- 关于thinkphp蛋疼的问题
- 高分求助高手翻译一PHP文件上传代码
- 怎么读取文件件内创建最早的文件
- 二维数组中修改其中的数据,在线等
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<?php
$text = $_POST['texts'];echo $text;?>
<body>
<form action="123.php" method="post">
<input type="text" id="texts" name="texts" value="" />
<input type="submit" id="submit" value="提交" />
</form>
</body>
</html>
代码经过测试 完全木有问题
$text = $_POST['texts'];
echo $text;
?>
<input type="text" id="texts" name="texts" value="" />
里面的name去掉啊?如果去掉就获取不到了!
这里有name 就可以取到的 要是你改一下 if(isset($_POST[submit])){
$text = $_POST['texts'];
}
这样子 恐怕取不到 因为这里<input type="submit" id="submit" value="提交" />
没有name属性