Re: Voipbuster script.
- From: "Vince Morgan" <vinhar@xxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 19 Apr 2007 23:15:01 +1000
"Henk Oegema" <henk@xxxxxxxxxx> wrote in message
news:vIGVh.128805$z84.945241@xxxxxxxxxxxxxxxxxxxxxxxx
Dear forum.You could reduce the if; elseif block to the following.
I'm trying to get a (test) script working which would log me in to
VoipBuster and then send a SMS to my mobile phone.
When it is working this script will be used in my Asterisk PBX to send
automatically a SMS message, with the message that telephone number xxxxxx
has called me.
This function is discussed in forum
http://forum.asteriskportal.nl/index.php?topic=288.msg1772#msg1772
(unfortunately (for this forum) in the Dutch language)
To test the script I put in a browser the following address:
http://localhost/sms/sms.php?number=00324763788xx&msg=This is a test
File /srv/www/htdocs/sms/sms.php (SuSE10.2):
=================================
<?php
function encryptString($string)
{
for ($i=0;$i<strlen($string);$i++)
{
$chr = $string{$i};
if ($chr == "0")
{
$chr = "5";
$string{$i} = $chr;
}
elseif ($chr == "1")
{
$chr = "6";
$string{$i} = $chr;
}
elseif ($chr == "2")
{
$chr = "7";
$string{$i} = $chr;
}
elseif ($chr == "3")
{
$chr = "8";
$string{$i} = $chr;
}
elseif ($chr == "4")
{
$chr = "9";
$string{$i} = $chr;
}
elseif ($chr == "5")
{
$chr = "0";
$string{$i} = $chr;
}
elseif ($chr == "6")
{
$chr = "1";
$string{$i} = $chr;
}
elseif ($chr == "7")
{
$chr = "2";
$string{$i} = $chr;
}
elseif ($chr == "8")
{
$chr = "3";
$string{$i} = $chr;
}
elseif ($chr == "9")
{
$chr = "4";
$string{$i} = $chr;
}
}
return str_rot13($string);
}
// Set username and password
$string[$i] = $string[$i]< 5 ? $string[$i]+=5 : ($string[$i]+=5)-10;
That's if, as Jeff has already enquired, $string{$i} should be $string[$i].
HTH
Vince
.
- Follow-Ups:
- Re: Voipbuster script.
- From: Vince Morgan
- Re: Voipbuster script.
- References:
- Voipbuster script.
- From: Henk Oegema
- Voipbuster script.
- Prev by Date: Re: Voipbuster script.
- Next by Date: Re: Voipbuster script.
- Previous by thread: Re: Voipbuster script.
- Next by thread: Re: Voipbuster script.
- Index(es):
Relevant Pages
|