One-Uppery - PHP/Server Help
Annes
Tripped Up by Libidos and HubrisAlexandria, VA Icrontian
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/" class="bookmarks"><B>Bookmarks</b></a> - <a href="http://intranet/allstaff/bookmarks/add.php">Edit</a>
<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?
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/" class="bookmarks"><B>Bookmarks</b></a> - <a href="http://intranet/allstaff/bookmarks/add.php">Edit</a>
<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?
0
Comments
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.
Here's the php.ini for you. Thanks!