Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMUZ140818 Tinashe Mapondera
4,912 Pointsnothing displays when i do "myserver_address/project_folder/index.php"
Here is my code for my index.php can someone help please:
<?php include_once 'incl/db_connect.php'; include_once 'incl/functions.php';
sec_session_start();
if (login_check($mysqli) == true) { $logged = 'in'; } else { $logged = 'out'; }
?>
<!DOCTYPE html>
<html>
<head>
<title>Secure Login: Log In</title>
<link rel="stylesheet" href="styles/main.css" />
<script type="text/JavaScript" src="js/sha512.js"></script>
<script type="text/JavaScript" src="js/forms.js"></script>
</head>
<body>
<?php
if (isset($_GET['error'])) {
echo '<p class="error">Error Logging In!</p>';
}
?>
<form action="incl/process_login.php" method="post" name="login_form">
Email: <input type="text" name="email" />
Password: <input type="password" name="password" id="password"/>
<input type="button" value="Login" onclick="formhash(this.form, this.form.password);" />
</form>
<?php if (login_check($mysqli) == true) { echo '<p>Currently logged ' . $logged . ' as ' . htmlentities($_SESSION['username']) . '.</p>';
echo '<p>Do you want to change user? <a href="incl/logout.php">Log out</a>.</p>';
} else {
echo '<p>Currently logged ' . $logged . '.</p>';
echo "<p>If you don't have a login, please <a href='register.php'>register</a></p>";
}
?>
</body>
</html>
2 Answers
Michalis Efstathiou
Courses Plus Student 4,638 Pointsdo you just get a blank page? or do you get an error?
MUZ140818 Tinashe Mapondera
4,912 PointsNo error, its just blank. Not even showing the page name on the browser