connecting to gateway by php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    connecting to gateway by php

    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

    #2
    Originally posted by atef201080 View Post
    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 ??

    Comment


      #3
      Have you tried using curl?
      Perfection comes at a cost



      I accept liberty!

      Comment


        #4
        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

        Comment


          #5
          you want to create socket connection?

          try
          PHP Code:
          $socket fsockopen(SERVERPORT); 
          replace server and port
          Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

          Comment


            #6
            and where i enter username and password to login!

            Comment


              #7
              If mig33 uses get, you can just pass the username and password in the server.
              Perfection comes at a cost



              I accept liberty!

              Comment


                #8
                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
                Last edited by atef201080; 24.12.10, 20:38.

                Comment


                  #9
                  study fsockopen ..u can make use of that .

                  Comment


                    #10
                    Originally posted by warfrek View Post
                    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.

                    Originally posted by warfrek View Post
                    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!

                    Comment


                      #11
                      i usd that code

                      login.php
                      PHP Code:
                      <?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($socket1024) ;
                                    
                      /////////////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$cmdstrlen($cmd));
                      }
                      ?>
                      and index.php
                      PHP Code:
                      <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

                      Comment


                        #12
                        Sending just Username and password wont log you in. You need to know commands for that.
                        They might be
                        Code:
                        USER username
                        Code:
                        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

                        Comment


                          #13
                          please post an example ksg

                          Comment


                            #14
                            Dnt bother urselves, if the migg developers wanted to make their data available to the public, they'd make an API.

                            Comment


                              #15
                              i can pay someone to make that script to me if someone can make it contact me at blackgun2002@yahoo.com

                              Comment

                              Working...
                              X