hy all please i want to know how i can make a php script to connect to gateway.mig33.com and port 9119 by a username and password Thanks
connecting to gateway by php
Started on the old forum in December 2010 · view the original in the archive · old links redirect here
TL;DR · summary of 21 replies
- -ksg91 suggested using fsockopen or curl to make a socket connection.
- -The username and password alone are not enough to log in, commands need to be sent as well.
- -A user provided an example of authentication commands for mig33.
- -Atef asked for more specific examples but did not receive one.
Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.
atef201080 wrote: hy all please i want to know how i can make a php script to connect to gateway.mig33.com and port 9119 by a username and password Thanks
why u want to do that ??
i dont kn0w what is curl i will make a users kicker like some1 enter a 9 mig33 ids and password and that 9 ids join a chat room at mig33 and kick a user thats all
you want to create socket connection?
try
$socket = fsockopen(SERVER, PORT);
replace server and port
Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in
If mig33 uses get, you can just pass the username and password in the server.
Perfection comes at a cost
I accept liberty!
but mig33 is a server using a java client is it will work? if u want check visit Mobile IM & SMS Text Messaging from mig33 - mig33
Added after 2 minutes:
ksg91 please how i will use that php please post an example
warfrek wrote: study fsockopen ..u can make use of that .
well, i believe studying curl will be a better use of your time. fsock is more supported, but curl beats it by far.
warfrek wrote: study fsockopen ..u can make use of that .
well, i believe studying curl will be a better use of your time. fsock is more supported, but curl beats it by far.
Perfection comes at a cost
I accept liberty!
i usd that code
login.php
<?php
set_time_limit(0);
$host = 'gateway.mig33.com';
$port = '9119';
$user = $_POST['user'];
$pass = $_POST['pass'];
$socket = fsockopen($host, $port) or die('Could not connect to: '.$host);
$userdota = "palma";
if($socket)
{
sendcmd("\r",$socket);
$status = "open";
while($status=="open")
{
$line = @fgets($socket, 1024) ;
/////////////login////////////////
if (strstr($line, "there is no guest account"))
{
sendcmd($user."\r\n",$socket);
sendcmd($pass."\r\n",$socket);
}
//////////////send command ////////////////////
if (strstr($line,"Your unique name: ".$user))
{ sendcmd("/finger ".$userdota."\r\n",$socket);
}
if (strstr($line,"ERROR: Invalid user."))
{
fclose($socket);
$status="close";
$error ="Invalid User";
}
////////////login failed //////////////////////////
if (strstr($line, "Login failed"))
{
$error = "Login Failed";
fclose($socket);
$status="close";
}
flush();
}
}
function sendcmd($cmd,$socket)
{
fputs($socket, $cmd, strlen($cmd));
}
?>
and index.php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Login</title>
</head>
<body>
<form method="post" action="login.php">
<br>
Username: <br>
<input type="text" name="user" size="35" />
<br>
Password:<br>
<input type="password" name="pass" size="35" />
<br>
<input type="submit" value="Login" />
<br>
</form>
</html>
but the username not logged in
Sending just Username and password wont log you in. You need to know commands for that. They might be
USER username
PASS password
you have to send this commands to authenticate. I never worked with mig33 so have no idea about their commands.
Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in
Dnt bother urselves, if the migg developers wanted to make their data available to the public, they'd make an API.
i can pay someone to make that script to me if someone can make it contact me at blackgun2002@yahoo.com
Example:
<?php
$host = "http://gateway.mig33.com";
$port = 9119;
$user = "username";
$pw = "password";
$socket = fsockopen($host,$pw);
fputs($socket,"USER ".$user); // sends username assuming USER is command
fputs($socket,"PASS ".$pass);//sends password
?>
This will authenticate you, rest is up to you.
CreativityKills wrote: Dnt bother urselves, if the migg developers wanted to make their data available to the public, they'd make an API.
agree.
Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in
^what kind of bot?
Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in
this little code might help you, but its not working anymore,just fix it urself. example u save it as bot.php then create a cron job to it through your cpanel (your host must have cron job feature,..of course)
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, “<http://wap.mig33.com/member2/t.php?username=USERNAME&password=PASSWORD&rememberName=on&action=Sign+in&cmd=login”%29;> curl_exec($ch); curl_close($ch); $ch = curl_init(); ?>atef ini saya kasih source code login mig33 yang dulu pernah saya gunakan ini sample source nya
<?Php if(stristr($_SERVER['PHP_SELF'], "mig33API.php")) { die("<h4>You don't have right permission to access this file directly.</h4>"); } /** @OpenKampus mig33API system @PHP Class to perform mig33 action @author goMbiLe.Inc @http://mishacker.net/mig33/ **/ include "protectedUser.lst.php"; //DB for protected user include "premiumUser.lst.php"; //DB for premium user include "fungsi.php"; class gombile { /* Access private */ var $serverHost = "gateway.mig33.com"; //Compatible mig33 server wap.mig33.com port:80, m.mig33.com port:80 var $serverPort = 25; var $filePath = "/member2/t.php"; var $username = null; var $userdef = "cah_gombile"; //handling temporarly cookies var $_cookie = null; //handling fsockopen connection var $fp_handle = null; var $_respon = null; var $_debug = true; var $_debugMsg = array(); var $inRoom = false; var $isPV = false; var $startKick = false; var $kickMe = false; //r vote 2 kick current user is started? /* Access public */ //do login to server function Login($usr, $pwd, $rem=false, $inv=false, $ret=false){ $cookie = is_null($this->_cookie)?"":$this->_cookie; $usr = urlencode($usr); $pwd = urlencode($pwd); //$content: parameter yg akan dikirim ke server lewat method POST $params = "cmd=login&username=$usr&password=$pwd"; $params .= ($rem === true?"&rememberName=on":""); $params .= ($inv === true?"&invisible=on":""); //creating connection to server $this->_createConnection("POST", $this->filePath, $cookie, null, $params, false, false); //get cookie"s $Cookies = array(); if($this->fp_handle) { while(!feof($this->fp_handle)){ //get server respon $respon = @fgets($this->fp_handle, 4096); $this->_respon .= $respon; //get cookie from server respon $isCookie = stristr($respon, "set-cookie"); if($isCookie) { $Cookies[] .= trim(str_ireplace("set-cookie: ", "", $isCookie)); } } }else{ $this->_debugMsg[] .= "Sorry, we couldn't connect to the mig33 server. This is out of our control."; }