Hello!

I have a problem with a login page. Everything works perfectly when run on localhost but it won't work on my live server. When the login is correct the user should be directed to the requested page. But on the live server it just refers back to login.php. The problem seems to be with the query string.

The query string on my localhost is:
online_photos/image_uploader.php

But on my live server it gets changed to login:
login.php?accesscheck=%2Fimage_uploader.php

localhost print_r($_SESSION) returns username and user group only. But on the live server it returns the previous URL and no username or user group .

localhost print_r($_SERVER) returns:

  [REQUEST_METHOD] => GET
    [QUERY_STRING] => 
    [REQUEST_URI] => /online_photos/login.php?
    [SCRIPT_NAME] => /online_photos/login.php
    [PATH_TRANSLATED] => c:/program_files/www/online_photos/login.php
    [PHP_SELF] => /online_photos/login.php
    [REQUEST_TIME] => 1140111568
    [argv] => Array
        (
        )

[argc] => 0

But on the live server it returns:

[REQUEST_METHOD] => GET
    [QUERY_STRING] => accesscheck=%2Fimage_uploader.php
    [REQUEST_URI] => /login.php?accesscheck=%2Fimage_uploader.php
    [SCRIPT_NAME] => /login.php
    [PATH_TRANSLATED] => /home/cberry/public_html/test1/login.php
    [PHP_SELF] => /login.php
    [argv] => Array
        (
            [0] => accesscheck=%2Fimage_uploader.php
        )

[argc] => 1

On localhost print_r($_POST) and print_r($_GET) returns empty arrays. But on the live server print_r($_GET) returns [accesscheck] => /image_uploader.php, $_POST is empty.

With the exception of the mysql_select_db information the code is identicle and there is no problem with the db connection.

I don't really know what [argc] and [argv] are but I guess that's something to do with the problem.

As always any help would be really appreciated! You all rock and I've learnt so much thanks to this awesome forum!

    Write a Reply...