Hmmm...jeg kender heller ikke meget til php. Scriptet har jeg ikke lavet selv, men fundet på nettet. Din server skal naturligvis understøtte php.
Se sms-senderen i funktion her
http://users.theroom.dk/klatten/sms/SMSsender.phtmlDen består af 2 filer:
1. selve sms-senderen
2. en liste med de forskellige mobilnumre.
1. ====SMSsender.php====
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<!--
//////////////////////////////////////////////////////////////////////////////
// Copyright 2001 Dan Molberg
//
// Homepage:
http://www.scaninvestor.com/PHPsource///
// E-mail: Webmaster@scaninvestor.com
//
// You may do what you want with this script as long as these lines remain.
// Usages of this script is the users responsibility not the author(s).
//
//////////////////////////////////////////////////////////////////////////////
-->
<html>
<head>
<!-- Minus AutoDato -->
<title>SMSsender</title>
<META NAME=\"Generator\" CONTENT=\"Stone\'s WebWriter 3.5\">
<link href=\"SMSsender.css\" rel=\"stylesheet\">
</head>
<body>
<?
// Sender email.
$sender = \"SMS <svin@domain.com>\";
// Webmaster GSM number.
$webmasternumber = 40348189;
// SMS message length.
$maxmessagelength = \"345\";
if($action == \"send\"){
if (strtolower($numb) == \"cb\") {$numb = $webmasternumber;}
$numb = (($numb+1)-1);
$messagelength = strlen($message);
if ($messagelength > $maxmessagelength) $Error .= \"<strong>Beskeden er for lang!</strong><br>\";
if (empty($from)) $Error .= \"<strong>Indtast afsendernavn!</strong><br>\";
if (empty($message)) $Error .= \"<strong>Indtast besked!</strong><br>\";
if (empty($numb)) $Error .= \"<strong>Indtast modtagernummer!</strong><br>\";
if(empty($Error)) {
include(\"SMSnumberseries.inc\");
$email = $numb.\"@\".$prov;
if ($numb == $webmasternumber) $numb = \"cb\";
if (!empty($prov)) {
$maxmsglen = 115;
$i = 0;
$tmpmsg = $message;
$tmpmsglen = strlen($tmpmsg);
while ($tmpmsglen > $maxmsglen) {
$msg[$i] = substr($tmpmsg, 0, $maxmsglen);
$tmpmsg = substr($tmpmsg, $maxmsglen);
$tmpmsglen = strlen($tmpmsg);
$i++;
}
$msg[$i] = $tmpmsg;
$i++;
$x = 0;
while ($x < $i) {
$tmpmsg = $msg[$x];
$x++;
mail(\"$email\", \"\", \" From: $from - $x/$i :$tmpmsg\", \"Fra:$sender\");
}
if ($i>1) echo \"Besked blev sendt til <strong>$numb</strong> i <strong>$i</strong> dele via <strong>$prov</strong> og CB Search!<br>\";
else echo \"Besked blev sendt til <strong>$numb</strong> via <strong>$prov</strong> og CB Search!<br>\";
}
echo \"<br><a href=\\\"$PHP_SELF\\\">Tilbage</a>\";
}
else {
echo $Error;
}
}
else {
?>
<script language=\"JavaScript\">
<!--
function check() {
document.SMS.charleft.value = <?=$maxmessagelength?> - document.SMS.message.value.length;
}
//-->
</script>
<DIV CLASS=\"headline\">Send SMS til dansk mobil.</DIV><br>
<form action=\"<?=$PHP_SELF?>?action=send\" method=\"post\" name=\"SMS\" id=\"SMS\">
<TABLE>
<tr>
<TD CLASS=\"text\">Mobil nummer:</td>
<td><input type=\"text\" name=\"numb\" size=\"8\" maxlength=\"8\" style=\"border: 1px solid #000000\"></td>
</tr>
<tr>
<TD CLASS=\"text\">Dit navn:</td>
<td><input type=\"text\" name=\"from\" size=\"12\" maxlength=\"10\" style=\"border: 1px solid #000000\"></td>
</tr>
<tr>
<TD CLASS=\"text\">Besked:</td>
<td><textarea cols=\"30\" rows=\"5\" name=\"message\" onkeyup=\"check()\" onchange=\"check()\" style=\"border: 1px solid #000000\"></textarea></td>
</tr>
<tr>
<TD CLASS=\"text\">Tegn tilbage:</td><td><input type=\"text\" name=\"charleft\" value=\"<?=$maxmessagelength?>\" size=\"3\" readonly style=\"border: 1px solid #000000\"></td>
</tr>
<tr>
<td><INPUT TYPE=\"image\" VALUE=\"Send\" SRC=\"../img/sendbut.JPG\" onFocus=blur()></td><td><input type=\"hidden\" value=\" Clear \"></td>
</tr>
</table>
</form>
<DIV CLASS=\"minitext\"><B>Kontakt CB Search!</B> ved at skrive "cb" i mobilnummer feltet. Der kan forekomme lang forsinkelse inden SMS når modtageren. CB Search! kan ikke holdes ansvarlig.</DIV>
<?
}
?>
</body>
</html>
====slut====
2. ======SMSnumberseries.inc=====
<?
if ((20100000<=$numb) and ($numb<=20169999)) $prov = \"sms.tdm.dk\";
elseif ((20190000<=$numb) and ($numb<=20339999)) $prov = \"sms.tdm.dk\";
elseif ((20400000<=$numb) and ($numb<=20499999)) $prov = \"sms.tdm.dk\";
elseif ((20600000<=$numb) and ($numb<=20999999)) $prov = \"note.sonofon.dk\";
elseif ((21200000<=$numb) and ($numb<=21299999)) $prov = \"sms.tdm.dk\";
elseif ((21400000<=$numb) and ($numb<=21499999)) $prov = \"sms.tdm.dk\";
elseif ((21600000<=$numb) and ($numb<=21999999)) $prov = \"sms.tdm.dk\";
elseif ((22100000<=$numb) and ($numb<=22999999)) $prov = \"note.sonofon.dk\";
elseif ((23200000<=$numb) and ($numb<=23999999)) $prov = \"sms.tdm.dk\";
elseif ((24100000<=$numb) and ($numb<=24999999)) $prov = \"sms.tdm.dk\";
elseif ((25100000<=$numb) and ($numb<=25499999)) $prov = \"note.sonofon.dk\";
elseif ((25500000<=$numb) and ($numb<=25599999)) $Error .= \"<b>$numb</b> er et Tele1 Europa nummer og kan ikke modtage sms fra CB Search!<br><br>\";
elseif ((25700000<=$numb) and ($numb<=25799999)) $prov = \"sms.tele2.dk\";
elseif ((25910000<=$numb) and ($numb<=25929999)) $prov = \"sms.tdm.dk\";
elseif ((26100000<=$numb) and ($numb<=26999999)) $prov = \"sms.orangedk.com\";
elseif ((27100000<=$numb) and ($numb<=27499999)) $prov = \"sms.orangedk.com\";
elseif ((28100000<=$numb) and ($numb<=28899999)) $prov = \"gsm1800.telia.dk\";
elseif ((29100000<=$numb) and ($numb<=29999999)) $prov = \"sms.tdm.dk\";
elseif ((40100000<=$numb) and ($numb<=40119999)) $prov = \"sms.tdm.dk\";
elseif ((40130000<=$numb) and ($numb<=40219999)) $prov = \"sms.tdm.dk\";
elseif ((40250000<=$numb) and ($numb<=40469999)) $prov = \"sms.tdm.dk\";
elseif ((40500000<=$numb) and ($numb<=40999999)) $prov = \"note.sonofon.dk\";
elseif ((51100000<=$numb) and ($numb<=51999999)) $prov = \"sms.tdm.dk\";
elseif ((60100000<=$numb) and ($numb<=60199999)) $Error = \"<b>$numb</b> er et Sense Communications nummer og kan ikke modtage sms fra CB Search!<br><br>\";
elseif ((60500000<=$numb) and ($numb<=60509999)) $Error .= \"<b>$numb</b> er et T-Cell nummer og kan ikke modtage sms fra CB Search!<br><br>\";
elseif ((60600000<=$numb) and ($numb<=60699999)) $Error .= \"<b>$numb</b> er et Pqz.com nummer og kan ikke modtage sms fra CB Search!<br><br>\";
elseif ((60910000<=$numb) and ($numb<=60959999)) $prov = \"note.sonofon.dk\";
elseif ((60990000<=$numb) and ($numb<=60999999)) $prov = \"sms.tdm.dk\";
elseif ((61100000<=$numb) and ($numb<=61399999)) $prov = \"sms.tdm.dk\";
else $Error .= \"<b>$numb</b> kendes ikke af CB Search! SMS kan ikke sendes.<br><br>\";
?>
====slut====
Mht til at den kun skal sende til dit nr, så skal du jo bare ændre: <input type=\"text\" name=\"numb\" size=\"8\" maxlength=\"8\" style=\"border: 1px solid #000000\"> til: <input type=\"hidden\" name=\"numb\" value=\"xxxxxxxx\" size=\"8\" maxlength=\"8\" style=\"border: 1px solid #000000\">
xxxxxxxx skal være dit nummer.