strange idea?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
pama
Forum Newbie
Posts: 12
Joined: Fri May 30, 2003 8:37 am

strange idea?

Post by pama »

hi all,
i have got phonebook on my page (php,mysql) - it's works perfectly, but...
i wonder is it possible to create link in search results which could:
1) copy to clipboard a piece of search results (e.g. last part of telephone number)
2) then emulate ctrl+F10 shortcut (ANSII code???)
any ideas? :)
User avatar
releasedj
Forum Contributor
Posts: 105
Joined: Tue Jun 17, 2003 6:35 am

Post by releasedj »

Whether or not it is possible would be down to the browser, and nothing to do with PHP.

Kelvin
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

You can only do it in IE, but "copying to clipboard" is actually a system-command. Thus, because IE is so tightly bundled with Windows, it can be done -and that's the great weakness as well.

Have a look at theIE code and then check out the commandID "copy". You may want to have a look at textRange as well - since it's necessary to do the whole shebang.

The following restrictions however apply:

- it will only work in IE4+
- it will only work under Windows
- it is a HUGE security risk
- it is buggy

Neither of which should really come as a surprise.
My personal piece of advise - don't do it.
pama
Forum Newbie
Posts: 12
Joined: Fri May 30, 2003 8:37 am

Post by pama »

thanks, i will try to make some codes, but is not so easy
ps.
i'm using WNT and IE, but the pages are on intranet, not internet, so security isn't very important:)
Post Reply