php新手问题,,急,请高手帮忙!

huangshenghui1 2009-11-08 04:58:58
今天写了一个php注册的代码

这个事登陆后的代码,能实现:
<?php

session_start();

if($_SESSION["name"]==""){

echo "<script>location.href='index.php';</script>";

exit;
}
//上面的要验证过滤的
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理页面</title>
<style type="text/css">
<!--
.style1 {color: #009900}
-->
</style>
</head>

<body><center>
<p> </p>
<p> </p>
<p> </p>
<table width="58%" height="186" border="0" cellpadding="0" cellspacing="2" bgcolor="#FFFFFF">
<tr>
<td align="center" bgcolor="#CCCCCC"><strong>管理中心</strong>(display.php)</td>
</tr>
<tr>
<td align="center" bgcolor="#CCCCCC"><?php echo $_SESSION["name"]?><span class="style1">欢迎您的到来</span>!</td>
</tr>

<tr>
<td align="center" bgcolor="#CCCCCC"><a href="login_out.php">退出</a>(login_out.php)|<a href="user_edi.php?name=<?php echo $_SESSION["name"]?>">编辑个人资料</a>(user_edi.php)</td>
</tr>
</table>
</center>

</body>
</html>


下面就是问题:点击编辑个人资料的时候是空白页,(进不了我想要的界面)请高人之处错误之处,小弟万分感谢!
<?php

session_start();
if($_SESSION["name"]==""){

echo "<script>location.href='index.php';</script>";
exit;
//这里是SESSION来验证用户的合法性
}
include("config.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>activeworlds系统修改平台</title>
</head>

<body><center>
<?php
$s_id=$_GET["s_id"];
$db=mysql_connect($servername,$sqlservername,$sqlserverpws) or die("数据库连接失败");
mysql_select_db($sqlname,$db);
$sql="select * from $sqltable where s_id='$s_id'";
$conn=mysql_query($sql) or die(mysql_error());
while($rs=mysql_fetch_array($conn)){
?>
<form name="form1" method="post" action="user_edi_cl.php"><table width="68%" height="304" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr align="center" bgcolor="#CCCCCC">
<td colspan="2">编辑(user_edi.php)||<a href="display.php">返回</a></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="29%" align="right">用户名:</td>
<td width="71%" align="left"><?=$rs["s_id"]?></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="29%" align="right">姓名:</td>
<td width="71%" align="left"><?=$rs["s_name"]?></td>
</tr>
<tr bgcolor="#CCCCCC">
<td align="right">密码:</td>
<td align="left"><input name="s_pws" type="password" id="s_pws" value="<?=$rs["s_pws"]?>"></td>
</tr>
<tr bgcolor="#CCCCCC">
<td align="right">邮件:</td>
<td align="left"><input name="s_email" type="text" id="s_email" value="<?=$rs["s_email"]?>"></td>
</tr>
<tr bgcolor="#CCCCCC">
<td align="right">默认地:</td>
<td align="left"><input name="s_entryAddress" type="text" id="s_entryAddress" size="40" value="<?=$rs["s_entryAddress"]?>"></td>
</tr>
<tr align="center" bgcolor="#CCCCCC">
<td colspan="2"><input type="submit" name="Submit" value="提交">  
<input type="reset" name="Submit" value="重置"></td>
<input type="hidden" name="id" value="<?=$rs["s_id"]?>">
</tr>
</table>

</form>
<?php
}
mysql_close();
exit;
?>
</center>

</body>
</html>
...全文
129 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
huangshenghui1 2009-11-10
  • 打赏
  • 举报
回复
谢谢大家,我找到了。我是把get里面的参数写错了。
lengwenjun 2009-11-10
  • 打赏
  • 举报
回复
从零开始学习PHP,从最基本的环境搭建开始到完整大型项目的开发。手把手免费教学。自开课以来得到大家的广泛和一致好评。该QQ群已经满了 下载已经升为高级群 目前仅能再次容纳53位会员的加入了 名额有限 如果有志学习PHP的朋友 请赶快加入吧 抓紧着最后一次学习机会 QQ群是: 85140816
cocos精品源码 2009-11-08
  • 打赏
  • 举报
回复
仔细查看代码可能是哪里写错了
elbingchuan 2009-11-08
  • 打赏
  • 举报
回复
按下面的试试:
1、少了一个冒号, <a href="user_edi.php?name= <?php echo $_SESSION["name"];?>">编辑个人资料 </a>(user_edi.php) </td>
2、没有用<a>和</a>,<td colspan="2"><A href="user_edi.php">编辑</a>(user_edi.php)|| <a href="display.php">返回 </a> </td>

qtffly 2009-11-08
  • 打赏
  • 举报
回复
编辑(user_edi.php)|| ??这个是什么意思。<a href="user_edi.php">编辑</a>不就指向user_edi.php链接了啊
luoryan 2009-11-08
  • 打赏
  • 举报
回复
<a href="user_edi.php">编辑
江南昆虫 2009-11-08
  • 打赏
  • 举报
回复
请在浏览器内右键查看源文件...
huangshenghui1 2009-11-08
  • 打赏
  • 举报
回复
是啊,反应为空白页,高手请解释下
polarisfall 2009-11-08
  • 打赏
  • 举报
回复
<td colspan="2">编辑(user_edi.php)|| <a href="display.php">返回 </a> </td>
是说点击这个编辑没有反应吗?没有给加链接啊,如何反应?

21,891

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧