Jump to content

Web server upgrade breaks website


Recommended Posts

Really need help with a client's website utilizing old code.  The site has to be moved to a new server with updated code:

 

Current Server web1    New Server web2

 

MySQL 4.0.18              MySQL 5.1.42

PHP 4.3.11                  PHP 5.3.1

Perl 5.8.3                    Perl 5.10.0

Fedora Core 1              Fedora 12

 

I believe the primary problem is php code since the two primary pages with php are not working on the new server.  (I had the site moved back to the old server for now). I have researched the code upgrades and believe I have it fixed but how do I test it?  I use Snow Leopard Mac and have installed MAMP.  But I get a white screen when I call up the pages in question "http://localhost:8888/xxx.phtml".  The basic code is below...what am I doing wrong? 

 

Current code:

<?php

require("admin2/admin2.php3");

$sql=new MySQL_class;

$sql->Create("database-name");

?>

 

<div id="footer">

<?php

@readfile('http://www.website.com/ssi/ssi-footer.html');

?>

</div>

<? } ?>

Link to comment
Share on other sites

Thanks for the quick reply!  I always wondered why the site was created using that php3 extension, and that it worked.  But I did change all the extensions and references from php3 to php...and it helped. 

 

Now, my next question: does this language still apply: <form action=\"$PHP_SELF\" method=post > ?

For some reason the members page won't activate after I log in as a member on the homepage, it just reverts to a login page and not revealing the member resources.  And then when logging in on this second login page, it fails and remains on this page.

Link to comment
Share on other sites

$PHP_SELF was depreciated and should have been turned off by default in php4.2 in April of the year 2002 when register_globals were turned off by default. As a temporary patch you could turn register_globals on (assuming your web host allows it) but since register_globals have been completely removed in php6, you will need to fix your code sooner or later.

 

It should be $_SERVER['PHP_SELF']

 

Register_globals magically populated program variables (such as $PHP_SELF) from the corresponding predefined superglobals where the data actually originates. Unfortunately, register_globals also allowed hackers to 'magically' set session and program variables by simply setting a same name external post/get/cookie variable and a lot of web sites were taken over.

 

If your code is using any of the following source variables, you need to modify your code to use the actual $_XXXXXX superglobal variable instead of a program variable by the same name as the superglobal index name -

 

$_SERVER — Server and execution environment information

$_GET — HTTP GET variables

$_POST — HTTP POST variables

$_FILES — HTTP File Upload variables

$_SESSION — Session variables

$_ENV — Environment variables

$_COOKIE — HTTP Cookies

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.