Unable to include file with query string?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Unable to include file with query string?

Post by JAB Creations »

When I include a file with a query string PHP claims the file does not exist. How do I make PHP aware of the file and correctly execute the query string when it includes the file?

Code: Select all

include("file.php?php=doh");
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: Unable to include file with query string?

Post by JAB Creations »

From what I'm reading I think I can get around the problem using a global scope variable... :roll:
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: Unable to include file with query string?

Post by JAB Creations »

Yeah using a global scope variable works. Don't mind me, I'm just :crazy:. :mrgreen:
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Unable to include file with query string?

Post by onion2k »

Globals are bad, mmmkay.
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: Unable to include file with query string?

Post by JAB Creations »

Err actually I'm probably still not using the terminology correctly...if a variable is defined inside of an if/else argument what level of scope is it referred to as?
Post Reply