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.
Chat Bot Script
Collapse
X
-
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='$username' and password='$password'"); $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&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&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&password=$password\">» Main Menu «</a> "; # End page: echo "</p>"; echo "</card>"; echo "</wml>"; } # Define function: function unhtmlspecialchars( $string ) { $string = str_replace ( '&', '&', $string ); $string = str_replace ( ''', '\'', $string ); $string = str_replace ( '"', '"', $string ); $string = str_replace ( '<', '<', $string ); $string = str_replace ( '>', '>', $string ); $string = str_replace ( 'ü', '?', $string ); $string = str_replace ( 'Ü', '?', $string ); $string = str_replace ( 'ä', '?', $string ); $string = str_replace ( 'Ä', '?', $string ); $string = str_replace ( 'ö', '?', $string ); $string = str_replace ( 'Ö', '?', $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&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
-
The code above doesn'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]
I have attached the script in txt form and removed all mysql queriesAttached Files
Comment
-
lamar-wap
Here You Go To Set A Greeting Where u see: $chatbot_greeting = "";
You can input YOur OWn Message LikeCode:$chatbot_greeting = "Hello!";
Comment
-
lamar-wap
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 '<?xml version="1.0"?>'; echo '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">'; # 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 ( '&', '&', $string ); $string = str_replace ( "'", '\'', $string ); $string = str_replace ( '"', '"', $string ); $string = str_replace ( '<', '<', $string ); $string = str_replace ( '>', '>', $string ); $string = str_replace ( 'ü', '?', $string ); $string = str_replace ( 'Ü', '?', $string ); $string = str_replace ( 'ä', '?', $string ); $string = str_replace ( 'Ä', '?', $string ); $string = str_replace ( 'ö', '?', $string ); $string = str_replace ( 'Ö', '?', $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
-
lamar-wap
Comment
-
Guest
-
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
-
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 'custid' and 'that' 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 ( '&', '&', $string ); $string = str_replace ( ''', '\'', $string ); $string = str_replace ( '"', '"', $string ); $string = str_replace ( '<', '<', $string ); $string = str_replace ( '>', '>', $string ); $string = str_replace ( 'ü', '?', $string ); $string = str_replace ( 'Ü', '?', $string ); $string = str_replace ( 'ä', '?', $string ); $string = str_replace ( 'Ä', '?', $string ); $string = str_replace ( 'ö', '?', $string ); $string = str_replace ( 'Ö', '?', $string ); return $string; } ?> </wml>
Comment
Comment