Re: [OpenSourceProject] Talk2Me Bot
UPDATED Human :D: :
PHP Code:
<?php
class Human
{
var $First;
var $Name;
var $Middle;
var $Last;
var $Sex;
var $Age;
function Human($first, $middle, $last, $sex, $age)
{
$this->Name = $first;
$this->First = $first;
$this->Middle = $middle;
$this->Last = $last;
$this->Sex = $sex;
$this->Age = $age;
}
function Human_fullName()
{
if (empty($this->Middle))
{
$fullName = $this->First .' '. $this->Last;
} else {
$fullName = $this->First .' '. $this->Middle .' '. $this->Last;
}
return $fullName;
}
function Human_show($name, $sex, $age)
{
$fullName = $this->Human_fullName();
echo '<h3><i>About Me..</i></h3>';
echo '<p>My name is '.$fullName.', you can call me '.$name.' for short.';
echo '<br>';
echo 'I am '.$age.' years old.';
echo '<br>';
echo 'You probably already know due to my name, but I happen to be a '.$sex.'.</p>';
}
function Human_update_show($first, $middle, $last, $sex, $age)
{
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">';
echo '<table border="0">';
echo '<td>First Name: </td><td><input name="name" value="'.$first.'" type="text" /></td></tr>';
echo '<tr><td>Middle Name: </td><td><input name="mname" value="'.$middle.'" type="text" /></td></tr>';
echo '<tr><td>Last Name: </td><td><input name="lname" value="'.$last.'" type="text" /></td></tr>';
echo '<tr><td>Age: </td><td><input name="age" value="'.$age.'" type="text" /></td></tr>';
echo '<tr><td>Gender: </td>';
echo '<td><select name="sex" selected="'.$sex.'">';
echo '<optgroup label="Gender">';
echo '<option value="Male">Male</option>';
echo '<option value="Female">Female</option>';
echo '</optgroup>';
echo '</select>';
echo '</td></tr>';
echo '<tr><td></td><td><input type="submit" name="create" value="Update Human!" /></td></tr>';
echo '</table>';
echo '</form>';
}
}
if ($_POST['create'])
{
$Human = new Human($_POST['name'], $_POST['mname'], $_POST['lname'], $_POST['sex'], $_POST['age']);
} else {
$Human = new Human('Bob', '', 'Bobkinsons', 'Male', 22);
}
$Human->Human_show($Human->Name, $Human->Sex, $Human->Age);
$Human->Human_update_show($Human->First, $Human->Middle, $Human->Last, $Human->Sex, $Human->Age);
?>
Re: [OpenSourceProject] Talk2Me Bot
i think posting ftp details wasnt such a good idea. everything got deleted. lol.
Re: [OpenSourceProject] Talk2Me Bot
free host shut me down ;)
and FTP details was for the open source testing section. You couldn't update the actual 'talk2mebot.freehostia.com' root, only the 'talk2mebot.freehostia.com/openSource/' folder.
But once I looked at their terms, it strictly prohibits any bot making. so yeah.. that's why they shut it down