Current location: Hot Scripts Forums » General Community » Script Requests » Looking for an input/output script


Looking for an input/output script

Reply
  #1 (permalink)  
Old 10-28-09, 07:31 AM
Marconius Marconius is offline
New Member
 
Join Date: Oct 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Looking for an input/output script

Hi!

I'm a teacher at a high school in the Netherlands. I'm developing a giant quest for mathematics. In support, I would like to use a script for some "secret" answers.

I need a webbased script what makes it possible for children to enter a phrase or word. After hitting enter the script should return a short amount text.

I have the possibility to use PHP and MySQL databases. I don't have money for paying for a script so it should be free.

Who can help me finding such a script!

Thanks in advance!

Last edited by Marconius; 10-28-09 at 07:34 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-28-09, 01:24 PM
ruteckycs's Avatar
ruteckycs ruteckycs is offline
Coding Addict
 
Join Date: Jul 2009
Posts: 377
Thanks: 6
Thanked 10 Times in 10 Posts
Is it a simple this phrase / word matches this answer? Or is there some sort of AI involved? What is your final goal?
__________________
This post was created with 100% recycled electrons.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-29-09, 11:58 AM
Marconius Marconius is offline
New Member
 
Join Date: Oct 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Simple phrase / word match is more then enough. No AI is needed
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 10-31-09, 05:14 PM
og9 og9 is offline
New Member
 
Join Date: Oct 2009
Location: United Kingdom
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Word/Phrase match

I'm not sure if this is what you want, but give it a try, enter your phrases in an array
and then run the script, entering a keyword and the array will be shuffled randomly before
the script runs through looking for a keyword in a phrase.

PHP Code:

<?php

  
  srand
(time());
  
$phrases = array(
    
'The train has already gone, would you like to hire a bicycle?',
    
'Your breath smells like peaches.',
    
'The penguins are in the toilets. ',
    
'Excuse me, do you mind if I stare at you for a minute? I want to remember your face for my dreams.',
    
'My drink is getting lonely. Would you like to join me with yours?',
    
'Where\'s the nearest railway station?'
  
);
  
shuffle($phrases);
  if ( 
$_SERVER['REQUEST_METHOD'] == 'POST')
  {
      foreach(
$phrases as $phrase)
      {
          
$keyword strip_tags($_POST['keyword']);
          if ( 
strstr$phrase$keyword ) )
          {
              
?>
              <h3>Phrase Found</h3>
              <p><strong>Phrase:</strong><br /><?php echo htmlentities($phrase); ?></p>
              <?php
              
break;
          }
      }
  }
?>
<html>
<head><title>Random Phrase/Keyword Matcher</title></head>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
    <input type="text" name="keyword" value="<?php echo @htmlentities($keyword); ?>" />
    <input type="submit" name="sbmt" value="Find Phrase" />
</form>
</html>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 11-01-09, 07:33 AM
Marconius Marconius is offline
New Member
 
Join Date: Oct 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Hmm, it is a nice script but it is not what I'm looking for. I think i need something more simple.

Let me give an example:
If someone enters for example the word "cow", the output should be for example: "Try looking for a horse".

If some enters a number, for example 314, the out should be something like: "Very good, try to solve: 1 + 1 = ?".

These are just some stupid examples, but I hope I've made clear what I want
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 11-01-09, 12:21 PM
ruteckycs's Avatar
ruteckycs ruteckycs is offline
Coding Addict
 
Join Date: Jul 2009
Posts: 377
Thanks: 6
Thanked 10 Times in 10 Posts
This is about as simple as it gets:

The form:
PHP Code:

<form method="post" action="output.php">
<
input type="text" size="20" name="Input">
<
input type="submit" value="Enter">
</
form
The script (output.php):
PHP Code:

<?php
//Get input
$Input=$POST['Input'];
//Remove any blank spaces from end
$Inputtrim($Input);
//Convert to all lower case
$Inputstrtolower($Input);

if (
$Input=="cow"){echo "Try looking for a horse";}
if (
$Input=="315"){echo "Very good, try to solve: 1 + 1 = ?";}
//add new if for each case
?>
Not the way I would do it but it works and is very simple:
http://www.ruteckydp.com
__________________
This post was created with 100% recycled electrons.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Gallery script good/bad idea? joshg678 PHP 2 12-22-08 09:41 AM
Great Script with lots of applications, but.. script_guy Script Requests 2 07-12-08 07:36 PM
Login Script v1.9 Problem SuavyDoodle JavaScript 8 09-28-06 10:13 PM
Help me with this script !!! phpfreek Job Offers & Assistance 0 04-12-06 06:19 PM
Is there any integrity of script rankings? webmaster@atmanager.com Hot Scripts Forum Questions, Suggestions and Feedback 17 08-06-04 01:12 AM


All times are GMT -5. The time now is 08:17 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.