php 中关于页面间传值出了问题,请各位指点

来源:百度知道 编辑:UC知道 时间:2024/05/17 06:28:45
<?php session_start(); include("conn/conn.php");?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>单条数据更新</title>
<style type="text/css">
<!--
.STYLE1 {font-size: 12px}
-->
</style>
</head>

<body>
<table width="535" height="264" border="0" cellpadding="0" cellspacing="0" background="images/bg.jpg">
<tr>
<td width="55" height="106"> </td>
<td width="325"> </td>
<td width="55"> </td>
</tr>
<tr>
<td height="125"> </td>
<td align="left" valign="top"><table width="425" border=&

呵呵。热闹。我来讲一下。
他说的问题很简单看他的两个语句就知道了:
<form name="form1" method="post" action="index_ok.php?lmbs=<?php echo $sid;?>"> 和if($lmbs==true){
$sid=$_POST[sid];

修改方法很简单主要是搞清楚$lmbs和$sid。
按你的思路可以改成if($_POST['imageField']){
$sid=$_GET['lmbs'];
我一般习惯是:
$sid=$_GET['lmbs'];
if(is_set($sid)&&$sid>0){
恩大概是这样。
非常明显你不是纯粹的PHP新手,对于网络编程都是不很熟悉应该。
以后书写要多多了解安全问题哦
你看我如果手动修改lmbs=的value的话就会把别人的infomation给update掉

(1)。if($query==true) 简单写出if($query) 会自动判断的。
(2)。$sid=$myrow[id]; 这句多余,没必要写。
(3)action="index_ok.php?lmbs=<?php echo $sid;?>" 我想你的意思 是想把表单提交并且把数据传到另个页面吧!
这样是否能提交成功我没用过。书上大多是说用隐含元素提交,在表单下面
<input type="hidden" name="hidden" value="<?php echo $sid ; ?>" />
表单的action 提交到相应的页面。
(4)。$_POST[sid]; 写成$_POST['sid'] 规范,而且速度快些,我看书上这么说的,没测试,也不知道怎么测试!
(5)。我也是新手,希望对你有作用!<