Jump to content

login fail


Blewis917

Recommended Posts

hey guys i found some script for my website to force users to login without be able to just type in the webpage and when a user and my self trys to login the page just reloads and then it sends me a error message. this is the script that im found and that i am using for the login success page that checks the verify page before anyone is aloowed to login.

 

This is at the top of the login_success page

 

<?php

require_once ('verify.php');

$page_title = 'YOUR PAGE TITLE GOES HERE';

 

// Start output buffering:

ob_start();

 

// Initialize a session:

session_start();

 

// Check for a $page_title value:

if (!isset($page_title)) {

$page_title = 'User Registration';

}

 

// If no first_name session variable exists, redirect the user:

if (!isset($_SESSION['first_name'])) {

 

$url = BASE_URL . ''; // Define the URL.

ob_end_clean(); // Delete the buffer.

header("Location: $url");

exit(); // Quit the script.

 

}

?>

 

 

 

This code is at the bottom of the page.

 

<?php // Flush the buffered output.

ob_end_flush();

?>

 

 

 

This is the full code on the verify

 

<?php

 

// Flag variable for site status:

define('LIVE', TRUE);

 

// Admin contact address:

define('EMAIL', 'domain@domain.com');

 

// Site URL (base for all redirections. This is the address they will be redirected to if they try to access a protected page and they are not logged in.):

define ('BASE_URL', 'http://www.host.com');

 

// Location of the MySQL connection script:

define ('MYSQL', 'db.php');

 

 

// Create the error handler:

function my_error_handler ($e_number, $e_message, $e_file, $e_line, $e_vars) {

 

// Build the error message.

$message = "<p>An error occurred in script '$e_file' on line $e_line: $e_message\n<br />";

 

// Add the date and time:

$message .= "Date/Time: " . date('n-j-Y H:i:s') . "\n<br />";

 

// Append $e_vars to the $message:

$message .= "<pre>" . print_r ($e_vars, 1) . "</pre>\n</p>";

 

if (!LIVE) { // Development (print the error).

 

echo '<div class="error">' . $message . '</div><br />';

 

} else { // Don't show the error:

 

// Send an email to the admin:

mail(EMAIL, 'Site Error!', $message, 'From: domain@domain.com');

 

// Only print an error message if the error isn't a notice:

if ($e_number != E_NOTICE) {

echo '';

}

} // End of !LIVE IF.

 

} // End of my_error_handler() definition.

 

// Use my error handler.

set_error_handler ('my_error_handler');

 

 

?>

 

this code just will not let me login at all and i just keep on.

 

this is th eroor message that i kkep on getting

 

 

        Error Message

 

 

<p>An error occurred in script '/hermes/bosweb/web166/b1662/glo.blewis917/members/login_success.php' on line 9: session_start() [<a href='function.session-start'>function.session-start</a>]: open(/var/php_sessions/sess_589e0dd4509ddd659b1dee0bf6d167e5, O_RDWR) failed: No such file or directory (2)<br />Date/Time: 3-4-2011 16:43:48<br /><pre>Array([GLOBALS] => Array*RECURSION*[_ENV] => Array([PATH] => /usr/local/bin:/usr/bin:/bin[sCRIPT_NAME] => /members/login_success.php[REQUEST_METHOD] => GET

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.