moving and clicking the mouse with PHP

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
xerxes
Forum Newbie
Posts: 5
Joined: Tue Mar 18, 2008 8:45 am

moving and clicking the mouse with PHP

Post by xerxes »

hi all
first time member here. :)

i dont know if this can be done
is it possible to have or create a php script to
move the mouse pointer (windows) to a disired position
on a web page then left click to activate for example a hyper link ?

can some one please point me in the right direction
for the php command that can do this or a ready made
php script that can do this.

thanks you
xerxes
xerxes
Forum Newbie
Posts: 5
Joined: Tue Mar 18, 2008 8:45 am

Re: moving and clicking the mouse with PHP

Post by xerxes »

the reason why im doing this is
a family member has disabilities
and i want to make his life a tiny bit
better by having some partial automation
when he is on the internet.

my problem is, the only language i know
is php

xerxes
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: moving and clicking the mouse with PHP

Post by Zoxive »

PHP is server side code, it has nothing to do with real time interaction. It is called on a page load Basis.

Now with JavaScript you can get the mouse coordinates (Listen), but there is no way to control the mouse or any part of the users computer.
xerxes
Forum Newbie
Posts: 5
Joined: Tue Mar 18, 2008 8:45 am

Re: moving and clicking the mouse with PHP

Post by xerxes »

thanks Zoxive for the quick reply

let me explain my concept a little

what i notice is he visits 1 particular website or spend
most of his time there each day. he tends to read a lot from the
site but after a few hours eye strain and fingers becomes
tired so what i thought was this.

all operations will be done localy on his machine.
first, he goes to his favorite site and begin reading
then after 45 - 60 minutes maybe java/php could move the
mouse pointer to the next topic by clicking.

i already done a few local programs for him to get his teeth
into with php but this mouse automation thingy is giving me
grief.

do you think that java script and php could be the solution here
and if so can you still point me in the right direction ?

i know this is not a java site and so im sorry

xerxes
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: moving and clicking the mouse with PHP

Post by John Cartwright »

I think you are looking at this from the wrong angle ;) Your always going to find it hard to manipulate the client machine. Think of security implications if a website could control your mouse/keyboard!

Better yet,

1. capture the contents of the page using file_get_contents(), or cURL, or the other many file handling functions.

2. capture the next link you want to visit using regular expression (we also have a regex forum here)

3. set javascript's setTimeout to redirect to next link using the link captured in regular expression after x minutes

4. display the contents of the page you captured in step 1
xerxes
Forum Newbie
Posts: 5
Joined: Tue Mar 18, 2008 8:45 am

Re: moving and clicking the mouse with PHP

Post by xerxes »

Jcart WOW
really you are a life saver.
i cant believe that i never thought of that my self.

i thank you so much for a solution

thank you so much.
xerxes

ps. thanks again :)
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: moving and clicking the mouse with PHP

Post by onion2k »

Interesting puzzle. I think I'd approach it using Greasemonkey.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Re: moving and clicking the mouse with PHP

Post by Jenk »

meta-refresh may also be an option.
xerxes
Forum Newbie
Posts: 5
Joined: Tue Mar 18, 2008 8:45 am

Re: moving and clicking the mouse with PHP

Post by xerxes »

just for extra knowledge
what is Greasemonkey and how could
meta refresh help ?

thanks
xerxes
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: moving and clicking the mouse with PHP

Post by Chris Corbyn »

xerxes wrote:just for extra knowledge
what is Greasemonkey and how could
meta refresh help ?

thanks
xerxes
Greasemonkey is a firefox extension which allows you to add JavaScript to web pages.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: moving and clicking the mouse with PHP

Post by John Cartwright »

I would most certainly take a look at making a Greasemonkey script, great idea!
AMCH
Forum Commoner
Posts: 31
Joined: Sun Mar 30, 2008 4:39 pm

Re: moving and clicking the mouse with PHP

Post by AMCH »

Alternatively you could program a macro to do this.
Post Reply