<?php // Script 9.5 - login.php (third version after Scripts 8.8 and 8.13)
// This page lets people log into the site.
// Address error handing.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
// Set the page title and include the header file.
define ('TITLE', 'Login'); اذا وضعت هذي الجمله تعليق
require ('templates/header.html');وايضا هذي الجمله
// Basic HTML formatting stuff.
print '<div id="leftcontent">
<h1>Login Form</h1>
<p>Users who are logged in can take advantage of certain features like this, that, and the other thing.</p>';
// Check if the form has been submitted.
if ( isset ($_POST['submit'])) {
// Handle the form.
if ( (!empty ($_POST['username'])) && (!empty ($_POST['password'])) ) {
if ( ($_POST['username'] == 'testing') && ($_POST['password'] == 'testpass') ) { // Okay.
// Do session stuff.
session_start();
$_SESSION['username'] = 'testing';
$_SESSION['loggedin'] = time();
// Redirect the user to the welcome page!
header ('Location: welcome.php');
exit();
} else { // Not okay.
print '<p>The submitted username and password do not match those on file!<br />Go back and try again.</p>';
}
} else { // Forgot a field.
print '<p>Please make sure you enter both a username and a password!<br />Go back and try again.</p>';
}
} else {
// Display the form.
print '<form action="login.php" method="post"><p>
Username: <input type="text" name="username" size="20" /><br />
Password: <input type="password" name="password" size="20" /><br />
<input type="submit" name="submit" value="Log In!" /></p>
</form>';
}
// Complete the HTML formatting stuff.
print '</div>';
require ('templates/footer.html'); // Need the footer.وهذي الجمله ..
?>
وحطيت بدالها صيغة html يعني بديت ب html بعدين الهيد والتايتل وقفلته اخر شي بس الاوت بوت مايطلع ..
ساعدوني بليز :(