LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1409|回复: 6

请教各位兄弟一个关于php的问题

[复制链接]
发表于 2003-12-13 09:16:26 | 显示全部楼层 |阅读模式
我的系统为Redhat9.0,php为系统自带的4.22版
/*post.html*/
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=GB2312">
<title>留言板</title>
</head>
<body>
<form method="post" action="show.php">
<div align="center"><center><table border="0" width="80%" cellspacing="1">
<tr>
<td width="11%" bgcolor="#C0C0C0"><strong>笔名</strong></td>
<td width="89%"><input type="text" name="username" size="20"></td>
</tr>
<tr>
<td width="11%" bgcolor="#C0C0C0"><strong>E-Mail</strong></td>
<td width="89%"><input type="text" name="email" size="20"></td>
</tr>
<tr>
<td width="11%" bgcolor="#C0C0C0" valign="top"><strong>留言</strong></td>
<td width="89%"><textarea rows="4" name="message" cols="36">
</textarea><br>
<input type="submit" value="送出" name="B1"><input type="reset" value="重填"
name="B2"></td>
</tr>
</table>
</center></div>
</form>
</body>
</html>
/*show.php*/
<?php
echo "笔名username<br>";
echo "E-Mailemail<br>";
echo "留言:<br>$message";
?>
lynx 192.168.1.6/nyb/post.html可是表单数据提交不到$username,$email,
$message
发表于 2003-12-13 17:08:22 | 显示全部楼层
我一般是修改配置文件:
register_globals = On
默认是Off,我也刚开始学,PHP推荐使用另外的方法,我还没看呢
发表于 2003-12-14 14:11:07 | 显示全部楼层
<?php
echo "笔名_POST['username']<br>";
echo "E-Mail_POST['email']<br>";
echo "留言:<br>$_POST['message']";
?>
 楼主| 发表于 2003-12-23 01:05:59 | 显示全部楼层
我按cx6445兄的方法试了下还是不行,libinary兄能详细的说下是哪个配置文件不
发表于 2003-12-23 12:42:03 | 显示全部楼层
我的方法是不可能错的,post就是这么传递变量的,可能有些细节你没注意。
发表于 2003-12-24 16:02:08 | 显示全部楼层
http://domain/pathtoscript/scrip ... p;message=mymessage

就可以使用不用$_POST了例子了

使用$_POST以后,就要用form方式提交数据

我的就是这样的,可以用
 楼主| 发表于 2003-12-29 15:39:56 | 显示全部楼层
谢谢各位兄弟的热心帮助,问题终于解决了,cx6445兄说得方法是正确的,不过可能是编译环璄的问题在Redhat9.0自带的php4.2的编译环璄中上面的变量的表示方式要改成
<?php
echo "笔名_POST[username]<br>";
echo "E-Mail_POST[email]<br>";
echo "留言:<br>$_POST[message]";
?>
希望各位兄弟能把自已学习PHP的心得传上来一起分享
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表