 |
 |
PHP Questions - be warned its been a while since i used it
|
 |
|
 |
|
Senior User
Join Date: Sep 2000
Location: Glasgow, Scotland UK
Status:
Offline
|
|
before i begin its been a while since i was really using PHP and this may have been changed and passed me by.
often when i build a webpage with PHP i create the 'template' and load the content of a page with the include() function. i use the links to change a variable which is what the content loaded depends on. so for example to load a projects page i might use www.mywebsite.com/index.php?load=projects and then have a switch statement something like
swtich($load){
case "projects":
include(projects.inc);
break;
default:
inlcude("index.inc");
break;
}
however it seems that with the Apple installed Apache and PHP and indeed the PHP on my ISP's server that this is not valid for some reason. and the load variable value is always the default.
why is this? has something changed with PHP? please help - this used to work 
|
|
"You can't waste a life hating people, because all they do is live their life, laughing, doing more evil."
-ALPHA ROBERTSON,whose daughter was one of four girls killed in the bombing of a Birmingham, Ala., church in 1963.
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Oct 2003
Status:
Offline
|
|
Originally posted by ntsc:
why is this? has something changed with PHP? please help - this used to work
register globals are probably turned off. So you have to call post, get, session, etc variables by the superglobal. like so:
[php]swtich($_GET['load']) {
case "projects":
include("projects.inc");
break;
default:
include("index.inc");
break;
}[/php]
http://us3.php.net/variables.predefined
|
|
The only thing necessary for evil to flourish is for good men to do nothing
- Edmund Burke
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Sep 2000
Location: Glasgow, Scotland UK
Status:
Offline
|
|
nice one thanks, is this a common occurrence now? what was wrong with register globals?
|
|
"You can't waste a life hating people, because all they do is live their life, laughing, doing more evil."
-ALPHA ROBERTSON,whose daughter was one of four girls killed in the bombing of a Birmingham, Ala., church in 1963.
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Oct 2003
Status:
Offline
|
|
|
|
|
The only thing necessary for evil to flourish is for good men to do nothing
- Edmund Burke
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |