Jump to content

PHP Include problem.


tothemax

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.