note 86758 rejected from function.require by danbrown
| From: | danbrown@php.net | Date: | Sun, 02 Nov 2008 14:46:47 +0000 |
| Subject: | note 86758 rejected from function.require by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-146043@lists.php.net to get a copy of this message | ||
Note Submitter: justsomecoder
----
I'm having problem with ajax class
The site is having structure of: index.php?id=pagename
and with that id, current mid-content is loaded.
Now there should be different ajax class-files loaded
with using the GET id-variable.
Big broblem is that it doesn't work. Seems that every include and require are done before the
get variables are inspected.
So the .class.php always is the default one.
If I make the variable without get, it works fine.
So how to work around this?
Doesn't work:
$aaa=$_GET['id'];
if($aaa =='mat')
{
$keissi='pagea';
}
else $keissi='default';
include("$keissi.class.php");
-------
works: (but of course not dynamic)
$aaa='mat';
if($aaa =='mat')
{
$keissi='pagea';
}
else $keissi='default';
include("$keissi.class.php");