...

View Full Version : include into page problem



Dan13071992
01-15-2012, 01:41 PM
hi guys, ive got this problem, when i insert a page into my page using the code below:



if ($fetch->armclicks >= "1") {
include_once("validate.php?page=arm");
}


i get the error:



Warning: include_once(validate.php?page=arm) [function.include-once]: failed to open stream: No such file or directory in /home/tacticsc/domains/360-tactics.co.uk/public_html/crimewave/arm.php on line 16

Warning: include_once() [function.include]: Failed opening 'validate.php?page=arm' for inclusion (include_path='.:/usr/local/lib/php') in /home/tacticsc/domains/360-tactics.co.uk/public_html/crimewave/arm.php on line 16


i believe its something to do with the ?page=arm as when i take this out it works fine :s anyone got any ideas?

Fou-Lu
01-15-2012, 01:44 PM
You can't include a querystring only a file.

Dan13071992
01-15-2012, 01:46 PM
in that include page could i set it to collect what page the user has come from? and do it that way? instead of using a $_GET in the validation page?

Fou-Lu
01-15-2012, 01:53 PM
in that include page could i set it to collect what page the user has come from? and do it that way? instead of using a $_GET in the validation page?

GET is superglobal, you can retrieve it in any scope and in any included script.

Dan13071992
01-15-2012, 01:56 PM
sorry what i ment is, ive got a piece of code in the validation.php:



$page = $_GET['page'];


this determines what page the user came from so that when the users validates it places the $page into the database, so my actually correct question should be, instead of using $page = $_GET['page']; however would i find out what page the user has come from?

Fou-Lu
01-15-2012, 02:03 PM
I don't understand this question at all. HTTP is stateless, you need to be provided with any information of relevance on every request. If you're looking for the referring page, the browser may be requested to provide it from the $_SERVER['HTTP_REFERER']; however, browsers are not required to provide this.
Aside from this, you must provide these values in either a get, post, cookie or session variable.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum