TWadmin Posted December 30, 2006 Share Posted December 30, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/32264-solved-moved-site-to-new-server-script-is-broken/ Share on other sites More sharing options...
marcus Posted December 30, 2006 Share Posted December 30, 2006 Please tell me you have $tag defined. Quote Link to comment https://forums.phpfreaks.com/topic/32264-solved-moved-site-to-new-server-script-is-broken/#findComment-149766 Share on other sites More sharing options...
JasonLewis Posted December 30, 2006 Share Posted December 30, 2006 excuse me if i missed something but what is the problem exactly? Quote Link to comment https://forums.phpfreaks.com/topic/32264-solved-moved-site-to-new-server-script-is-broken/#findComment-149767 Share on other sites More sharing options...
marcus Posted December 30, 2006 Share Posted December 30, 2006 You can see on his website that $tag is not registering.Try:[code=php:0]<?phpswitch($_GET['tag']){//etc...}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/32264-solved-moved-site-to-new-server-script-is-broken/#findComment-149771 Share on other sites More sharing options...
TWadmin Posted December 30, 2006 Author Share Posted December 30, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/32264-solved-moved-site-to-new-server-script-is-broken/#findComment-149777 Share on other sites More sharing options...
marcus Posted December 30, 2006 Share Posted December 30, 2006 Probably because you didn't have $tag defined. Quote Link to comment https://forums.phpfreaks.com/topic/32264-solved-moved-site-to-new-server-script-is-broken/#findComment-149778 Share on other sites More sharing options...
TWadmin Posted December 30, 2006 Author Share Posted December 30, 2006 [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). Quote Link to comment https://forums.phpfreaks.com/topic/32264-solved-moved-site-to-new-server-script-is-broken/#findComment-149783 Share on other sites More sharing options...
TWadmin Posted December 30, 2006 Author Share Posted December 30, 2006 [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. Quote Link to comment https://forums.phpfreaks.com/topic/32264-solved-moved-site-to-new-server-script-is-broken/#findComment-149786 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.