einstein101 Posted September 3, 2009 Share Posted September 3, 2009 I have a frames page where I pass a url into the frame from a link. It worked on another server but the client wanted it moved to godaddy. Now it doesn't pass and I don't know why, how to fix it or where to look for the solution. Example: Link: http://www.website.com?page=http://www.websiteforframe.com (this link shows up exactly right in url up top) Frame: in the frame I have <iframe src="<?php echo $page; ?>"></iframe> if I put <iframe src="http://www.websiteforframe.com"></iframe> it works. What I noticed in the php settings on the godaddy server is that always_populate_raw_post_data is set to off. Could that be it? Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/172908-passing-id-through-url-not-working-on-new-server-why/ Share on other sites More sharing options...
PFMaBiSmAd Posted September 3, 2009 Share Posted September 3, 2009 What is your code that is setting the variable $page from $_GET['page']? Link to comment https://forums.phpfreaks.com/topic/172908-passing-id-through-url-not-working-on-new-server-why/#findComment-911280 Share on other sites More sharing options...
einstein101 Posted September 3, 2009 Author Share Posted September 3, 2009 Thanks for the fast reply. I don't have any I guess. I used exactly what is posted above and it works on one server and not the godaddy. :S The godaddy server doesn't recognize the $page variable. But, the other server does. I'm really lost on what to do. Link to comment https://forums.phpfreaks.com/topic/172908-passing-id-through-url-not-working-on-new-server-why/#findComment-911286 Share on other sites More sharing options...
einstein101 Posted September 3, 2009 Author Share Posted September 3, 2009 Basically this is how it is set up. LINK: http://www.asite.com/frames2.php?page=http://www.a-site-to-load-in-frames.htm FRAMES PAGE: url is http://www.asite.com/frames2.php?page=http://www.a-site-to-load-in-frames.htm But, it won't echo the $page in the <iframe <?php echo ("$page");?> > almost like it doesn't see it. But, the other server it works perfectly fine the way it is. So I'm assuming its' a setting in the php. Or am I wrong? Link to comment https://forums.phpfreaks.com/topic/172908-passing-id-through-url-not-working-on-new-server-why/#findComment-911288 Share on other sites More sharing options...
PFMaBiSmAd Posted September 3, 2009 Share Posted September 3, 2009 You got caught by the register_globals problem. register_globals "magically" populated program variables from the same name POST/GET/COOKIE/SESSION/FILES/SERVER variable. However, register_globals also "magically" allowed hackers to set your SESSION variables to any value he wanted, so they were turned off by default in php4.2 in the year 2002. Unfortunately, an awful lot of awful web hosts and php coders did not get the message and continued to have register_globals turned on and relied on them in their code, so we now see an awful lot of people who's code does not work when they move to a different server that is following current recommend php programming practices (7 years after the fact.) register_globals have been completely removed in php6, so you will need to fix your code to use the correct $_GET/$_POST/$_COOKIE/$_SESSION/$_FILES/$_SERVER variables instead of relying on php to set program variables for you. Link to comment https://forums.phpfreaks.com/topic/172908-passing-id-through-url-not-working-on-new-server-why/#findComment-911292 Share on other sites More sharing options...
einstein101 Posted September 3, 2009 Author Share Posted September 3, 2009 Okay. That would probably make sense. But, how do I fix my code to allow my frames code to work? What should I look for? Link to comment https://forums.phpfreaks.com/topic/172908-passing-id-through-url-not-working-on-new-server-why/#findComment-911297 Share on other sites More sharing options...
PFMaBiSmAd Posted September 3, 2009 Share Posted September 3, 2009 What is your code that is setting the variable $page from $_GET['page']? $page = $_GET['page']; Or you can just use $_GET['page'] directly any place you are currently using $page. Link to comment https://forums.phpfreaks.com/topic/172908-passing-id-through-url-not-working-on-new-server-why/#findComment-911301 Share on other sites More sharing options...
einstein101 Posted September 3, 2009 Author Share Posted September 3, 2009 Wow. Too cool. Thank you so much!!! Works perfectly. Link to comment https://forums.phpfreaks.com/topic/172908-passing-id-through-url-not-working-on-new-server-why/#findComment-911305 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.