One-Uppery - PHP/Server Help

AnnesAnnes Tripped Up by Libidos and HubrisAlexandria, VA Icrontian
edited July 2006 in Internet & Media
Alright guys! Time for the one-uppery! This exact question was posted to DevShed, where there was no help (or replies!) to be found. It's quite important to figure out the cause of this problem due to the fact that this server needs to be in working order ASAP.


I'm not sure how to word this problem - but here we go.

Our Intranet server recently died Now we're rebuilding, but the person who built the first server didn't document the settings for PHP so we're fumbling.

Basically we're having issues with sessions. We keep getting undefined variable errors related the session variables and global variables like (HTTP_REFERER).

Also it looks like when you visit a page 3 sessions are started - I don't know if it's a programming error (since I don't know if this was happening before) but one session is blank and the other 2 have information in them (one has the information of a logged in user and the other information of a logged out user).

[php][root@intranet conf.d]# ls -o /var/lib/php/session/ total 8
-rw
1 nobody 694 Jul 11 18:05 sess_229b4459f3534b858def4045e7fdab23
-rw
1 nobody 0 Jul 11 18:05 sess_61a370777c3a71d68469983c77dd3e9d
-rw
1 nobody 1001 Jul 11 18:05 sess_890fadd676b36c6ce590b784404e67b8
[root@intranet conf.d]#

==================== contents =========================================================
[root@intranet conf.d]# cat /var/lib/php/session/sess_229b4459f3534b858def4045e7fdab23
ltitle|s:5:"Login";lbody|s:632:"<b></b><form action="/login.php"
ltitle|method="post">
<table border="0" align="center" cellpadding="2" cellspacing="2"> <tr> <td>ID</td> <td><input size="8" name="user" type="text"></td> </tr> <tr> <td>Pass</td> <td><input size="8" name="pass" type="password"></td> </tr> <tr> <td><input type="checkbox" name="remember"> </td> <td>Remember me</td> </tr> <tr> <td> </td> <td><input type="hidden" name="rURL" value="http://intranet/login.php"><input type="submit" name="sublogin" value="Login" class="blog" onmouseover="this.className='blog bloghov'" onmouseout="this.className='blog'" /></td> </tr> </table> </form> ";id|N;name|N;email|N;group|N; ================================================================================
[root@intranet conf.d]# cat /var/lib/php/session/sess_890fadd676b36c6ce590b784404e67b8
username|s:7:"ks";password|s:32:"something";
username|id|s:2:"38";ltitle|s:11:"Quick Links";lbody|s:808:"<a
username|href="/info-technology/helpdesk.php"><img alt="Submit HelpDesk
username|Request" src="/images/private/icon-helpdesk.gif" border="0"
username|align="right"></a><div id="base">
<B>Intranet</b> - <a href="/logout.php">Logout</a> <ul>
<li><a href="/allstaff/profile_public.php?profile_id=38">Your Profile</a>
<li><a href="/admin/index.php?v=y">User Groups</a>
<li><a href="/wiki/index.php?pg=438">Link Collection</a>
<li><a href="/news/news.php?t=types">Library Bulletin</a>
<li><a href="/wiki/index.php?pg=9&par=1">Jenkins U.</a>
<li><a href="/news/news.php?t=projects">Projects</a>
<li><a href="/wiki/index.php?pg=643">Strategic Planning</a> </ul>
<p><a href="http://intranet/allstaff/bookmarks/&quot; class="bookmarks"><B>Bookmarks</b></a> - <a href="http://intranet/allstaff/bookmarks/add.php">Edit</a&gt;
<ul>
</ul></div>";name|s:3:"Ken";email|s:22:"ken@myemail.com";group|s:4:" 15,"; ==================================================================================[/php]


Does this sound like a server issue or a programming issue? Any suggestions on server settings?

We're using version 4.3.9cgi of php.

Thanks for any help any of you guys are willing to give. Also, I was no the one who wrote this code.

PS- How do I post code without it interpreting the HTML?

Comments

  • ShortyShorty Manchester, UK Icrontian
    edited July 2006
    Server issue 99% likely.

    Do this.. find your php.ini file and post the contents here. Im reckoning your intranet script requires register_globals = On and the new default setting is register_globals = Off. This means that global and environmental variables will fail if they are not wrapped in the correct super global arrays provided.
  • AnnesAnnes Tripped Up by Libidos and Hubris Alexandria, VA Icrontian
    edited July 2006
    Turning register globals on is one of the first things we did with this server.

    Here's the php.ini for you. Thanks!
  • primesuspectprimesuspect Beepin n' Boopin Detroit, MI Icrontian
    edited July 2006
    you use the [ php ] tags to post php code. :)
Sign In or Register to comment.