简体   繁体   中英

Procedure to get the url from the address bar of browser while pressing enter button or by perform a click event

I am using Windows7 with IE9. I want to extract the URL form the address bar of the IE9 browser.

The user will type one URL in the browser, like

www.google.com

and press enter button or any click event (like GO button or Search button in Firefox) . I want to connect a script program with this enter enter button or click event. Then this complete URL should be pass to the that script program for parsing the URL.

I wrote my script in a php file like,

{

$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

}

i want to execute this code when the user press the enter button in web browser.

Can anybody explain the procedure...................

Can i use the browser events to extract the URL from the browser?

Is this browser good for this process.......? Thanks in advance

So you want to trojan-horse a user to get their browser history?

I don't think you can use PHP to get that :)

if i understand you right, you want to know to which address user leaves a page. In this case use javascript to capture the unload event and then use ajax to save the address like here: Detect when a user leaves a website

You would probably need javascript for something like this. PHP will not know about a user's key presses in the browser.

Check out jquery. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM