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
davidprogramer
Forum Commoner
Posts: 64 Joined: Mon Nov 28, 2005 6:11 pm
Post
by davidprogramer » Thu Mar 23, 2006 4:56 pm
Ok. The following would work but I can't pass globals this way:
Code: Select all
<a href=modules/League/includes/file.php></a>
This however is what I need:
Code: Select all
<a href=modules.php?name=League&file=includes/file.php&variable=value></a>
or something similar, how would I go about doing this?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Mar 23, 2006 5:06 pm
You're trying to include a file based on URL variables?
davidprogramer
Forum Commoner
Posts: 64 Joined: Mon Nov 28, 2005 6:11 pm
Post
by davidprogramer » Thu Mar 23, 2006 5:11 pm
no, I mean, well...maybe...
I am trying to pass variables in an URL to a different page, and $GET them on the destination.
I can't use include(file.php) because I still wont be able to pass variables.
This:
Code: Select all
echo "<td nowrap><center><a href=javascript:popUpPermissions('modules.php?name=League&file=includes/clan_hq/edit_permissions.php&rank=$i')>[ Edit ]</a></center></td>";
doesnt work.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Mar 23, 2006 5:19 pm
You can "pass" variables to another script you include.
Code: Select all
// one.php
$foo = 'hi!';
include 'two.php';
davidprogramer
Forum Commoner
Posts: 64 Joined: Mon Nov 28, 2005 6:11 pm
Post
by davidprogramer » Thu Mar 23, 2006 5:26 pm
But it is going to be a popup, it wont be in the same page.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Mar 23, 2006 5:49 pm
modules.php can include "edit_permissions.php" passing any other variables it has along with it. That's what it appears you're building. However I'd recommend not being able to pass directory tree information in the query.. maybe a coded name or something.
davidprogramer
Forum Commoner
Posts: 64 Joined: Mon Nov 28, 2005 6:11 pm
Post
by davidprogramer » Thu Mar 23, 2006 5:55 pm
Yeah, I'll encrypt all the variables. My only problem is getting the variables from page1 to popuppage2.
If I include it, wouldnt that just put popuppage2 inside page1?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Mar 23, 2006 6:03 pm
You're not including it on the current page. You're including the file on the page the popup will call, modules.php.
davidprogramer
Forum Commoner
Posts: 64 Joined: Mon Nov 28, 2005 6:11 pm
Post
by davidprogramer » Thu Mar 23, 2006 6:22 pm
Now im confused lol. The popup wont call any other pages. I am going to put scripts on the popup. The scripts will depend on one variable passed from the first page. I sort of understand what you are saying, but how would I include the page and get the variable without running the page that the variables are on?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Mar 23, 2006 6:28 pm
your popup is referencing a page, modules.php. It's being sent a get variable "file" that references another page.
davidprogramer
Forum Commoner
Posts: 64 Joined: Mon Nov 28, 2005 6:11 pm
Post
by davidprogramer » Thu Mar 23, 2006 9:51 pm
maybe i dont understand what you mean by include. The only include I know is :
which would call file.php, but would also run it right there on the spot.
Is this the same include you are talking about?