HowTo: Controll MyPhoneExplorer via an webpage

For user who dont speak german please use this part of my forum
Antworten
fredri
Beiträge: 7
Registriert: Mo 1. Okt 2007, 13:42

HowTo: Controll MyPhoneExplorer via an webpage

Beitrag von fredri »

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

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='; 
and the path to the .bat file.
FJ
Site Admin
Beiträge: 32109
Registriert: Mi 15. Feb 2006, 01:16
Wohnort: Tirol

Beitrag von FJ »

You could do it also via SendMessage - then you'll get a response if MyPhoneExplorer is currently working. You have to send a WM_COPYDATA-Message to MyPhoneExplorer. i don't know if you are able to do this. I don't think it can be done via patch, you would have to write a library (ActiveX) or exe
EvylRat
Beiträge: 3
Registriert: Mo 14. Jan 2008, 17:33
Kontaktdaten:

Beitrag von EvylRat »

This script looks interesting. If I had a webserver running at home, I wonder how I'd be able to trigger txt messaging from my website.

Scenario, my website is a small commuinity of like minding folk who meet up regularly, some of which do not have access to a PC. I have 1000s of free texts to use on my phone. I'd like to use this as some kind of Maillist, except with mobile numbers, so I can txt a bunch of folk off the website. I use MyPhoneExplorer via bluetooth, so since I am usually in the house, my webserver should find my phone.
but like you said, there needs to be some kind of error checking.
Antworten