在会话中使用帖子后没有显示的表单

时间:2016-12-30 17:43:17

标签: php post login

作为php的初学者我使用互联网脚本来创建一个网站并学习PHP。我使用过的脚本 http://www.wikihow.com/Create-a-Secure-Login-Script-in-PHP-and-MySQL

它完美无缺。但我有一个名为profile的表单来从mysql中获取用户配置文件数据。在获取和编辑之后,使用postws将其发送到同一个php页面来处理并更新到我的sql。

表单在没有登录脚本的情况下工作但是当我第一次使用登录脚本加载配置文件页面时它工作正常但是当我提交页面时它会在执行该行时停止。页面的其余部分是空白的。

我已将登录变量$ mysqli替换为$ mysqlil,因为我的表单脚本也使用了$ mysqli

我做错了什么?



<head><?php
include_once 'includes/db_connect.php';
include_once 'includes/functions.php';

sec_session_start();}
?>
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"/>
<!-- your webpage info goes here -->

  
        <script type="text/JavaScript" src="js/sha512.js"></script> 
        <script type="text/JavaScript" src="js/forms.js"></script> 
<!-- you should always add your stylesheet (css) in the head tag so that it starts loading before the page html is being displayed -->	
	<link rel="stylesheet" href="/style.css" type="text/css" />
	
</head>
<body>

<!-- webpage content goes here in the body -->

	<div id="page">
		
		</div><div id="kv">
 <img src="Images/logo.gif" alt="o"/>
 </div>
 <div id="logo"><?php
	echo "welkom " . htmlentities($_SESSION['username'])
?></div>
		<div id="nav">

<?php include('head.php'); ?>//some hrefs but no php
	
		</div>
		<div id="content">			<h2>Profiel</h2>

			 
            
            <div id="profielcentre">
            <?php if (login_check($mysqlil) == true) : ?>  
            
            
            <?php
            include ("Connection.php");
            $user = ($_SERVER['PHP_AUTH_USER']);
            $sql = "SELECT * FROM*** where loginname = '" . htmlentities($_SESSION['username']) . "'" ;
        if (!$result = $mysqli->query($sql)) {
     
    
     #  echo "Error: Our query failed to execute and here is why: \n";

    echo "Website Fout. Probeer het later nog eens!.";
    exit;
}
if ($result->num_rows === 0) {
      
    echo "<br>Uw gegevens zijn niet bekend of uw bent niet ingelogd! ";
    echo "<br> ";
    echo "<br>Stuur een email naar de " ?>  <a href="mailto:xl@x.nl">Webmaster</a><?;
  
    exit;
}
$Lid = $result->fetch_assoc();

   
form code that is working ok. deleted for better reading


  return $data;
}
?>

<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">

<table>

  <tbody>
 <tr>
       

the form in a table. deleted for better reading


       <td style="width:15%"><? echo  "" ; ?></td>

   </tr>
   <tr><td><input type="submit" name="Submit" value="Wijzigingen opslaan" ></td> <td>

<? if ($_SERVER["REQUEST_METHOD"] == "POST"){

if ($VoornaamErr == "" and $VoorlettersErr == "" and $TussenvoegselErr ==  "" and $AchternaamErr ==  ""
 and $AdresErr ==  "" and  $PostcodeErr ==  "" and $WoonplaatsErr ==   "" and $LandErr ==  "" and $TelefoonErr ==  "" 
 and $EMailErr ==  "" and $GeslachtErr ==  "" and $GeboortedatumErr ==  "" and $MobielErr ==  ""
 and $BSNErr ==  "" and $BeroepErr ==  "" and $FunktieErr == ""){ include ('Saveprofile.php');
 
 }  else { 
    echo "Niet alle velden zijn correct ingevuld!" ;}
    }
 ?></td><td></td><td>* required field.</td>
   </tr>
</form>
    
                                  
  <? unset ($lid) ;
 
    ?>   
  </tbody>
</table></form>
</div> 

            
            
            </div>
            </div>
				
			</p>
		</div>
        
        				        <?php else : ?>
            <p>
                <span class="error">U bent niet ingelogd.</span> klik <a href="login.php">hier om in te loggen</a>.
            </p>
        <?php endif; ?>
			</p>
		<div id="footer">
			<p>
				Webpage made by <a href="mailto:x@x.nl" target="_blank">[Mp]</a> Copyright 2016 by Mpp
			</p>
		</div>
	</div>

</body>
</html>
&#13;
&#13;
&#13;

0 个答案:

没有答案