Jump to content

Recommended Posts

I have an authenication system that works great on my test machine (XP Pro, IIS) however when I move the login page to the production server (2003, Apach2) it hangs. There are no errors in the apache logs, but it seems to be ignoring the HTTP::redirect command. I can manually go to the index after the login and it works, so the session variables are being set, I am just not getting redirected on the apache server.

Both servers have PHP5.1.2 and HTTP 1.4.0.

Any ideas what is going on

Code:
<?php

require_once('HTML/QuickForm.php');
include('inc/db.php');
require_once('HTTP.php');

//Function
function login() {


$result = user_login($_POST['username'], $_POST['password']);
if ($result != 'Correct') {
$login_fail = $result;
HTTP::redirect("login.php");
}
else {
HTTP::redirect("index.php");
}
}
//Display Form
$form = new HTML_QuickForm('frmTest', 'post');
//Header
$form->addElement('header', 'MyHeader', 'Please Login');
//Form Input
$form->addElement('text', 'username', 'Username');
$form->addElement('password', 'password', 'Password');
//Submit
$form->addElement('submit', 'btnSubmit', 'Submit');
//PHP Validation
$form->addRule('username', 'Your name is required', 'required');
$form->addRule('password', 'Your password is required', 'required');
//Example of Javascript validation
$form->addRule('password', 'Maximum postcode 8 characters', 'maxlength', 8, 'client');
//Checking Validation
if ($form->validate()) {
# If the form validates then freeze the data
$form->freeze();
$form->process('login', false);
echo "\n<HR>\n";
}

$form->display();
?>
Link to comment
https://forums.phpfreaks.com/topic/4343-help-pear-httpredirect/
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.