/    Sign up×
Community /Pin to ProfileBookmark

I am working on intergrating Program E And alice bot to phpnuke. Here is the code. After i will ask the questions.

[code=php] <?php

/*
Program E
Copyright 2002, Paul Rydell

This file is part of Program E.

Program E is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Program E is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Program E; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

/**
* HTML chat interface
*
* Contains the script that outputs the HTML interface for chatting
* @author Paul Rydell
* @copyright 2002
* @version 0.0.8
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @package Interpreter
* @subpackage Responder
*/

require_once(“/home/waterboy/public_html/dive/mainfile.php”);
$module_name = basename(dirname(__FILE__));
get_lang($module_name);

$pagetitle = “- $module_name”;

/**
* Include the guts of the program.
*/
include “/home/waterboy/public_html/dive/modules/NukeAI/admin/respond.php”;

if (isset($HTTP_POST_VARS[‘input’])){
include(“header.php”);
OpenTable();
$numselects=0;

// Start the session or get the existing session.
session_start();
$myuniqueid=session_id();

// Here is where we get the reply.
$botresponse=replybotname($HTTP_POST_VARS[‘input’],$myuniqueid,$HTTP_POST_VARS[‘botname’]);

// Print the results.
print “<B>RESPONSE: ” . $botresponse->response . “<BR></b>”;
print “<BR><BR>execution time: ” . $botresponse->timer;
print “<BR>numselects= $numselects”;

//print_r($botresponse->inputs);
//print_r($botresponse->patternsmatched);

// Include a form so they can say more. Note the hidden part for people that do not have trans sid on but want non-cookie users to be able to use the system.

?>

<html>
<head>
<title>Talk with Anna</title>
</head>
<body>
<form name=”form1″ method=”post” action=modules/NukeAI/index.php”>
<input type=”hidden” name=”<?=session_name()?>” value=”<?=$uid?>”>
<input type=”hidden” name=”botname” value=”<?=$HTTP_POST_VARS[‘botname’]?>”>
Input: <input type=”text” name=”input” size=”55″>

<input type=”submit” name=”Submit” value=”Submit”>
</form>
</body>
</html>

<?
}
else {

$availbots=array();

// Get all the names of our bots.
$query=”select botname from bots”;

$selectcode = mysql_query($query);

if ($selectcode){
if(!mysql_numrows($selectcode)){
}
else{
while ($q = mysql_fetch_array($selectcode)){
$availbots[]=$q[0];
}
}
}
include(“header.php”);
OpenTable();

?>

<html>
<head>
<title>Anna</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
</head>

<body bgcolor=”#FFFFFF” text=”#000000″>
<form name=”form1″ method=”post” action=”modules/NukeAI/index.php”>

Talk to: <select name=”botname”>
<?
foreach ($availbots as $onebot){
print “<option value=”$onebot”>$onebot</option>”;
}
?>
</select><BR>

Input: <input type=”text” name=”input” size=”55″>

<input type=”submit” name=”Submit” value=”Submit”>
</form>

</body>
</html>

<?

}
CloseTable();
include(“footer.php”);

?>[/code]

I get a blank page when the bot should responde. Idont get any error. The header and footer dont load.. Can anyone send me in the right direction…

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @waterboy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...