|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Unknown Error
Forgive my ignorance, I have had to start learning php, sql, etc with this new job. I'll start out like this: Our intranet is red hat linux using php and mysql to manage it, unfortunately I did not write it.
The problem: All the links work fine, except on occasion, We use a generic guest login to access the intranet, which links you to the main page. You then click on the desired link and this will take you back to the login page. You can do this a 100 times, close your browser, reopen, relogin, and it works fine. Now keep in mind this is random and does not happen all the time??? Our backbone is W2K Enterprise, the Intranet is RH 8.?? using PHP 4. There is really no error code, just wondering if some can point something out to me. Due to where I work I can only post pieces of the code, here it is: addlink.php <?php include('inc/database.inc'); $queryres = sql_query("SELECT destination FROM ".$db_table_prefix."ads WHERE host='".$host."'"); $row = sql_fetch_row($queryres); if($host != '' && $row[0] != '') { sql_query("UPDATE ".$db_table_prefix."ads SET counter=counter + 1 WHERE host='".$host."'"); header ("Location: ".$row[0]); exit; } ?> The login screen is basic HTML and posting is done like this --> ACTION="<?php print($PHP_SELF); ?>" The login button has standard attributes and uses this --> value="<?php print($login); ?>" Any help would be appreciated, sorry for the nasty description of the problem. Your Psuedo Red Hat Linux Administrator.....and other stuff. |
|
#2
|
|||
|
|||
|
RE: Unknown Error
I am not getting what the problem is, am I missing something?
|
|
#3
|
|||
|
|||
|
RE: Unknown Error
Sorry, Usually you login, choose and click the link to where you need to go, and everything works fine.
Ocassionaly, you login, choose and click the same link, only it doesn't send you to the proper page, it boots you back to the login screen. The randomness of this is odd? Almost as if it is recursing itself when it feels like it. |
|
#4
|
|||
|
|||
|
RE: Unknown Error
what do you use to track the user after login, Sessions or Cookies?
|
|
#5
|
|||
|
|||
|
RE: Unknown Error
I just finished scanning the code, so I am going to assume were using sessions. Sorry for the constant and incomplete information.
|
|
#6
|
|||
|
|||
|
RE: Unknown Error
If you are using sessions and you get kicked back to the login page, it means that either the session is expiring, or the the code that validates the that a user is logged on on the target page is failing. I can't see all your code, but see if you can recreate theproblem again and then take a look at the pages that are involved. That is pretty much all I can suggest right now.
|
|
#7
|
|||||
|
|||||
|
RE: Unknown Error
Stupid me, sorry forgot the php tags, here is the code I am using to add links...
php Code:
|
|
#8
|
|||
|
|||
|
RE: Unknown Error
I don't think the way you are constructing the links or the login is the problem. Not sure how the site was constructed, but if you are using sessions, each page should have a piece of code on it that checks the session variables to make sure the user is properly logged in. Try to loczate that code and see if there might be a problem on some of the target pages that would cause the user to be logged off.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Unknown Error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|