search

Home  >  Q&A  >  body text

The data sent by front-end ajax is printed as Null in the back-end TP controller, but can be seen when returned to the front-end console.

As shown in the figure below, the backend cannot use the $keyWord obtained? The print shows Null. But if you return to the front end, console.log() can print it out. If the backend splices other strings, the frontend console.log() can also print out the spliced ​​strings. But this $keyWord cannot be used in the back-end controller. Please advise, thank you all.

QQ图片20285943.png29090204.png

flfl1678 days ago1217

reply all(1)I'll reply

  • fl

    fl2020-06-29 09:13:19

    The above code is written incorrectly. It should be $request->param('keyword');, but the problem is not here. This is the mistake I made before taking the screenshot.

    reply
    0
  • Cancelreply