今天写了一个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>
<?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>
是说点击这个编辑没有反应吗?没有给加链接啊,如何反应?
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>