Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New Coder
    Join Date
    Mar 2009
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    looking for a Php script to act as a simple bot

    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

  • #2
    New Coder
    Join Date
    Mar 2009
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Does anyone know

  • #3
    Regular Coder sea4me's Avatar
    Join Date
    Jan 2009
    Location
    Damn, I don't know...
    Posts
    390
    Thanks
    11
    Thanked 28 Times in 27 Posts
    Are you looking for something like:

    PHP Code:
    $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.

  • Users who have thanked sea4me for this post:

    smooch101 (03-08-2009)

  • #4
    New Coder
    Join Date
    Mar 2009
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Post Thanks thats exacly what im looking for

    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

  • #5
    New Coder
    Join Date
    Mar 2009
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Post How do i use it with a database

    how would i make it into a database

  • #6
    New Coder
    Join Date
    Mar 2009
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Post This is what i will do

    <?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";
    }



    ?>

  • #7
    New Coder
    Join Date
    Mar 2009
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Post

    I have setup the following:

    PHP Code:
    <?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

  • #8
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    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

  • #9
    New Coder
    Join Date
    Mar 2009
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Post This so far works

    <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";
    }



    ?>

  • #10
    Regular Coder sea4me's Avatar
    Join Date
    Jan 2009
    Location
    Damn, I don't know...
    Posts
    390
    Thanks
    11
    Thanked 28 Times in 27 Posts
    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/p...knowledgebase/

  • #11
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello,

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


    Regards,
    sarah_9
    Last edited by Fou-Lu; 03-09-2009 at 08:36 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •