Jump to content

[SOLVED] Moved site to new server, script is broken


TWadmin

Recommended Posts

I'm in the process of moving a few hosted websites to a newer server having a newer PHP than the old one.  The new version is 5.1.6, and I think the old is PHP4.

A couple of these sites have some light php and neither of them are working quite right on the new server.  I'm assuming I have a config problem because the code is simple and I doubt it would change between major versions.  I'd appreciate a point in the right direction towards where the cuase of the problem might lie.

The simplest of the two problem sites is at http://www.buffalopoint.com.  As you can see, it's supposed to be a little image gallery type page.  Part of the code is:
[code]      <?php
// This switch controls what big picture shows up.

switch($tag){
  case 'cabin5':
echo "<img src=\"images/cabin5.jpg\" width=\"300\" height=\"225\">";
break;
  case 'gilbertoverlook':
echo "<img src=\"images/gilbertoverlook.jpg\" width=\"300\" height=\"225\">";
break;
                  Etc..........
  default:
echo "<img src=\"images/fogsunrise.jpg\" width=\"300\" height=\"225\">";
break;
}
?>
[/code]
Each of the images is coded:
[code]    <td><a href="index.php?tag=cabin5"><img border="0" name="cabin5" src="images/cabin5_sm.jpg" width="100" height="75"></a></td>
[/code]
There's a matching switch statement for the description underneath the large image, too. 

The page worked fine on the old system.  I've confirmed ownership on all the files is apache:apache.  Permissions on all are 755.

As I said, I suspect it's a config issue, but I'd appreciate some direction.  Any ideas?
Link to comment
Share on other sites

Holy cow!  Those were some speedy responses.

Changing the switch param did it.  Is this something that changed over the major versions?  Or do you have any idea why this would have worked before?

Many thanks for the help.  Now I'll go about digging into the other site to try to figure out why it's broken.
Link to comment
Share on other sites

[quote author=mgallforever link=topic=120365.msg493610#msg493610 date=1167466838]
Probably because you didn't have $tag defined.
[/quote]

Sorry.  I meant, any idea on why the page worked on the old server?  I don't know how many years it was there, but it worked before I copied it to the new server (newer PHP).
Link to comment
Share on other sites

[quote author=TWadmin link=topic=120365.msg493609#msg493609 date=1167466738]
Changing the switch param did it.  Is this something that changed over the major versions?  Or do you have any idea why this would have worked before?

[/quote]

Answering my own question here for any fellow noobs who might be wondering.  This is quoted from another forum on another topic:
"As of PHP 4.2 global variables was turned off by default, as it was seen that global variables was a security risk."

This global variable issue is also the explanation to why the second site is broken.  I'll need to do a little cleaning up before it's ready to play nicely.

Again, thanks for the help here.  That little bit of information has directed me quite well.
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.