JP128 Posted August 16, 2007 Share Posted August 16, 2007 Ok, if I have a form that submits, how would I see if a word exists? Hmm, I am not sure how to explain this fully. Quote Link to comment https://forums.phpfreaks.com/topic/65227-seeing-if-a-word-exists-on-a-form-submit/ Share on other sites More sharing options...
ToonMariner Posted August 16, 2007 Share Posted August 16, 2007 strstr($_POST['formfield'],$word); or preg_match('/' . $word . '/i',$_POST['formfield']) will find it for you (if you are using get instead of post then use $_GET...) Quote Link to comment https://forums.phpfreaks.com/topic/65227-seeing-if-a-word-exists-on-a-form-submit/#findComment-325718 Share on other sites More sharing options...
JP128 Posted August 16, 2007 Author Share Posted August 16, 2007 Yea, but how would I get it to see if it existed on a different page, without going to it? Quote Link to comment https://forums.phpfreaks.com/topic/65227-seeing-if-a-word-exists-on-a-form-submit/#findComment-325723 Share on other sites More sharing options...
AndyB Posted August 16, 2007 Share Posted August 16, 2007 Before we all go off at a tangent, why don't you give a better explanation of what it is you really want to do? Some context might help us. Quote Link to comment https://forums.phpfreaks.com/topic/65227-seeing-if-a-word-exists-on-a-form-submit/#findComment-325724 Share on other sites More sharing options...
JP128 Posted August 16, 2007 Author Share Posted August 16, 2007 ok, example. by clicking a button that submits a query to a page on my site, and I want to get a true or false value(if the word is on the page), and then show the answer... hmmm its hard to explain lol Quote Link to comment https://forums.phpfreaks.com/topic/65227-seeing-if-a-word-exists-on-a-form-submit/#findComment-325730 Share on other sites More sharing options...
ToonMariner Posted August 16, 2007 Share Posted August 16, 2007 its must be hrad cos you make no sense at all... where is the content of this 'page' stored - are you checking every other page on your site or just the page this post is going to appear on? give us something to work with fella.... Quote Link to comment https://forums.phpfreaks.com/topic/65227-seeing-if-a-word-exists-on-a-form-submit/#findComment-325731 Share on other sites More sharing options...
AndyB Posted August 16, 2007 Share Posted August 16, 2007 its hard to explain lol It's even harder to solve!! Do you mean you want to check if a particular word already exists on some named page somewhere on the internet? Quote Link to comment https://forums.phpfreaks.com/topic/65227-seeing-if-a-word-exists-on-a-form-submit/#findComment-325733 Share on other sites More sharing options...
JP128 Posted August 16, 2007 Author Share Posted August 16, 2007 ok... lets just say there is a page with the word "true" or the word "false". How would I get that information from that page? Just to see what word exists Quote Link to comment https://forums.phpfreaks.com/topic/65227-seeing-if-a-word-exists-on-a-form-submit/#findComment-325736 Share on other sites More sharing options...
AndyB Posted August 16, 2007 Share Posted August 16, 2007 Here are two hints: #1 - http://ca.php.net/manual/en/function.file-get-contents.php #2 - the more rational a question, the more information you provide, the more likely it is that other people will invest their time in helping. Good luck. Quote Link to comment https://forums.phpfreaks.com/topic/65227-seeing-if-a-word-exists-on-a-form-submit/#findComment-325742 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.