Jump to content

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

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.