Chat Bot Script

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

    Chat Bot Script

    Hi, does anyone know where i can get a chat bot script from for my php wap site also a members list script, any help would greatly be appreciated.
    :p:p:p

    #2
    You can get this scripts from lairlava script, there are many things which can be useful for you as you asking for it.
    Advertise your mobile site for FREE with AdTwirl

    Comment


      #3
      Code:
      <?php
      
      # Chatbot for chat ozzy Script
      # Modded by SuB-ZeRo at [email]subzero@goowy.com[/email]
      
      # Send page headers:
      header("Cache-Control: no-cache, must-revalidate");
      
      # Get configuration:
      include("config.inc.php");
      
      # Clear cache:
      header("Pragma: no-cache");
      
      # Affirm content type:
      header("Content-type: text/vnd.wap.wml");
      
      # Connect to and select database:
      $Connect = mysql_connect("$server","$user","$pass");
      mysql_select_db("$dbname");
      
      # Check user details:
      $result = mysql_query("select * from members where username=&#39;$username&#39; and password=&#39;$password&#39;");
      $number_of_rows = mysql_num_rows($result);
      if ($number_of_rows > 0) { include("check.inc.php"); }
      if ($ok>0) {
      include("online.inc.php");
      
      # Affirm doctype:
      echo "<?xml version=\"1.0\"?>\n";
      echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
      
      # Start WML:
      echo "<wml>\n";
      
      # Set variables:
      $chatbot_name = "Bizarre Babe";
      $botid = "b92dd6fffe361ccd";
      $chatbot_greeting = "";
      
      # Get variables:
      $input = $_POST["input"];
      $custid=$_POST["custid"];
      $hostname = "www.pandorabots.com";
      $hostpath = "/pandora/talk-xml";
      
      # Start page:
      echo "<card id=\"\" title=\"$chatbot_name\">\n";
      echo "<p align=\"center\">\n";
      echo "
      \n";
      
      # Show page:
      if ($input!="") {
      $sendData = "botid=".$botid."&input=".urlencode($input)."&custid=".$custid;
      $result = PostToHost($hostname, $hostpath, $sendData);
      $pos = strpos($result, "custid=\"");
      if ($pos === false) {
      $custid = "";
      } else {
      $pos += 8;
      $endpos = strpos($result, "\"", $pos);
      $custid = substr($result, $pos, $endpos - $pos);
      }
      
      # Get reply:
      $pos = strpos($result, "<that>");
      if ($pos === false) {
      $reply = "";
      } else {
      $pos += 6;
      $endpos = strpos($result, "</that>", $pos);
      $reply = unhtmlspecialchars(substr($result, $pos, $endpos - $pos));
      }
      
      # Show reply:
      //echo htmlspecialchars( $reply);
      $hers = $reply;
      $input = htmlspecialchars($input);
      
      # Show form:
      echo "
      [b]$username: [/b]$input
      ";
      echo "[b]$chatbot_name: [/b]$hers
      ";
      echo "
      <input type=\"text\" name=\"input\" maxlength=\"120\" value=\"$input\"/><anchor>";
      echo " Say!";
      echo "<go href=\"chatbot.php?username=$username&amp;password=$password\" method=\"post\">";
      echo "<postfield name=\"input\" value=\"$(input)\"/>";
      echo "<postfield name=\"custid\" value=\"$custid\"/>";
      echo "</go>";
      echo "</anchor>
      ";
      } else {
      echo $chatbot_greeting;
      echo "
      ";
      echo "<input type=\"text\" name=\"input\" maxlength=\"120\" value=\"$input\"/><anchor>";
      echo " Say!";
      echo "<go href=\"chatbot.php?username=$username&amp;password=$password\" method=\"post\">";
      echo "<postfield name=\"input\" value=\"$(input)\"/>";
      echo "<postfield name=\"custid\" value=\"$custid\"/>";
      echo "</go>";
      echo "</anchor>
      ";
      }
      echo "
      
      <a href=\"welcome.php?username=$username&amp;password=$password\">» Main Menu «</a>
      ";
      
      # End page:
      echo "</p>";
      echo "</card>";
      echo "</wml>";
      }
      
      # Define function:
      function unhtmlspecialchars( $string ) {
      $string = str_replace ( &#39;&amp;&#39;, &#39;&&#39;, $string );
      $string = str_replace ( &#39;&#39;&#39;, &#39;\&#39;&#39;, $string );
      $string = str_replace ( &#39;&quot;&#39;, &#39;"&#39;, $string );
      $string = str_replace ( &#39;&lt;&#39;, &#39;<&#39;, $string );
      $string = str_replace ( &#39;&gt;&#39;, &#39;>&#39;, $string );
      $string = str_replace ( &#39;&uuml;&#39;, &#39;?&#39;, $string );
      $string = str_replace ( &#39;&Uuml;&#39;, &#39;?&#39;, $string );
      $string = str_replace ( &#39;&auml;&#39;, &#39;?&#39;, $string );
      $string = str_replace ( &#39;&Auml;&#39;, &#39;?&#39;, $string );
      $string = str_replace ( &#39;&ouml;&#39;, &#39;?&#39;, $string );
      $string = str_replace ( &#39;&Ouml;&#39;, &#39;?&#39;, $string );
      return $string;
      }
      
      function PostToHost($host, $path, $data_to_send)
      {
      
                      $result = "";
              $fp = fsockopen($host,80,$errno, $errstr, 30);
              if( $fp)
              {
                  fputs($fp, "POST $path HTTP/1.0\n");
              fputs($fp, "Host: $host\n");
              fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
              fputs($fp, "Content-length: " . strlen($data_to_send) . "\n");
              fputs($fp, "Connection: close\n\n");
              fputs($fp, $data_to_send);
      
              while(!feof($fp)) {
                          $result .=  fgets($fp, 128);
              }
              fclose($fp);
      
              return $result;
              }
      
      
      }
      
      ?>

      chat box bot get it name it chatbot.php?username=$username&amp;password=$passw ord now enjoy!!!!!!!!!!!
      Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
      Visit: WapMasterz Coming Back Soon!
      _______
      SCRIPTS FOR SALE BY SUBZERO
      Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
      FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
      _______
      Info & Tips
      php.net
      w3schools.com

      Comment


        #4
        The code above doesn&#39;t work for me. it kicks up the following error

        Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/sitex1/public_html/chatbot.php on line 112

        any ideas ??
        :p:p:p

        Comment


          #5
          The code above doesn&#39;t work for me. it kicks up the following error

          Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/sitex1/public_html/chatbot.php on line 112

          any ideas ??[/b]
          Something wrong with bb code here on board.
          I have attached the script in txt form and removed all mysql queries
          Attached Files
          Advertise your mobile site for FREE with AdTwirl

          Comment


            #6
            cheers but stil getting the same error
            :p:p:p

            Comment


              #7
              well line 101 now lol
              :p:p:p

              Comment


                #8
                Ah, okay take this one
                Attached Files
                Advertise your mobile site for FREE with AdTwirl

                Comment


                  #9

                  Cheers... working perfectly now thank you for your help... i really must learn php better lol
                  :p:p:p

                  Comment


                    #10
                    Here You Go To Set A Greeting Where u see: $chatbot_greeting = "";

                    You can input YOur OWn Message Like
                    Code:
                    $chatbot_greeting = "Hello!";

                    Comment


                      #11
                      if you wan tyour chatbot name different from the page title here....

                      Code:
                      <?php
                      
                      # Chatbot for chat ozzy Script
                      # Modded by SuB-ZeRo at [email]subzero@goowy.com[/email]
                      
                      # Send page headers:
                      header("Cache-Control: no-cache, must-revalidate");
                      
                      # Clear cache:
                      header("Pragma: no-cache");
                      
                      # Affirm content type:
                      header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1"); 
                      $ok=1;
                      if ($ok>0) {
                      
                      
                      # Affirm doctype:
                      
                      echo &#39;<?xml version="1.0"?>&#39;;
                      echo &#39;<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" 
                      
                      "http://www.wapforum.org/DTD/wml_1.1.xml">&#39;;
                      
                      # Start WML:
                      echo "<wml>\n";
                      
                      # Set variables:
                      $chatbot_name = "Fimi Babe";
                      $title = "Fimizone.org";
                      $botid = "b92dd6fffe361ccd";
                      $chatbot_greeting = "Hello!";
                      
                      # Get variables:
                      $input = $_POST["input"];
                      $custid= $_POST["custid"];
                      $hostname = "www.pandorabots.com";
                      $hostpath = "/pandora/talk-xml";
                      
                      # Start page:
                      echo "<card id=\"main\" title=\"$title\">\n";
                      echo "<p align=\"center\">\n";
                      echo "
                      \n";
                      
                      # Show page:
                      if ($input!="") {
                      $sendData = "botid=".$botid."&input=".urlencode($input)."&custid=".$custid;
                      $result = PostToHost($hostname, $hostpath, $sendData);
                      $pos = strpos($result, "custid=\"");
                      if ($pos === false) {
                      $custid = "";
                      } else {
                      $pos += 8;
                      $endpos = strpos($result, "\"", $pos);
                      $custid = substr($result, $pos, $endpos - $pos);
                      }
                      
                      # Get reply:
                      $pos = strpos($result, "<that>");
                      if ($pos === false) {
                      $reply = "";
                      } else {
                      $pos += 6;
                      $endpos = strpos($result, "</that>", $pos);
                      $reply = unhtmlspecialchars(substr($result, $pos, $endpos - $pos));
                      }
                      
                      # Show reply:
                      //echo htmlspecialchars( $reply);
                      $hers = $reply;
                      $input = htmlspecialchars($input);
                      
                      # Show form:
                      echo "
                      [b]ME: [/b]$input
                      ";
                      echo "[b]$chatbot_name: [/b]$hers
                      ";
                      echo "
                      <input type=\"text\" name=\"input\" maxlength=\"120\" 
                      
                      value=\"$input\"/><anchor>";
                      echo "Say!";
                      echo "<go href=\"chatbot.php?username=$username\" method=\"post\">";
                      echo "<postfield name=\"input\" value=\"$(input)\"/>";
                      echo "<postfield name=\"custid\" value=\"$custid\"/>";
                      echo "</go>";
                      echo "</anchor>
                      ";
                      } else {
                      echo $chatbot_greeting;
                      echo "
                      ";
                      echo "<input type=\"text\" name=\"input\" maxlength=\"255\" value=\"\"/><anchor>";
                      echo " Say!";
                      echo "<go href=\"chatbot.php?username=$username\" method=\"post\">";
                      echo "<postfield name=\"input\" value=\"$(input)\"/>";
                      echo "<postfield name=\"custid\" value=\"$custid\"/>";
                      echo "</go>";
                      echo "</anchor>
                      ";
                      }
                      
                      echo "
                      
                      <a href=\"http://fimizone.org\">Fimi Zone Home</a>
                      ";
                      
                      # End page:
                      echo "</p>";
                      echo "</card>";
                      echo "</wml>";
                      }
                      
                      # Define function:
                      function unhtmlspecialchars( $string ) {
                      $string = str_replace ( &#39;&amp;&#39;, &#39;&&#39;, $string );
                      $string = str_replace ( "&#39;", &#39;\&#39;&#39;, $string );
                      $string = str_replace ( &#39;&quot;&#39;, &#39;"&#39;, $string );
                      $string = str_replace ( &#39;&lt;&#39;, &#39;<&#39;, $string );
                      $string = str_replace ( &#39;&gt;&#39;, &#39;>&#39;, $string );
                      $string = str_replace ( &#39;&uuml;&#39;, &#39;?&#39;, $string );
                      $string = str_replace ( &#39;&Uuml;&#39;, &#39;?&#39;, $string );
                      $string = str_replace ( &#39;&auml;&#39;, &#39;?&#39;, $string );
                      $string = str_replace ( &#39;&Auml;&#39;, &#39;?&#39;, $string );
                      $string = str_replace ( &#39;&ouml;&#39;, &#39;?&#39;, $string );
                      $string = str_replace ( &#39;&Ouml;&#39;, &#39;?&#39;, $string );
                      return $string;
                      }
                      
                      function PostToHost($host, $path, $data_to_send)
                      {
                      
                                                      $result = "";
                                      $fp = fsockopen($host,80,$errno, $errstr, 30);
                                      if( $fp)
                                      {
                                              fputs($fp, "POST $path HTTP/1.0\n");
                                      fputs($fp, "Host: $host\n");
                                      fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
                                      fputs($fp, "Content-length: " . strlen($data_to_send) . "\n");
                                      fputs($fp, "Connection: close\n\n");
                                      fputs($fp, $data_to_send);
                      
                                      while(!feof($fp)) {
                                                              $result .=  fgets($fp, 128);
                                      }
                                      fclose($fp);
                      
                                      return $result;
                                      }
                      
                      
                      }
                      
                      ?>

                      Comment


                        #12
                        ok let me attach it here.................
                        Attached Files

                        Comment


                          #13
                          Not GOOD

                          Comment


                            #14
                            why no good ??
                            Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                            Visit: WapMasterz Coming Back Soon!
                            _______
                            SCRIPTS FOR SALE BY SUBZERO
                            Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                            FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                            _______
                            Info & Tips
                            php.net
                            w3schools.com

                            Comment


                              #15
                              Code:
                              <?php
                              header("Content-type: text/vnd.wap.wml");
                              header("Cache-Control: no-store, no-cache, must-revalidate");
                              print "<?xml version=\"1.0\"?>";
                              echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
                              ?>
                              <wml>
                              <?php
                              
                              include("config.php"); //load config
                              include("core.php"); //load main functions
                              connectdb();
                              
                                      
                                      //clearnc();
                              $action=$_GET["action"];
                              $id=$_GET["id"];
                              $sid = $_GET["sid"];
                              $botid = "e67d3bc0fe3660d7";
                              $input = $_POST["input"];
                              $custid=$_POST["custid"];
                              $hostname = "www.pandorabots.com";
                              $hostpath = "/pandora/talk-xml";
                              
                               echo "<card id=\"main\" title=\"Hype Bot\">";                   //start of main card
                                      echo "<p align=\"center\">";
                                      echo "
                              ";
                                      
                                      
                                  if ($input!="")
                                  {
                              
                                      $sendData = "botid=".$botid."&input=".urlencode($input)."&custid=".$custid;
                                      // Send the request to Pandorabot
                                      $result = PostToHost($hostname, $hostpath, $sendData);
                                      //TODO: Process the returned XML as an XML document instead of a big string.
                                      // Use string manipulations to pull out the &#39;custid&#39; and &#39;that&#39; values.
                                      $pos = strpos($result, "custid=\"");
                              
                                      // Extract the custid
                                      if ($pos === false) {
                                          $custid = "";
                                      } else {
                                          $pos += 8;
                                          $endpos = strpos($result, "\"", $pos);
                                          $custid = substr($result, $pos, $endpos - $pos);
                                      }
                                      // Extrat <that> - this is the reply from the Pandorabot
                                      $pos = strpos($result, "<that>");
                                      if ($pos === false) {
                                          $reply = "";
                                      } else {
                                          $pos += 6;
                                          $endpos = strpos($result, "</that>", $pos);
                                          $reply = unhtmlspecialchars(substr($result, $pos, $endpos - $pos));
                                      }
                              
                                      //echo htmlspecialchars( $reply);
                                      $hers = $reply;
                                      $hers = parsemsg($hers);
                                           $input=htmlspecialchars($input);
                                           $nick = getnick_uid($uid);
                                           echo "
                              [b]You: [/b]$input
                              ";
                                           echo "[b]Hype Bot: [/b]$hers
                              ";
                                      echo "
                              <input type=\"text\" name=\"input\" maxlength=\"120\" value=\"$input\"/><anchor>";
                                          echo " Say!";
                                      echo "<go href=\"chatbot.php\" method=\"post\">";
                                      echo "<postfield name=\"input\" value=\"$(input)\"/>";
                                      echo "<postfield name=\"custid\" value=\"$custid\"/>";
                                      echo "</go>";
                                      echo "</anchor>
                              ";
                                  }else{
                                    echo "[size="1"]Have fun talking to Hype Bot[/size]
                              
                              ";
                                    echo "<input type=\"text\" name=\"input\" maxlength=\"120\" value=\"$input\"/><anchor>";
                                      echo " Say!";
                                      echo "<go href=\"chatbot.php\" method=\"post\">";
                                      echo "<postfield name=\"input\" value=\"$(input)\"/>";
                                      echo "<postfield name=\"custid\" value=\"$custid\"/>";
                                      echo "</go>";
                                      echo "</anchor>
                              ";
                                  }
                                  
                                  echo "
                              
                              <a href=\"index.php\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>
                              ";
                              echo "</p>";
                                      echo "</card>";
                              
                              function unhtmlspecialchars( $string )
                              {
                                $string = str_replace ( &#39;&amp;&#39;, &#39;&&#39;, $string );
                                $string = str_replace ( &#39;&#39;&#39;, &#39;\&#39;&#39;, $string );
                                $string = str_replace ( &#39;&quot;&#39;, &#39;"&#39;, $string );
                                $string = str_replace ( &#39;&lt;&#39;, &#39;<&#39;, $string );
                                $string = str_replace ( &#39;&gt;&#39;, &#39;>&#39;, $string );
                                $string = str_replace ( &#39;&uuml;&#39;, &#39;?&#39;, $string );
                                $string = str_replace ( &#39;&Uuml;&#39;, &#39;?&#39;, $string );
                                $string = str_replace ( &#39;&auml;&#39;, &#39;?&#39;, $string );
                                $string = str_replace ( &#39;&Auml;&#39;, &#39;?&#39;, $string );
                                $string = str_replace ( &#39;&ouml;&#39;, &#39;?&#39;, $string );
                                $string = str_replace ( &#39;&Ouml;&#39;, &#39;?&#39;, $string );
                                return $string;
                              }
                              
                              ?>
                              </wml>

                              Comment

                              Working...
                              X