Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

php can used to connect mobile phone in the comport ?

Posted on 2009-02-11
1
Medium Priority
?
531 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

0
Comment
Question by:ftpphptest1
1 Comment
 
LVL 4

Accepted Solution

by:
AdamsConsulting earned 2000 total points
ID: 23618668
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.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question