![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Jun 2002
Location: france
Posts: 996
|
PHP problem with include and $_GET
I want make include of a file with variables like:
include("/path/to/file.php?id=xxx"); in file.php i get the id variable with $id=@$_GET["xxx"]; the problem is that variable are not passed.. for $_GET i get a null value.. what can i do to pass the variable id to file.php through include function? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed IT Professional
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
|
http://us2.php.net/include/
Look under "Example 16.7. include() through HTTP" when using include() and $_GET you must pull the included file with the complete url. And note that include with $_GET doesn't work with all configurations.
__________________
The Best Affiliate Software, Ever. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
marketer.
Industry Role:
Join Date: Aug 2006
Location: bcn
Posts: 2,280
|
use file_get_contents - or yeah just use a complete url...
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Nov 2005
Location: Seattle, WA
Posts: 510
|
$id=@$_GET["xxx"]; <-- should be $_GET["id"] not xxx... but then yah no idea about passing vars to include files...
__________________
ICQ: 275335837 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Jan 2006
Location: Canuck land!
Posts: 921
|
i don't think you grasp the concept of include yet.
Why not just do $id = 'whatever'; include('thefile.php'); then in the 'thefile.php' if($id ... blabla) do some process here ... See an include as if the code would be litterally written where you include the file so if File1.php is $a = 1; $b = 2; include('File2.php'); echo $c; and File2.php is $c = $a + $b; is equal to having a file with $a = 1; $b = 2; $c = $a+$b; echo $c; ... hope you see what I mean... 3am here, tired.
__________________
40$/Page PSD->XHTML/CSS Transformations |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Jun 2002
Location: france
Posts: 996
|
ok..thanks everyboby
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
<&(©¿©)&>
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
|
Quote:
do something like this: $id='xxx'; include("/path/to/file.php"); then inside file.php just use $id wherever needed...
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000 Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager ![]() Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager |
|
![]() |
![]() ![]() ![]() ![]() ![]() |