Membuat wrapper SMS gratis IM3 Januari 16, 2008
Posted by bahroell in Tips and tricks.Tags: M3, SMS, Sms gratis, Wrapper
trackback

Berikut langkah – langkah membuat wrapper sms gratis Indosat M3 :
1. Buat account di http://www.m3-access.com
2. Sementara account anda masih limited (terbatas 10 sms /hari)
3. Untuk membuat unlimited account di m3-access.com akan saya posting berikutnya
4. Tulis script dibawah ini pada editor misal : notepad, editplus, dll
5. Simpan dengan nama index yang berekstensi .php (index.php)
<?php
include("lib.php");
$username = "username"; //masukkan username anda
$password = "password"; //masukkan password anda
echo "
<title>Wrapper SMS</title>
";
if($_POST['message'] && $_POST['recipient']) {
$m3 = new m3sms();
$m3->Login($username, $password);
$m3->kirimSms($_POST['recipient'], $_POST['message']);
echo "
<div><h1><span>Laporan</span></h1>
<fieldset>
<legend>Laporan</legend>
<p>
<label>SMS dari:</label><br />
m3."\"><br />
</p>
<p>
<label>ke:</label><br />
<br />
</p>
<p>
<label>Status:</label><br />
status()."\"><br />
</p>
<p>
<ul>
<li><a>« Kirim SMS Lagi</a></li>
<li>By bahroell </a></li>
</ul>
</p>
</fieldset>
</div>";
}
else {
echo "
<div>SMS gratis IM3
</div>
<div><h1><span>FREE SMS</span></h1>
<form>
<fieldset>
<legend>SMS Gratis</legend>
<p>
<label>Kirim ke: </label><br />
<br />
</p>
<p>
<label>Isi SMS:</label><br />
<textarea></textarea><br />
</p>
<p>
characters left
</p>
<p>
<br />
</p>
<p>
<ul>
<li>Terima Kasih</a></li>
</ul>
</p>
</fieldset>
</form>
</div>
";
}
echo "
";
?>
6. Buat lembar baru dan tuliskan script dibawah ini
version = "1.0";
$this->created = true;
if (!extension_loaded('curl')) {
if (isset($_ENV["NUMBER_OF_PROCESSORS"]) and ($_ENV["NUMBER_OF_PROCESSORS"] > 1)) {
$this->created = false;
$a = array(
"action" => "constructing M3SMS object",
"status" => "failed",
"message" => "lib-M3SMS: Using a multithread server. Ensure php_curl.dll has been enabled (uncommented) in your php.ini."
);
array_unshift($this->status_log, $a);
} else {
if (!dl('php_curl.dll') && !dl('curl.so')) {
$this->created = false;
$a = array(
"action" => "constructing M3SMS object",
"status" => "failed",
"message" => "lib-M3SMS: unable to load curl extension."
);
array_unshift($this->status_log, $a);
}
}
}
if (!function_exists("curl_setopt")) {
$this->created = false;
$a = array(
"action" => "constructing M3SMS object",
"status" => "failed",
"message" => "lib-M3SMS: No curl."
);
array_unshift($this->status_log, $a);
}
$this->username = $username;
$this->password = $password;
$this->proxy_host = "";
$this->proxy_auth = "";
$this->use_session = 2;
if ($this->created == true) {
$a = array(
"action" => "constructing M3SMS object",
"status" => "success",
"message" => "lib-M3SMS: Constructing completed."
);
array_unshift($this->status_log, $a);
}
//$this->Login();
}
function setProxy($proxy_host, $proxy_user, $proxy_pass) {
if (strlen($this->proxy_host) > 0) {
$this->proxy_host = $proxy_host;
if (strlen($proxy_user) > 0 || strlen($proxy_pass) > 0) {
$this->proxy_auth = $proxy_user.":".$proxy_pass;
}
$a = array(
"action" => "set proxy",
"status" => "success",
"message" => "lib-M3SMS: Proxy set."
);
array_unshift($this->status_log, $a);
} else {
$a = array(
"action" => "set proxy",
"status" => "failed",
"message" => "lib-M3SMS: no hostname supplied."
);
array_unshift($this->status_log, $a);
}
}
function CURL_PROXY($cc) {
if (strlen($this->proxy_host) > 0) {
curl_setopt($cc, CURLOPT_PROXY, $this->proxy_host);
if (strlen($this->proxy_auth) > 0)
curl_setopt($cc, CURLOPT_PROXYUSERPWD, $this->proxy_auth);
}
}
function Login($username, $password){
$this->cookie = m3_COOKIE_PATH."m3@cookie.txt";
$this->username = $username;
$this->password = $password;
/* looking for sid */
$this->ch = curl_init();
curl_setopt($this->ch, CURLOPT_URL, M3SMS_URL);
$this->CURL_PROXY($this->ch);
curl_setopt($this->ch, CURLOPT_HEADER, 1); // baca header
curl_setopt($this->ch, CURLOPT_USERAGENT, M3SMS_USERAGENT);
curl_setopt($this->ch, CURLOPT_COOKIE, $this->cookie_string);
curl_setopt($this->ch, CURLOPT_COOKIEJAR, $this->cookie);
curl_setopt($this->ch, CURLOPT_COOKIEFILE, $this->cookie);
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
$indexContent = curl_exec($this->ch);
$ereg_sid = ereg("PHPSESSID\=([0-9a-z]+)", $indexContent, $ketemu_sid);
$this->sid = $ketemu_sid[1];
/* Login */
curl_setopt($this->ch, CURLOPT_URL, M3SMS_LOGIN);
$this->CURL_PROXY($this->ch);
curl_setopt($this->ch, CURLOPT_POST, 1);
curl_setopt($this->ch, CURLOPT_USERAGENT, M3SMS_USERAGENT);
curl_setopt($this->ch, CURLOPT_COOKIE, $this->cookie_string);
curl_setopt($this->ch, CURLOPT_COOKIEJAR, $this->cookie.txt);
curl_setopt($this->ch, CURLOPT_COOKIEFILE, $this->cookie.txt);
curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
$loginPost = "username=".urlencode($this->username);
$loginPost .= "&password=".urlencode($this->password);
$loginPost .= "&sid=".urlencode($this->sid);
$loginPost .= "&redirect=".urlencode("index.php");
$loginPost .= "&login=".urlencode("Log in");
curl_setopt($this->ch, CURLOPT_POSTFIELDS, $loginPost);
$loginContent = curl_exec($this->ch);
$this->lihatErrorCurl($this->ch);
// curl_close($this->ch);
}
function kirimSms($recipient, $message) {
// FORM SMS
curl_setopt($this->ch, CURLOPT_URL, M3SMS_FORMSMS);
curl_setopt($this->ch, CURLOPT_POST, 1);
curl_setopt($this->ch, CURLOPT_USERAGENT, M3SMS_USERAGENT);
curl_setopt($this->ch, CURLOPT_COOKIEJAR, $cookiefile);
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1); // langsung return
curl_setopt($this->ch, CURLOPT_VERBOSE, 1);
curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1);
$formSMSContent = curl_exec ($this->ch);
if(empty($this->m3)) {
$ereg_m3 = ereg("<span>\+([0-9a-z]+)", $formSMSContent, $ketemu_m3);
$this->m3 = $ketemu_m3[1];
//echo "\$m3 = $ketemu_m3[1]<br />";
}
// KIRIM SMS
$this->recipient = $recipient;
$this->message = $message;
curl_setopt($this->ch, CURLOPT_URL, M3SMS_KIRIM_SMS);
$this->CURL_PROXY($this->ch);
curl_setopt ($this->ch, CURLOPT_POST, 1);
curl_setopt($this->ch, CURLOPT_REFERER, M3SMS_FORMSMS);
curl_setopt ($this->ch, CURLOPT_COOKIE, $this->cookie_string);
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
$kirimPost = "recipient=".urlencode($this->recipient);
$kirimPost .= "&message=".urlencode($this->message);
$kirimPost .= "&jml_kar=125";
$kirimPost .= "&username=".urlencode($this->m3);
$kirimPost .= "&user_id=&submit=".urlencode("Kirim SMS");
curl_setopt ($this->ch, CURLOPT_POSTFIELDS, $kirimPost);
$kirimContent = curl_exec($this->ch);
$infoKirim = curl_getinfo($this->ch);
if($kirimContent) {
if(ereg("masuk antrian", $kirimContent)) { $this->status = "terkirim"; }
elseif(ereg("Wah, sms hari ini dah 10 sms nih", $kirimContent)) { $this->status = "over-limit"; }
} else {
if (empty($infoKirim['http_code'])) {
$this->status = "No HTTP code was returned";
} else {
$this->status = $infoKirim['http_code'];
}
}
$this->lihatErrorCurl($this->ch);
// curl_close($this->ch);
}
function terkirim() {
return $this->terkirim;
}
function lihatStatusLog() {
print implode("<br>\n", $this->status_log);
}
function status() {
return $this->status;
}
function lihatErrorCurl($ch) {
if (curl_errno($this->ch)) {
echo "cURL info:". print_r(curl_getinfo($this->ch));
echo "<br>";
echo "cURL error number:" .curl_errno($this->ch);
echo "<br>";
echo "cURL error:" . curl_error($this->ch);
}
}
}
?>
7. Simpan dengan nama m3smslib yang berekstensi .php (lib.php)
8. Setelah kedua file tersebut jadi, titipkan pada hosting gratis yang support script php
9. Anda bisa menitipkan di http://www.110mb.com
10. Anda bisa menaruh kedua file tersebut di root direktory atau didirektori yang lain
11. Nah jadi deh wrappernya
12. Anda tinggal memanggilnya pada direktori misal http://coba.110mb.com/sms/
13. Semoga bermanfaat
waaaah bisa dicoba neh….
tapi q masih bingun cara hostingnya. U punya tutorialnya ga’
btw, trims ya ya.. buat share ilmunya…
ne yang terjadi ketika dicoba index.php Nya
padahal sudah benar koq scrypt Nya tapi koq keluar pesan salah kaya gini ya!
Parse error: syntax error, unexpected T_INCLUDE in /www/110mb.com/b/4/s/t/_/_/_/_/b4st/htdocs/index.php on line 2
btw thanks at all
wah waaah hemmm
numpang iklan
sms gratis –> http://cahbagusdw.co.nr/freesms.html
ajarin gimana bikin account unlimited di m3-acces
thanks
Wah..binun 9w,,,g mudeng??cah katrok…
wah loe smua pd bingung?????? pa lagi gw??!!! bahasa mesin smua!!!
weeee e e e e e e e e e e e e e e e e e
tambah cip aE………….
beneran ta bisa zmz gratiz itu?
kLo gt kan Gak paYu kang seng dodolaAn Pulsa ZMZ,Lha Wong iSo ZMZaN Gratiz……
hehehehe
Bwt Eh Kliru BTW kamsudQ……
Thank’S Yo Bro….
Rupanya stlh mentari,matrik dan im3 gabung jd satu di indosatcommunity.com maka script form php free sms yg lama sdh ga bisa di pakai lg, jd yg diperlukan skrg adlh script form free sms yg lbh baru tuk indosatcommunity da yg dah tahu script tsb? Share donk!
Terima kasih atas infonya, tetapi sampai saat ini masih bisa tuh bro dipakek, masalahnya script di http://www.m3-access.com/sms/send_sms.php juga masih aktif and bisa dipakek.
Wah wah.. Ngomongin gratisan emang enak ya! Apalagi tips gratis. Mau tips gratis isi ulang pulsa, isi ulang 1 voucher ke banyak hp, nelpon lokal gratis pk telp umum, nelpon interlokal dan SLI tarif lokal via wartel+telp umum, TIPS GPRS GRATIS PAKE IM3, tips hacking duit lewat ATM dan kartu kredit. Semua ada di situsku berikut ini:
http://profile.yuwie.com/pray88
Sekaligus register ato sign up aja di situsku diatas lumayan 2000x dikunjungi situs yang kamu bikin kamu dapat $63 via check ato PAYPAL, ASYIK KAN..
Keycode-nya gimana?
gak ada key code om.. register aja di http://www.m3-access.com kemudian bikin deh script ini makek notepad.. jadi deh..
bingung hosting scriptnya nech…
ada yg tau ga…????
thanks yooo…..
Waduh.. Binun nich.. :-S kasusnya sama ama sethi.. Apanya ya yang salah.. http://freddy4dyva.wordpress.com
bener gak tuh wrapper smsnya??
jd g?
bales ke email…
kalo tw tutorialnya kirim ke emailku..
hostingnya gratisan g???
tengkyu. . . . . . tengkyu. . . . wat trick2 grtiznya. . . mu cobain aq.. wkekekeke
Mas, itu biar bisa nampilin code php begitu, caranya di wordpress bagaimana? Thanks ya.
Hell..lo bro.. Gw uda coba tp ga berhasil.. Trz klo script sending pake tautan server apaaan yah.. Eh iya ada yg mau nyoba super multi bomber fake sms di http://ebiemarx.blogspot.com.. Try in the hell
thanks for share…
btw nih dah modar kan???