php同页面传值怎么写?
我想要的效果是
<table>
<?php $i=1;
do { ?>
<tr>
//标题
<td><a href="default_task_edit.php?editID=<?php echo $row_Recordset_task['TID']; ?>" ><?php echo $row_Recordset_task['csa_title']; ?></a></td>
</tr>
<?php $i=$i+1;
} while ($row_Recordset_task = mysql_fetch_assoc($Recordset_task));
?>
</table>
</td>
<td rowspan="2" width="80%" align="center"><?php echo $multilingual_neirong; ?>
//在这里显示标题所相关的内容,内容在在、数据库的值为$row_Recordset_task['csa_text']
</td>
[解决办法]
你是不要页面刷新么 那就用ajax 或者笨点的方法就是做个跟原来页面样式一样的新页面 跳转到这个新页面 跟原来的界面差不多 视觉上好像是没刷新一样
[解决办法]
同意楼上 用ajax!!!
[解决办法]
<?php/* Created on [2012-5-16] Author[yushuai.niu] */#查询标题信息$sql="select * from table"; $res=mysql_query($sql); if(!$res) die("SQL: {$sql} <br>Error:".mysql_error()); if(mysql_affected_rows() > 0){ $titles = array(); while($rows = mysql_fetch_array(MYSQL_ASSOC)){ array_push($titles,$rows); } }?><table border=1><?php foreach($titles as $row_Recordset_task){ ?> <tr> <td> <a href="javascript:void(0)" onclick="record(<?=$row_Recordset_task['TID']?>)" > <?=$row_Recordset_task['csa_title']?> </a> </td> </tr><?php } ?></table><div id="show"></div><script>//Ajaxvar xmlHttp; function createXMLHttpRequest() { if(window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } } function record(id){ createXMLHttpRequest(); url = "action.php?id="+id+"&ran="+Math.random(); method = "GET"; xmlHttp.open(method,url,true); xmlHttp.onreadystatechange = showList; xmlHttp.send(null); } function show(){ if (xmlHttp.readyState == 4){ if (xmlHttp.status == 200){ var text = xmlHttp.responseText; document.getElementById("show").innerHTML = text; }else { alert("response error code:"+xmlHttp.status); } } }</script><?php#action.phpif(isset($_GET['id'])){ $sql="select * from table where id=".$_GET['id']; $res=mysql_query($sql); if(!$res) die("SQL: {$sql} <br>Error:".mysql_error()); if(mysql_affected_rows() > 0){ $rows = mysql_fetch_array(MYSQL_ASSOC); } print_r($rows); mysql_close();}?>
[解决办法]
学习了