Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old October 14th, 2003, 01:13 PM
Virgo Virgo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 Virgo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old October 14th, 2003, 02:23 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Unknown Error

I am not getting what the problem is, am I missing something?

Reply With Quote
  #3  
Old October 14th, 2003, 02:39 PM
Virgo Virgo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 Virgo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old October 14th, 2003, 05:04 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Unknown Error

what do you use to track the user after login, Sessions or Cookies?

Reply With Quote
  #5  
Old October 14th, 2003, 05:47 PM
Virgo Virgo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 Virgo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.


Reply With Quote
  #6  
Old October 14th, 2003, 08:42 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
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.

Reply With Quote
  #7  
Old October 14th, 2003, 09:02 PM
Virgo Virgo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 Virgo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Unknown Error

Stupid me, sorry forgot the php tags, here is the code I am using to add links...

php Code:
Original - php Code
  1.  
  2. addlink.php
  3. <?php
  4. include('inc/database.inc');
  5. $queryres = sql_query("SELECT destination FROM ".$db_table_prefix."ads WHERE host='".$host."'");
  6. $row = sql_fetch_row($queryres);
  7. if($host != '' && $row[0] != '') {
  8. sql_query("UPDATE ".$db_table_prefix."ads SET counter=counter + 1 WHERE host='".$host."'");
  9. header ("Location: ".$row[0]);
  10. }
  11. ?>
  12.  
  13. here is the login screen, it is a basic HTML form and posting is done like this --> ACTION="<?php print($PHP_SELF); ?>"
  14.  
  15. The login button has standard attributes and uses standard values except for this --> value="<?php print($login); ?>"



Reply With Quote
  #8  
Old October 14th, 2003, 11:57 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
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.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Unknown Error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT