tothemax Posted June 21, 2007 Share Posted June 21, 2007 Hey everyone: I'm having some problems with a very basic PHP script. This all was working fine on my test server, but as soon as I moved it, it doesn't seem to be working at all. I am trying to create basic pages which pull different ini documents per link. The code I have is: <?php if (empty($area)) { $area="home"; } ?> and where I want the text, I have: <?php if($area){include("content_includes/$area.inc"); } ?> It keeps pulling up the home page, evidently it's not reading anything else. The path is correct. I just don't get it. Thanks. Link to comment https://forums.phpfreaks.com/topic/56504-php-include-problem/ Share on other sites More sharing options...
teng84 Posted June 21, 2007 Share Posted June 21, 2007 sure about .inc?? include 'content_includes/'.$area.inc; try that^^ ASTIG!!!! Link to comment https://forums.phpfreaks.com/topic/56504-php-include-problem/#findComment-279070 Share on other sites More sharing options...
tothemax Posted June 21, 2007 Author Share Posted June 21, 2007 sure about .inc?? include 'content_includes/'.$area.inc; try that^^ ASTIG!!!! That didn't work. Thanks for trying though, heh. Link to comment https://forums.phpfreaks.com/topic/56504-php-include-problem/#findComment-279078 Share on other sites More sharing options...
teng84 Posted June 21, 2007 Share Posted June 21, 2007 show the error message Link to comment https://forums.phpfreaks.com/topic/56504-php-include-problem/#findComment-279081 Share on other sites More sharing options...
tothemax Posted June 21, 2007 Author Share Posted June 21, 2007 show the error message There is none, and as you can tell I'm extremely new to php, but I'm just confused as to how this was working on one server and not the other. I know I have PHP enabled because I have a forum running perfectly. I created an index.php and am using an include to call on different .inc files per link. so it would be http://domain.com/index.php?area=xyz And they would all go to http://domain.com/index.php?area=home so for some reason or another, it's not reading $area correctly. Link to comment https://forums.phpfreaks.com/topic/56504-php-include-problem/#findComment-279082 Share on other sites More sharing options...
tothemax Posted June 21, 2007 Author Share Posted June 21, 2007 Is there anyone else who can help me, please? Link to comment https://forums.phpfreaks.com/topic/56504-php-include-problem/#findComment-279088 Share on other sites More sharing options...
milo.desert Posted June 21, 2007 Share Posted June 21, 2007 include("content_includes/" . $area. ".inc"); Link to comment https://forums.phpfreaks.com/topic/56504-php-include-problem/#findComment-279093 Share on other sites More sharing options...
tothemax Posted June 21, 2007 Author Share Posted June 21, 2007 include("content_includes/" . $area. ".inc"); That's a no go too. They all show the homepage, but the links still don't work. It's not carrying over the other inc documents. Link to comment https://forums.phpfreaks.com/topic/56504-php-include-problem/#findComment-279095 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.