HowTo: Controll MyPhoneExplorer via an webpage
Verfasst: Do 8. Nov 2007, 02:03
I Wanted to be able to send messages via an webpage so I made an very simple web page that is able to control My Phone Explorer via internet.
What you need in an windows comouter and a webserver that support php.
I used Windows XP pro and IIS + PHP (www.php.net)
index.html
save.php
This is an very simple prof of concept, and can be done in a better way. Using a .bat file is not ideal (i two people try to send an sms at the same time it will go badly.) Also using a myriad of variables is most likely not the best way to do it.
I will try to make this better later.
To be able to use this all you need to change is tha path to the .exe file in this line
and the path to the .bat file.
What you need in an windows comouter and a webserver that support php.
I used Windows XP pro and IIS + PHP (www.php.net)
index.html
Code: Alles auswählen
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="save.php" method="post">
<textarea name="tele"></textarea>
<textarea name="medelande"></textarea>
<br />
<input type="submit" value="Save">
</form>
</body>
</html>
save.php
Code: Alles auswählen
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SMS sender</title>
</head>
<body>
<p>
<?php
$fixed = 'C:\"Program Files"\MyPhoneExplorer\MyPhoneExplorer.exe action=sendmessage savetosent=1 number=';
$fixed2 = "text=";
$tele = $_POST['tele'];
$medelande = $_POST['medelande'];
$file = "file.bat";
$Saved_File = fopen($file, 'w');
fwrite($Saved_File, $fixed);
fwrite($Saved_File, $tele);
fwrite($Saved_File, " ");
fwrite($Saved_File, $fixed2);
fwrite($Saved_File, '"' );
fwrite($Saved_File, $medelande);
fwrite($Saved_File, '"' );
fclose($Saved_File);
exec('C:\Inetpub\wwwroot\20\file.bat');
?>
</p>
</body>
</html>
This is an very simple prof of concept, and can be done in a better way. Using a .bat file is not ideal (i two people try to send an sms at the same time it will go badly.) Also using a myriad of variables is most likely not the best way to do it.
I will try to make this better later.
To be able to use this all you need to change is tha path to the .exe file in this line
Code: Alles auswählen
$fixed = 'C:\"Program Files"\MyPhoneExplorer\MyPhoneExplorer.exe action=sendmessage savetosent=1 number=';