note 86758 added to function.require
| From: | justsomecoder at osu1 dot php dot net | Date: | Sun, 02 Nov 2008 12:19:15 +0000 |
| Subject: | note 86758 added to function.require | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146040@lists.php.net to get a copy of this message | ||
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");
----
Server IP: 62.237.7.3
Probable Submitter: 80.220.6.208
----
Manual Page -- http://www.php.net/manual/en/function.require.php
Edit -- https://master.php.net/note/edit/86758
Del: integrated -- https://master.php.net/note/delete/86758/integrated
Del: useless -- https://master.php.net/note/delete/86758/useless
Del: bad code -- https://master.php.net/note/delete/86758/bad+code
Del: spam -- https://master.php.net/note/delete/86758/spam
Del: non-english -- https://master.php.net/note/delete/86758/non-english
Del: in docs -- https://master.php.net/note/delete/86758/in+docs
Del: other reasons-- https://master.php.net/note/delete/86758
Reject -- https://master.php.net/note/reject/86758
Search -- https://master.php.net/manage/user-notes.php