PDA

Click to See Complete Forum and Search --> : Executing a bat file from php?


Muk108
Jan 22nd, 2003, 09:01 PM
Is there a way to execute or do the same thing as what a bat file does? I would like to use ping in command but am not allowed to use it from where i am accessing the web site. So is there a way to exec cmd from where the server is if its on windows or from the client? Thanks for the help.

phpman
Jan 23rd, 2003, 09:21 AM
might not beable to. try exec("file.bat") but if that doesn't work php has some built in functions that check dns.

look into checkdnsrr() or gethostbyaddr() or gethostbyname(), gethostbynamel()

Muk108
Jan 24th, 2003, 02:39 PM
will those tell me the latency of the ips?

phpman
Jan 24th, 2003, 03:00 PM
it will return true if valid and false if nothing or invalid.

Muk108
Jan 25th, 2003, 06:04 PM
so do you know how i can get the latency of an ip?

and say i want to execute the bat file witha variable? would it look like this? exec("file.bat",$variable);

phpman
Jan 25th, 2003, 09:08 PM
why do you want the latency?

either it is there or not

Muk108
Jan 26th, 2003, 12:56 AM
I would like the latency so I can run my script from other places and find the latency of an ip without using command promt. On some computers i go to i cant use command promt.