Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

URL is Redirected.. PHP doesn't recognize vars in URL???

General discussions related to php

Moderators: macek, egami, gesf

URL is Redirected.. PHP doesn't recognize vars in URL???

Postby imroue » Sat Aug 16, 2003 7:25 pm

I have a domain that is being forwarded to another domain with frame forwarding turned on.. for example:
http://www.mydomain.com is forwarded to
http://www.anotherdomain.com/_mydomain/ (folder)
Therefore I put all my files under "_mydomain" then when I type http://www.mydomain.com it opens the pages in http://www.anotherdomain.com/_mydomain/ (folder) while showing http://www.mydomain.com in the url...

The problem I am having is if i type http://www.mydomain.com/index.php?id=abc I can't use $_GET to retreive the 'id'.

I have been looking for a solution for this for a while.. no one has been able to solve it.. it would be greatly appreciated if anyone can shed some light..

Thanks! :?:
User avatar
imroue
New php-forum User
New php-forum User
 
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am

Postby swirlee » Sat Aug 16, 2003 7:43 pm

Does mydomain.com have PHP installed, and are you able to alter the page which loads the frames for the frame-redirect? The cause of your problem is that when you request http://www.mydomain.com/index.php?id=abc, in the frame it still just loads http://www.anotherdomain.com/_mydomain/. Your parameters don't get passed on. What you have to do is write a script that will take the GET variables from mydomain.com and add them to the frameset. If you aren't able to modify (and use PHP on) the page that has the frameset, you're out of luck. Frame-redirects are a terrible kludge that really shouldn't exist at all, but that's a topic for another time.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby imroue » Sun Aug 17, 2003 7:20 am

swirlee wrote:Does mydomain.com have PHP installed, and are you able to alter the page which loads the frames for the frame-redirect? The cause of your problem is that when you request http://www.mydomain.com/index.php?id=abc, in the frame it still just loads http://www.anotherdomain.com/_mydomain/. Your parameters don't get passed on. What you have to do is write a script that will take the GET variables from mydomain.com and add them to the frameset. If you aren't able to modify (and use PHP on) the page that has the frameset, you're out of luck. Frame-redirects are a terrible kludge that really shouldn't exist at all, but that's a topic for another time.


Thanks for the info swirlee. I don't have access to the php installed and that is certainly a problem. BUT, after doing some playing around I was able to solve my problem using:
$url_in = $_SERVER['HTTP_REFERER'];
This allowed me to get the variables from the URL on that particular page.
If I was to use that page as an INCLUDE to another page I would have to use
$url_in = $_SERVER['REQUEST_URI']

It's quite tricky when using frame forwarding and I wanted to acess the variables in the url for a page that is in an include statement as well as the page using the include...

:lol:
User avatar
imroue
New php-forum User
New php-forum User
 
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am

Postby swirlee » Sun Aug 17, 2003 11:58 am

imroue wrote:Thanks for the info swirlee. I don't have access to the php installed and that is certainly a problem. BUT, after doing some playing around I was able to solve my problem using:
$url_in = $_SERVER['HTTP_REFERER'];
This allowed me to get the variables from the URL on that particular page.


Oh, duh. Why didn't I think of this? You're very clever, indeed. I think maybe it's my inherent distrust of HTTP_REFERER -- that is, browsers aren't required to send it accurately, (Firebird even lets you set the referer for your bookmarks) though 99% do.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back


Return to PHP General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.