如何使用php会话修改表单

如何使用php会话修改表单,php,session,Php,Session,我正在尝试使用会话修改表单。我正在尝试一个应用程序,其中用户使用用户名和密码登录。登录后,会显示特定用户的主页,用户可以在其中添加详细信息并修改详细信息。我在修改详细信息时遇到问题。无法显示详细信息来编辑详细信息。从“添加表单”输入的值不会显示在“修改”的文本框中。如何显示详细信息 这是密码 if(isset($_POST['update'])){ mysql_query("UPDATE cvformat SET surname='".$_POST['surname']."', mname='"

我正在尝试使用会话修改表单。我正在尝试一个应用程序,其中用户使用用户名和密码登录。登录后,会显示特定用户的主页,用户可以在其中添加详细信息并修改详细信息。我在修改详细信息时遇到问题。无法显示详细信息来编辑详细信息。从“添加表单”输入的值不会显示在“修改”的文本框中。如何显示详细信息

这是密码

if(isset($_POST['update'])){
mysql_query("UPDATE cvformat SET surname='".$_POST['surname']."', mname='".$_POST['mname']."',pid='".$_POST['pid']."',dob='".$_POST['dob']."',city='".$_POST['city']."',region='".$_POST['region']."', country='".$_POST['country']."', diocese='".$_POST['diocese']."',nationality='".$_POST['nationality']."',fname='".$_POST['fname']."',mothername='".$_POST['mothername']."', edate='".$_POST['edate']."',city2='".$_POST['city2']."',region2='".$_POST['region2']."',country2='".$_POST['country2']."',datef='".$_POST['datef']."', dateo='".$_POST['dateo']."', city3='".$_POST['city3']."',region3='".$_POST['region3']."',country3='".$_POST['country3']."',bishop='".$_POST['bishop']."',tedate='".$_POST['tedate']."',city4='".$_POST['city4']."',region4='".$_POST['region4']."', country4='".$_POST['country4']."', tdirector='".$_POST['tdirector']."',sof='".$_POST['sof']."',decreefv='".$_POST['decreefv']."',fvdate='".$_POST['fvdate']."',city5='".$_POST['city5']."',region5='".$_POST['region5']."', country5='".$_POST['country5']."', cres='".$_POST['cres']."', q1='".$_POST['q1']."',s1='".$_POST['s1']."',y1='".$_POST['y1']."',p1='".$_POST['p1']."',q2='".$_POST['q2']."',s2='".$_POST['s2']."', y2='".$_POST['y2']."', p2='".$_POST['p2']."', q3='".$_POST['q3']."',s3='".$_POST['s3']."',y3='".$_POST['y3']."', p3='".$_POST['p3']."',ca='".$_POST['ca']."',sp='".$_POST['sp']."' where name='".$_SESSION['name']."'")  or die(mysql_error()); 
  };
  $myData= mysql_query("SELECT * FROM cvformat where name='".$_SESSION['name']."'")or die(mysql_error());



while($record = mysql_fetch_assoc($myData)) 
{ 
?>
    <h4 align="right" style="margin-right:170px;">Welcome <?=$_SESSION['name'];?>!<a href="logout.php" style="text-decoration:none;">Logout</a></h4>
<div id="header" align="center"><img src="images/header.png" alt="" /></div>
    <form name="XIForm" id="XIForm" method="POST" action="pdf/pdf1.php">
<table border="0px" cellspacing="0px" cellspacing="10px" align="center" width="700px">



<tr>
<td style="width:200px;"><div class="label"><b >Surname,Name:</b></div></td>
<td><input type="text" name="surname" id="surname" style="width:250px; padding:5px; value="<?php if(isset($_SESSION['name'])) { echo $record['surname']; } ?>">
if(isset($\u POST['update'])){
“更新CV格式格式,并将其用于mysql查询(“更新CV格式格式,并将将将将将将将将其作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为作为,mothername='”“,city2.2.2.2.2.2.2.2.2.2.2.2.2.2.3.2.2.2.3.2.3.2.3.2.3.2.3.2.2.3.2.3.3.2.3.2.3.2.2.3.2.2.3.2.3.2.3.2.2.3.2.3.3.2.3.3.3.3.3.3.3.3.2.3.3.2.3.2.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.....................................................“,bishop=”。“$”POST['bishop']。”,tedate=”。“$”POST“城市4.4=”,区域4.4=““““““““““““““““““““[城市4.4'””””,区域4.4=””“““““[城市4.4'””””””,城市4.4.4'.”””,城市4.4.4.““““,城市4.4.4.4.4.4.”””,城市4.4.4.4.4.4.4=”””““““““““““[城市4.4.4.4.4.4.4.4.4.4.4.4.4.3.4.4.4.4.4.4.4.4.4.4.4.4.4.4.4.4.4.3.4.4.3.4.4.4.4.4.4.”..........城市4.4.4.4.,country5='“$\u POST['country5']。”,cres='”。“$\u POST“1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.$邮政['y3'].'',p3='.'',$邮政['p3'].'',ca='.'',$邮政['ca'].'',sp='.'',$邮政['sp'.'',其中名称='.$会话['name'.'”)或死亡(mysql_error());
};
$myData=mysql\u query(“从cvformat中选择*,其中name='”$\u SESSION['name'].“'))或die(mysql\u error());
而($record=mysql\u fetch\u assoc($myData))
{ 
?>
欢迎
姓、名:
您忘记了
标记。请尝试以下操作-

<input type="text" name="surname" id="surname" style="width:250px; padding:5px; value="<?php if(isset($_SESSION['name'])) { echo $record['surname']; } ?>">
试试这个:

while($record = mysql_fetch_assoc($myData)) 
{ 
?>
<h4 align="right" style="margin-right:170px;">Welcome <?php echo $record['name'];?>!<a href="logout.php" style="text-decoration:none;">Logout</a></h4>
<div id="header" align="center"><img src="images/header.png" alt="" /></div>
<form name="XIForm" id="XIForm" method="POST" action="pdf/pdf1.php">
<table border="0px" cellspacing="0px" cellspacing="10px" align="center" width="700px">



<tr>
<td style="width:200px;"><div class="label"><b >Surname,Name:</b></div></td>
<td><input type="text" name="surname" id="surname" style="width:250px; padding:5px; value="<?php echo $record['surname']; ?>">

<?PHP } ?>
while($record=mysql\u fetch\u assoc($myData))
{ 
?>
欢迎
姓、名:

我应该在哪里添加此内容?无需检查
$\u SESSION['name']
。因为您已经从
while($record=mysql\u fetch\u assoc($myData))
中获得
$record['name']
,所以直接写入
值=
我已经尝试了同样的方法。
之后我没有得到它($record=mysql\u fetch\u assoc($myData)){
检查
while
loopuse
echo mysql\u num\u rows($myData);
之前
while
显示从表中提取的行数。然后您肯定会从
cvformat
表中获取详细信息。使用
print\r($record)
显示您从表中获取的内容。它显示..但如何在特定文本框中显示,但在文本框内它不显示使sour fetched
$record
姓氏
列名与数据库表列名相同。