--7 Posted June 18, 2010 Share Posted June 18, 2010 Hi, Im a php noob. I have a problem with php_self iframe for the sub site. I use this code <?php echo $_SERVER['PHP_SELF']."<br>".$_SERVER['HTTP_HOST']."<br>".$_SERVER['REMOTE_ADDR']; ?> It is ok when i use on my site but when I put the sub site in. It didnt work. Please help me. I appreciate all the help. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/205194-iframe-problems/ Share on other sites More sharing options...
ram4nd Posted June 18, 2010 Share Posted June 18, 2010 It doesn't work like that. Quote Link to comment https://forums.phpfreaks.com/topic/205194-iframe-problems/#findComment-1074058 Share on other sites More sharing options...
joePHP Posted June 18, 2010 Share Posted June 18, 2010 Hi, Â What Error do you get? Â Thanks, Joe Quote Link to comment https://forums.phpfreaks.com/topic/205194-iframe-problems/#findComment-1074060 Share on other sites More sharing options...
--7 Posted June 18, 2010 Author Share Posted June 18, 2010 It cant get the information from the sub site. Is there anyway to get information from the sub site? How can I use this code on sub site or I have to use another code? Please help <?php echo $_SERVER['PHP_SELF']."<br>".$_SERVER['HTTP_HOST']."<br>".$_SERVER['REMOTE_ADDR']; ?> Â Quote Link to comment https://forums.phpfreaks.com/topic/205194-iframe-problems/#findComment-1074062 Share on other sites More sharing options...
joePHP Posted June 18, 2010 Share Posted June 18, 2010 Make sure that both files (the file that has the iframe and the sub file) are saved as PHP files. (example: iframe.php and sub_file.php) Quote Link to comment https://forums.phpfreaks.com/topic/205194-iframe-problems/#findComment-1074063 Share on other sites More sharing options...
ram4nd Posted June 18, 2010 Share Posted June 18, 2010 I guess he means by sub that its from other site. Quote Link to comment https://forums.phpfreaks.com/topic/205194-iframe-problems/#findComment-1074067 Share on other sites More sharing options...
joePHP Posted June 18, 2010 Share Posted June 18, 2010 I guess he means by sub that its from other site. Â That's what I was thinking that he meant. That the sub file is the file he is putting in the src of the iframe Quote Link to comment https://forums.phpfreaks.com/topic/205194-iframe-problems/#findComment-1074070 Share on other sites More sharing options...
joePHP Posted June 18, 2010 Share Posted June 18, 2010 The truth is that the main file that contains the iframe doesn't have to be a PHP file. but the sub file does. Quote Link to comment https://forums.phpfreaks.com/topic/205194-iframe-problems/#findComment-1074076 Share on other sites More sharing options...
ram4nd Posted June 18, 2010 Share Posted June 18, 2010 I guess he means by sub that its from other site. Â That's what I was thinking that he meant. That the sub file is the file he is putting in the src of the iframe I don't think the file is on hes server. How does it matte what file it is if it will get html from url? Quote Link to comment https://forums.phpfreaks.com/topic/205194-iframe-problems/#findComment-1074080 Share on other sites More sharing options...
--7 Posted June 18, 2010 Author Share Posted June 18, 2010 yeah, I mean by the sub site is that the other site. I want to get the information from it. But the code I used just work on my host but didnt work on the others' site host. Quote Link to comment https://forums.phpfreaks.com/topic/205194-iframe-problems/#findComment-1074100 Share on other sites More sharing options...
joePHP Posted June 18, 2010 Share Posted June 18, 2010 Could you post the whole page Quote Link to comment https://forums.phpfreaks.com/topic/205194-iframe-problems/#findComment-1074107 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.