MDanz Posted October 27, 2009 Share Posted October 27, 2009 <?php if (isset($_POST['url'])) { header("Location: http://" . $_POST['url']); } ?> is there a way for me to reverse this? ...so instead i GET the url? Quote Link to comment https://forums.phpfreaks.com/topic/179235-header-help/ Share on other sites More sharing options...
Mchl Posted October 27, 2009 Share Posted October 27, 2009 Use $_GET ? Quote Link to comment https://forums.phpfreaks.com/topic/179235-header-help/#findComment-945635 Share on other sites More sharing options...
MDanz Posted October 27, 2009 Author Share Posted October 27, 2009 so it will get the url of an external website in another frame? i POST url to the top frame, which is an external website, works. Shouldn't i be able to GET the url of the top frame? Quote Link to comment https://forums.phpfreaks.com/topic/179235-header-help/#findComment-945643 Share on other sites More sharing options...
mikesta707 Posted October 27, 2009 Share Posted October 27, 2009 I don't quite understand what you mean by GET the url. Do you mean put it in a GET variable? retrieve it? Could you explain your problem a little better Quote Link to comment https://forums.phpfreaks.com/topic/179235-header-help/#findComment-945646 Share on other sites More sharing options...
MDanz Posted October 27, 2009 Author Share Posted October 27, 2009 I don't quite understand what you mean by GET the url. Do you mean put it in a GET variable? retrieve it? Could you explain your problem a little better i have a bottom frame, where input the url. the top frame displays the website of the url i put in. i want to reverse the process. so whatever website is in the top frame. i can retrieve the url. Quote Link to comment https://forums.phpfreaks.com/topic/179235-header-help/#findComment-945654 Share on other sites More sharing options...
mikesta707 Posted October 27, 2009 Share Posted October 27, 2009 you can use javascript. it can get the location of the frame like so url = parent.frameName.location.href; Quote Link to comment https://forums.phpfreaks.com/topic/179235-header-help/#findComment-945660 Share on other sites More sharing options...
MDanz Posted October 27, 2009 Author Share Posted October 27, 2009 you can use javascript. it can get the location of the frame like so url = parent.frameName.location.href; thx you a life saver. can you just help me get this working <script type='text/javascript'> function urlget(){ url = parent.link_frame.location.href; urlarea.value = url; } </script> <a onclick='urlget()'></a> <textarea name="urlarea" id="urlarea"></textarea> where did i go wrong? Quote Link to comment https://forums.phpfreaks.com/topic/179235-header-help/#findComment-945674 Share on other sites More sharing options...
mikesta707 Posted October 27, 2009 Share Posted October 27, 2009 is the urlarea variable already defined? if not you have to do document.getElementById('urlarea').value = url; Quote Link to comment https://forums.phpfreaks.com/topic/179235-header-help/#findComment-945677 Share on other sites More sharing options...
MDanz Posted October 27, 2009 Author Share Posted October 27, 2009 still having problems.. <script type='text/javascript'> function urlget(){ var url = parent.link_frame.location.href; document.getElementById('urlarea').value = url; } </script> <textarea name="urlarea" id="urlarea"></textarea> <a onclick='urlget()'></a> i don't see why it isn't working? Quote Link to comment https://forums.phpfreaks.com/topic/179235-header-help/#findComment-945681 Share on other sites More sharing options...
mikesta707 Posted October 27, 2009 Share Posted October 27, 2009 oh my bad didnt see it was a text area. instead of .value do .innerHTML Quote Link to comment https://forums.phpfreaks.com/topic/179235-header-help/#findComment-945682 Share on other sites More sharing options...
MDanz Posted October 27, 2009 Author Share Posted October 27, 2009 not working... <script type='text/javascript'> function urlget(){ var url = parent.link_frame.location.href; document.getElementById('urlarea').innerHTML = url; } </script> <textarea name="urlarea" id="urlarea"></textarea> <a onclick='urlget()'></a> Quote Link to comment https://forums.phpfreaks.com/topic/179235-header-help/#findComment-945686 Share on other sites More sharing options...
MDanz Posted October 27, 2009 Author Share Posted October 27, 2009 oh it don't work on external websites.... damn. Quote Link to comment https://forums.phpfreaks.com/topic/179235-header-help/#findComment-945692 Share on other sites More sharing options...
mikesta707 Posted October 27, 2009 Share Posted October 27, 2009 ahh ok. Quote Link to comment https://forums.phpfreaks.com/topic/179235-header-help/#findComment-945694 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.