We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

php can used to connect mobile phone in the comport ?

ftpphptest1
ftpphptest1 asked
on
Medium Priority
558 Views
Last Modified: 2013-12-13
i find a php script used for connect to the comport, can anyone give the explanation of the code?

also, if i can connect to the comport by php, can i use it to control the mobile to send message? thx

<?php   
exec('mode COM1: baud=19200 data=8 stop=1 parity=n');   
$fd = dio_open('COM1:', O_RDWR);   
while (1) {   
    $data = dio_read($fd, 1);   
    if ($data) {   
        echo $data;   
    }   
}   
dio_close($fd);   
?>

Open in new window

Comment
Watch Question

This code opens a file named COM1:. It would only open a serial port if you had a device named COM1:, which is likely only going to work on PHP for Windows. It then oddly creates a file handle for read write, and then only reads from the file handle until no more data is available to be read and then closes the file handle.

http://devzone.zend.com/manual/function.dio-open.html

It's unlikely that your mobile phone would have a serial interface for sending SMS messages unless it was running Windows Mobile and you wrote the Interface yourself.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.