- Joined
- Nov 6, 2007
- Messages
- 880
- Reaction score
- 11
Ok well, heres how to make a php bot., and heres an example
That is how you do it, just change it to what u would like to add. It is all done if if statements.
You must be registered to see links
PHP:
<form method="post">
Message: <input name="message" type="text" />
<br />
<input type="submit" value="Send Message" />
<?php
$name =$_POST['name'];
$message =$_POST['message'];
if ( $message == "hello") {
$return = "how are you?";
}
if ($message == "good you?") {
$return = "i am good";
}
if ($message == "good") {
$return = "thats cool";
}
if ($message == "sad") {
$return = "well why are u sad";
}
if ($message == "sad you?") {
$return = "im good, and why so sad?";
}
if ($message == "fine") {
$return = "fine, usually that measn your bored!";
}
if ($message == "fine you?") {
$return = "im good";
}
?>
<br />
<? echo("$return"); ?>
PHP:
The if statement is necessary for most programming, thus it is important in PHP. Imagine that on January 1st you want to print out "Happy New Year!" at the top of your personal web page. With the use of PHP if statements you could have this process automated, months in advance, occuring every year on January 1st.
This idea of planning for future events is something you would never have had the opportunity of doing if you had just stuck with HTML.
Last edited by a moderator: