MikeKohler
Technical User
Hi, I have the following code:
<?php
ob_start();
?>
<body>
<?php // Script 8.8 - login.php
// This page lets people log into the site.
// Address error handling.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
// Set the page title and include the header file.
define ('TITLE', 'Login');
// Basic HTML formatting stuff.
print '<div id="leftcontent">
<h1>Login Form</h1>
<p>For Security Reasons it is necessary to log in before uploading your file.</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'] == 'test') && ($_POST['password'] == 'test') ) { // Okay.
header ('Location: ob_end_clean();
} else { // Not okay.
I don't get any errors, but I don't get the response I was looking for. The page simply turns blank and the address shows as being still on the login page.
Thank you,
Michael Kohler
I changed the url of the page that this code redirects to. newpage doesn't exist, no offense, but I didn't want anybody going to my upload page without there being any security.
<?php
ob_start();
?>
<body>
<?php // Script 8.8 - login.php
// This page lets people log into the site.
// Address error handling.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
// Set the page title and include the header file.
define ('TITLE', 'Login');
// Basic HTML formatting stuff.
print '<div id="leftcontent">
<h1>Login Form</h1>
<p>For Security Reasons it is necessary to log in before uploading your file.</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'] == 'test') && ($_POST['password'] == 'test') ) { // Okay.
header ('Location: ob_end_clean();
} else { // Not okay.
I don't get any errors, but I don't get the response I was looking for. The page simply turns blank and the address shows as being still on the login page.
Thank you,
Michael Kohler
I changed the url of the page that this code redirects to. newpage doesn't exist, no offense, but I didn't want anybody going to my upload page without there being any security.