Jump to content

Passing id through url not working on new server why?


einstein101

Recommended Posts

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!

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.

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?

 

 

 

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.

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.