Du har ihvertfald en lille fejl..
det er gsm1800.telia.dk
ikke sm1800.telia.dk
:)
"Henrik Koksby Hansen" <webmaster@koksby.dk> wrote in message
news:ugjdht45p8i4cch1q0n44cm3v4pkmfdmvo@4ax.com...
> Hej i gruppen. Jeg er ret ny i PHP (har kun læst den første del af
> PHP-tutorial'en på
http://www.webcafe.dk/)
>
> Jeg har forsøgt mig lidt med subj. og har lidt problemer.
>
> Jeg ved ikke om det er for meget at poste koden, men...
>
> --- klip ---
> <?
> // Sender email.
> $sender = "SMS <SMS@domain.com>";
> // Webmaster GSM number.
> $webmasternummer = xxxxxxx;
> // SMS message length.
> $maxmessagelength = "345";
>
>
> if($action == "send"){
> if (strtolower($numb) == "webmaster") {$numb =
> $webmasternummer;}
>
> $numb = (($numb+1)-1);
> $messagelength = strlen($message);
>
> if ($messagelength > $maxmessagelength) {echo "<strong>Message
> was too long!</strong>";}
> elseif ($from == "") {echo "<strong>No name given!</strong>";}
> elseif($message == "") {echo "<strong>No message
> given!</strong>";}
> elseif($numb == 0) {echo "<strong>No number given!</strong>";}
> else {
>
> 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<=20409999)) { $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<=25399999)) { $prov =
> "note.sonofon.dk"; }
> elseif ((25500000<=$numb) and ($numb<=25599999)) { echo
> "<b>$numb</b> is a Tele1 Europa number we don't know there
> e-mail.<br><br>"; }
> elseif ((25700000<=$numb) and ($numb<=25799999)) { echo
> "<b>$numb</b> is a Tele2 number we don't know there e-mail.<br><br>";
> }
> elseif ((25910000<=$numb) and ($numb<=25929999)) { echo
> "<b>$numb</b> is a TelePassport number we don't know there
> e-mail.<br><br>"; }
> elseif ((26100000<=$numb) and ($numb<=26999999)) { $prov =
> "sms.mobilix.dk"; }
> elseif ((27100000<=$numb) and ($numb<=27399999)) { $prov =
> "sms.mobilix.dk"; }
> elseif ((28100000<=$numb) and ($numb<=28899999)) { $prov =
> "sm1800.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<=51399999)) { $prov =
> "sms.tdm.dk"; }
> elseif ((51600000<=$numb) and ($numb<=51999999)) { $prov =
> "sms.tdm.dk"; }
> elseif ((52200000<=$numb) and ($numb<=52299999)) { echo
> "<b>$numb</b> is a Sense Communications number we don't know there
> e-mail.<br><br>"; }
> else { echo "<b>$numb</b> is for us not a know GSM cellular
> number.<br><br>";}
>
> $email = $numb."@".$prov;
>
> if ($numb == $webmasternummer) {$numb = "Webmaster";}
>
> if (!$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", "From: $sender");
> }
> if ($i>1) {
> echo "Message was sent to
> <strong>$numb</strong> in <strong>$i</strong> parts using
> <strong>$prov</strong>.<br>";
> }
> else {
> echo "Message was sent to
> <strong>$numb</strong> using <strong>$prov</strong>.<br>";
> }
> }
> echo "<br><a href=\"$PHP_SELF\">Back</a>";
> }
> }
> else {
> ?>
> --- klip ---
> + et lille stykke javascript til at holde øje med antal tegn og så en
> form, hvor man putter modtager osv. ind.
>
> Skulle det være rigeligt til at sende en SMS ? Mangler der ikke den
> del, som sender e-mail'en ?
>
> Alt ser ud til at fungere fint - bortset fra at sms'en aldrig kommer
> frem.. .
>
> Scriptet kan ses online på
www.koksby.dk/smssender.phtml
>
>
>
>