TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Question with URL Vars (http://www.talkphp.com/general/2120-question-url-vars.html)

Orc 01-28-2008 05:02 AM

Question with URL Vars
 
How would I associate URL Vars of one php to another? Like including a php inside a php file then grabbing those URL Vars from the included php file and putting them in the current?

URL Vars I mean by:
PHP Code:

// sid would be the URL Var
http://www.example.com/?sid=id 

// Example of what I have:
include 'http://www.example.com/index.php?foo=bar';
// I want to grab the url vars from that
// So I could put them in my index.php
// And yes that included file is on my server 

I understand that it's an array, so would I have to take all the vars out of the $_GET/$_POST arrays, and place them into the current php files url var arrays? :/

Maybe using Extract?

Orc 01-28-2008 09:03 AM

bump (chars)

EyeDentify 01-28-2008 09:48 AM

why not just access it by:

$_GET['foo']

Orc 01-28-2008 09:52 AM

Quote:

Originally Posted by EyeDentify (Post 9827)
why not just access it by:

$_GET['foo']

How does that work.. Oh wait, today my brain isn't working so well. -_-

TlcAndres 01-28-2008 11:07 AM

As long a the variables exists on the url bar, the included file should have access to the super globals too.

Orc 01-28-2008 11:08 AM

Quote:

Originally Posted by TlcAndres (Post 9832)
As long a the variables exists on the url bar, the included file should have access to the super globals too.

Yeah, just my head is all over the place today. I need some vitamins.

Salathe 01-28-2008 11:15 AM

If the included file is on your server, why would you want to introduce the overhead of loading it over the network (which if you're wanting the source code is a huge security flaw) rather than using a path on the file system?

Orc 01-28-2008 09:30 PM

Quote:

Originally Posted by Salathe (Post 9835)
If the included file is on your server, why would you want to introduce the overhead of loading it over the network (which if you're wanting the source code is a huge security flaw) rather than using a path on the file system?

This is for my Template and Modules system, it passes everything through the index.php of the main page, so any url variables will be pointing to the modules, and templates..


All times are GMT. The time now is 08:19 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0