jump to navigation

Membuat wrapper SMS gratis IM3 Januari 16, 2008

Posted by bahroell in Tips and tricks.
Tags: , , ,
trackback

sms.jpg

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>&laquo; 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

Komentar»

1. diens - Januari 18, 2008

waaaah bisa dicoba neh….

tapi q masih bingun cara hostingnya. U punya tutorialnya ga’

btw, trims ya ya.. buat share ilmunya…

2. sethi - Januari 27, 2008

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

3. cahbagus_dw - Februari 5, 2008

wah waaah hemmm
numpang iklan
sms gratis –> http://cahbagusdw.co.nr/freesms.html

ajarin gimana bikin account unlimited di m3-acces
thanks

4. dhenmas - Februari 8, 2008

Wah..binun 9w,,,g mudeng??cah katrok…

5. davis - Februari 23, 2008

wah loe smua pd bingung?????? pa lagi gw??!!! bahasa mesin smua!!!

6. zamy - Februari 26, 2008

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….

7. Joshbudhi - Februari 29, 2008

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.

8. Cewek montok - Maret 16, 2008

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..

9. beta - April 1, 2008

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..

10. kicky - Juni 20, 2008

bingung hosting scriptnya nech…

ada yg tau ga…????

thanks yooo…..

11. freddy4dyva - Juni 21, 2008

Waduh.. Binun nich.. :-S kasusnya sama ama sethi.. Apanya ya yang salah.. http://freddy4dyva.wordpress.com

12. babeh stematel - Juli 28, 2008

bener gak tuh wrapper smsnya??
jd g?

bales ke email…

kalo tw tutorialnya kirim ke emailku..

13. babeh stematel - Juli 28, 2008

hostingnya gratisan g???

14. a-ut - Oktober 4, 2008

tengkyu. . . . . . tengkyu. . . . wat trick2 grtiznya. . . mu cobain aq.. wkekekeke

15. beta - Desember 10, 2008

Mas, itu biar bisa nampilin code php begitu, caranya di wordpress bagaimana? Thanks ya.

16. Ebiem cavalera - Desember 21, 2008

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

17. SUYOTO ANGLING DHARMO - Februari 14, 2009

thanks for share…
btw nih dah modar kan???

18. vale - Agustus 20, 2010

t amoooooooooooo

19. Kirim SMS Gratis - September 29, 2010

mau sms gratis?
disini aja http://www.disms.in

ada fitur inbox + phonebook
dan tanpa iklan loch

Jhoe - November 9, 2010

waw boleh di coba…
thanks infonya gan..

20. mahmudul86 - Juli 31, 2011

Send text message to a Cell Phone

http://sendatextmessagetoacellphone.net

You can Send Free Text Messages or Send SMS Text from PC to cell phone or mobile device.
You can send free SMS text messages to anyone with a SMS or text message enabled mobile phone. You no longer have to pay to send quick SMS or text messages as long as you have access to the Internet.


Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: