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>