Jump to content
Chuks

How to fix: Warning: stristr(): Empty needle in c:

Recommended Posts

I was trying to use Ajax to  to communicate with the server while a user types characters in the input field.

After creating the HTML code, and the PHP file, on testing it I got the error message: "Warning: stristr(): empty needle in C:\wamp\www\php\revision\ajax\gethint.phponline 50". 

I don't understand or know how to get around the error.

Please help

( ! ) Warning: stristr(): Empty needle in C:\wamp\www\php\revision\ajax\gethint.php on line 50
Call Stack
# Time Memory Function Location
1 0.0002 385600 {main}( ) ...\gethint.php:0
2 0.0002 386544 stristr ( ) ...\gethint.php:50

 

 

ajax and php.php gethint.php

Share this post


Link to post
Share on other sites

You have to provide the string to search through (haystack) AND the string to search for (needle), its telling you you only have the first. So you are looking through the haystack not knowing what the needle looks like.

Share this post


Link to post
Share on other sites

Thanks, but I don't know how to provide it. I am only working with the w3schools.com tutorial on PHP  - Ajax and PHP. If you. You would notice the file "gethint.php" is as in the tutorial.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...