...

View Full Version : looking for a Php script to act as a simple bot



smooch101
03-07-2009, 11:38 AM
i am looking for a php script that does not require a database that would for example someone says in a chatbox what is mysite.com then php automaticly awnsers visit our site on www.mysite.com etc questions.

i am beginning at learning php so please make the awnser easy to understand

smooch101
03-07-2009, 11:19 PM
Does anyone know

sea4me
03-08-2009, 05:45 AM
Are you looking for something like:



$chat = "What is example.php?"

if($chat == "What is example.php?"){
echo "It's a testing PHP file";
}


Or are you looking for something like a search? You would be better with a mySQL database if you want something like a search. :thumbsup:

smooch101
03-08-2009, 12:41 PM
thanks heaps but do i just copy it like this:

$chat = "What is example.php?"

if($chat == "What is example.php?"){
echo "It's a testing PHP file";
}


$chat = "What is example.php?"

if($chat == "What is example.php?"){
echo "It's a testing PHP file";
}

etc for more questions:)

smooch101
03-08-2009, 12:42 PM
how would i make it into a database

smooch101
03-08-2009, 12:44 PM
<?php
$chat = $_POST["chatbox"];

if($chat == "What is example.php?"){
echo "It's a testing PHP file";
}


$chat = $_POST["chatbox"];

if($chat == "Where is the homepage"){
echo "It's at mysite.com";
}

$chat = $_POST["chatbox"];

if($chat == "Where is the login page"){
echo "It's at mysite.com/login.php";
}



?>

smooch101
03-08-2009, 12:46 PM
I have setup the following:


<?php
$chat = $_POST["chatbox"];

if($chat == "What is example.php"){
echo "It's a testing PHP file";
}


if($chat == "What is example.php"){
echo "It's a testing PHP file";
}



if($chat == "What is example.php"){
echo "It's a testing PHP file";
}



if($chat == "What is php"){
echo "It's a testing PHP file";
}



?>

But what about if someone says

what is php

what will that output:

the same

oesxyl
03-08-2009, 12:53 PM
there are some sticky threads in php forum, start from there for tutorials and documentation about php. I don't know if there is a link to manual so if not:

http://www.php.net/manual/en/langref.php

post question and problems but be more specific and try to make them simple and clear.

best regards

smooch101
03-08-2009, 12:54 PM
<form action="<?php echo $PHP_SELF; ?>" method="post">
Enter The Question: <input type="text" name="chatbox" />
<input type="submit" />
</form>
<br />
<?php
$chat = $_POST["chatbox"];

if($chat == "What is adsinoz.com"){
echo "Adsinoz.com offers lots of things including Online Guides \n Advertiser \n and lots more";
}


if($chat == "Whats wippetau.com"){
echo "Visit www.wippetau.com to find out";
}



if($chat == "What is example.php"){
echo "It's a testing PHP file";
}



if($chat == "What is php"){
echo "It's a testing PHP file";
}



?>

sea4me
03-09-2009, 12:49 AM
If you want to use mySQL ,you would make a SQL query with like, example:
http://www.htmlite.com/mysql011.php

I think what you want is a FAQ:
http://www.hotscripts.com/category/php/scripts-programs/faq-knowledgebase/

sarah_9
03-09-2009, 08:08 AM
Hello,

Hey friend, find any good web tutorial , it will help you in getting all the concepts of php.


Regards,
sarah_9



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum