php - input type=text $POST value is null -
I'm trying to send the value of search textbox to keydown on php page via jquery so that it can be displayed Although the results with search keywords, PHP page INPOST is not reading $ _POST in the input box [no button]
html:
.keydown (function () {// Post data var postData = {"bsearch": $ (this) .val ()} / / call $ .ajax ({type: "post", url: "quotes_in.fp"), data: postdata, // it Send your call with success: Nkshn (response) {$ ( "# Bikrot"). Html (response);}});}). . & Lt ;! - Start searching - & gt; & Lt; Div id = "search" style = "display: none;" & Gt; & Lt; Input type = "text" class = "bsearch" name = "search" value = "search" /> & Lt; / Div & gt; & Lt ;! - End Search - & gt;
php:
included_ense "inc / class.quotes.inc.php"; $ Quote = new quote ($ db); If (isset ($ _ POST ['search'])) // $ quotes- & gt; SearchQuotes (); Echo 'search '; Else $ quotes-> Display quotes ();
It seems that it is not reading $ _ POST ['search']
because this text does not search for .
instead goes to the second part and displays the quote.
I have tried to know the code that is happening:
echo "prefix"; Print_r ($ _post); Echo "& lt; / pre & gt;";
This displays an empty array. What am i doing wrong
Change the post data object key for either "search" or check $ _POST [' Bsearch ']
var postData = {"search": $ (this) .val ()};
Comments
Post a Comment