Jump to content

Getting Variables from a forwarded page


blazing

Recommended Posts

Hi, im looking to include a page in my php file, for example http://othersite.com/foward/15052 (I think its with Header("")), forwards the page to othersite.com?viewmovie=15052&tempid=10101505050550505&autostart=0

 

I need to get the address into my php page, but I dont know where to start with this.

 

I need to then break up the variables, I could probably do that with explode, but everytime I go to the forward page it will change the viewmovie variables, so I gotta make it dynamicly break up the variables on the spot.

 

If you can point me towards any commands or tutorials that would be great, thanks.

Link to comment
https://forums.phpfreaks.com/topic/41330-getting-variables-from-a-forwarded-page/
Share on other sites

You wont include a file with the header comand.  The header command will reedirect  rather than include

 

if you are looking to redirect then the command is correct.

 

the main ideas here would be o capture the url (if i understand your question) and for this id use $url =$_SERVER['REQUEST_URI'];

 

the use the $url var in the redirect where appropriate. The explode can be used...perhaps by exploding at each "/".  But from yor post I'd struggle to offer more info.

 

Will

no... I dont want that

 

I want to have my page

 

viewmovie.php on my server

 

it loads http://othersite.com/foward/15052

and I get my script to figure out what page it forwards to, because its differant everytime

I then want to get the page name it went to, in this example othersite.com?viewmovie=15052&tempid=10101505050550505&autostart=0

I then want to close that, split up the variables and on my page echo tempid=whatever

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.