Page 1 of 1

Secure form using sessions issue!!

Posted: Sat Feb 13, 2010 6:07 pm
by cap2cap10
Hello for the umpteenth time, php technorati. I am trying to create a login page that automaticaly redirects you to a form. How do I fool my sessions script into accepting the username and password variables with out having them submitted via a form submit button? Here is the script I have but it does not work:

Code: Select all

<?php
 
$_SESSION['login_username']= $_POST['**********'];
$_SESSION['login_password']= $_POST['***********'];
include "sessions.php";
if( ($login->authorised()) )
    if($login->didLogin())
        if($login->getType() == 2)
            header("Location: recruit.php");
    if($login->didFail())
            header("Location: join.php");
            
 
?>
I want this script to automatically redirect me to the recruit.php form.

As always, thanks in advance

Batoe

Re: Secure form using sessions issue!!

Posted: Sat Feb 13, 2010 6:34 pm
by requinix
You need to call session_start before you can do anything with sessions.

I'm guessing sessions.php has that, so it needs to be included before anything else.