dongxuxian6930 2016-12-30 17:43
浏览 28

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

as beginner in php i an using internet scripts to create a website and learn php. i have used the scripts from http://www.wikihow.com/Create-a-Secure-Login-Script-in-PHP-and-MySQL

it is working perfect. but i hava a form called profile to fetch the user profile data from mysql. after fetching and editing it usews post to send it to the same php page to process and update to my sql.

the form is working without the login script but when i use the login script the first time i load the profile page it is working perfect but when i submit the page it is stopping when the line is executed. the rest of the page is blank.

i have replaced the login variable $mysqli into $mysqlil because my form script use $mysqli also

what am i doing wrong?

<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: 
";

    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>

</div>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 用windows做服务的同志有吗
    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图