Jump to content

Is this type of thing possible with PHP?


galvin

Recommended Posts

I have found a way using Javascript to do the following, but I'd like to know if there is a way to do it using PHP...

 

I have a single text file where users enter answers that are stored in an array.  If whatever "guess" they enter in the field matches any of the answers in the array, the answer immediately displays on the screen in a list below the main "guessing" field.

 

So if "mother" was in the array and the user typed "mother" into the guessing field, as soon as the "KeyUp" from the letter "r" occured, Javascript sees that it matches an answer exactly and does it's thing to make it show up somewhere else (and also wipe clear the guessing field so that it's ready for a new guess).

 

Is this same thing possible with PHP, or, because it's server side, can PHP not really compare on the fly like javascript is doing?  In other words, I feel like there would have to be a "Submit" button to send the "guess" to the server to do any PHP comparisons. Is that right?

 

I really need the comparison to occur AS SOON AS the guess matches the answer, so I really dont want to make the user click a Submit button.  If this simply can't be done using PHP, that's fine, I just want to find out either way.

 

Let me know what you think.

 

Thanks

Greg

Link to comment
https://forums.phpfreaks.com/topic/156102-is-this-type-of-thing-possible-with-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.