MrFish Posted September 13, 2010 Share Posted September 13, 2010 Is it possible to use javascript (or php if possible) to change the address in the address bar?So if my site is: asdlkfjaosinivlkoasdnjf.com could I change it to google.com after they enter the page? Of course they couldn't visit google.com and go to my page, but make them go- "wtf, this is google now?!"See what I'm saying? Any method at all I'm up to. Just trying to play a joke on someone Link to comment Share on other sites More sharing options...
jeffman Posted September 13, 2010 Share Posted September 13, 2010 Nope. Link to comment Share on other sites More sharing options...
wirehopper Posted September 14, 2010 Share Posted September 14, 2010 Not sure if I understand your question ... but ...<script type="text/javascript">t=setTimeout("location.href='http://google.com',4000);</script>Should wait 4 seconds, then redirect to google.comhttp://www.w3schools.com/js/js_timing.asp Link to comment Share on other sites More sharing options...
End User Posted September 14, 2010 Share Posted September 14, 2010 Is it possible to use javascript (or php if possible) to change the address in the address bar?No, and thank goodness you can't. It would be the juiciest phishing exploit you could imagine. Link to comment Share on other sites More sharing options...
Synook Posted September 14, 2010 Share Posted September 14, 2010 You can turn the site at asdlkfjaosinivlkoasdnjf.com into a proxy using PHP, that loads content from google.com. They would still be at asdlkfjaosinivlkoasdnjf.com, though (it would just look and function as if they were at google.com).To make it go the other way, or to actually make asdlkfjaosinivlkoasdnjf.com point to google.com, you would need to hijack their DNS, which can't be done remotely, or ethically. Link to comment Share on other sites More sharing options...
jeffman Posted September 14, 2010 Share Posted September 14, 2010 I didn't notice the PHP in the original question. To use Synook's technique, look into file_get_contents: http://www.php.net/manual/en/function.file-get-contents.php Link to comment Share on other sites More sharing options...
Ingolme Posted September 14, 2010 Share Posted September 14, 2010 No, neither Javascript nor PHP can change the address in the navigation bar without actually going to the other page.Like others indicated, you can load other page content while keeping your own address in the bar. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.