Jump to content
php.lv forumi

SMS?


GACHA12

Recommended Posts

Jaaa,daudzi uzreiz teiks offtopic... Bet veel neesmu atradis pilnu skriptu, vai vismaz puspabeigtu.... :P

Taatad - SMS suutiitaajs, kas suuta uz TELE2 un LMT automaatiski nogriezhot saakumu un automaatiski suutot uz iisto.... ;)

Pieraadat, ka esat apdir..anai cieniigi un paraadat scriptu... Tad varat mani droshi aplikt.... Esmu to pelniijis.... :blink:

Link to comment
Share on other sites

Tajā grāmatā tas scripts nedaudz gļuko ar nelieliem uzlabojumiem to gan palaidu :blink: uzraxti parastu sms scriptu lai šķiro pēc tel OP

<? //JA LMT
if (($prefix =="91" || ($prefix =="92")){
$addr = "371".$telNR."@smsmail.lmt.lv";
send_sms($addr,"LMT",sms);
}
//JA Tele2
elseif (($prefix =="60" || ($prefix =="61")){
$addr = "371".$telNR."@sms.tele2.lv";
send_sms($addr,"Tele2",sms);
}
?>

Protams jatceras par to ka te ir tikai 2 no katra OP nummuru prefixiem :blink:

Edited by sviesc
Link to comment
Share on other sites

aTRADU SHITAADU SKRIPTA GABALU

 

<script>

function checkStuff(){

var i,r=false,tmp = document.forms[0].elements[1].value;

for(i=0;i<tmp.length;i++)

if(tmp.charAt(i)!=' '){

r=true;break

}

if(!r){

alert('Lūdzu ievadiet īsziņu nosūtīšanai uz GSM mobilo tālruni !');

document.forms[0].elements[1].value='';

document.forms[0].elements[1].focus();

return false;

}

tmp = document.forms[0].elements[0].value;

if(tmp.length==7)

if('91 92 93 94 62 63 64 65 95 96 97 98 59 60 67 68'.indexOf(tmp.substring(0,2))!=-1)

{

for(i=1;i<7;i++)

if(tmp.charAt(i)<'0' || tmp.charAt(i)>'9'){r=false;break;}

if®{return true;}

}

alert('Lūdzu ievadiet pareizu mobilā telefona numuru !');

document.forms[0].elements[0].focus();

document.forms[0].elements[0].select();

return false;

}

 

function onTextKeyUp()

{

var el = document.forms[0].elements;

if(el[1].value.length>146) el[1].value = el[1].value.substr(0,146);

var sTmp = '' + (146-el[1].value.length) + '';

for(i=sTmp.length;i<3;i++) sTmp = ' ' + sTmp;

el[2].value = sTmp;

};

function onTextKeyDown()

{

var keyCode = event.keyCode;

if(keyCode==9 || keyCode==37 || keyCode==38 || keyCode==39 || keyCode==40)return true;

 

var el = document.forms[0].elements;

if(keyCode!=46 && keyCode!=8)

if(el[1].value.length>145)return false;

if(keyCode==13 && el[1].value.length==145) return false;

return true;

}

 

bet kaa to izveidot parpilnu skriptu ? (lame, lame, lame) :P

Link to comment
Share on other sites

Nee, to sadaliishanu saprotu vareetu buut taa:

 

$a=substr($kam,0,2);

$lmt=array(91,92,93,63,64);

$tele=array(96,97,98,99,67,68,58,59);

 

for($i=0;$i<=count($lmt);$i++)

if($a==$lmt[$i]) $mailojam="+371$kam@smsmail.lmt.lv";

 

for($i=0;$i<=count($tele);$i++)

if($a==$tele[$i]) $mailojam="+371$kam@sms.tele2.lv";

 

bet tieshi viss paareejais sagaadaa gruutiibas... <_<

Link to comment
Share on other sites

Nee, to sadaliishanu saprotu vareetu buut taa:

<?

$a=substr($kam,0,2);

$lmt=array(91,92,93,63,64);

$tele=array(96,97,98,99,67,68,58,59);

 

for($i=0;$i<=count($lmt);$i++)

if($a==$lmt[$i]) $mailojam="+371$kam@smsmail.lmt.lv";

 

for($i=0;$i<=count($tele);$i++)

if($a==$tele[$i]) $mailojam="+371$kam@sms.tele2.lv";

?>

 

bet tieshi viss paareejais sagaadaa gruutiibas...

Link to comment
Share on other sites

×
×
  • Create New...