This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

php return true OR echo OR HttpResponse::send()?  RSS feed

 
liliya woland
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm new to php. I have an .html page with an ajax call to php. I can reach the script, and it gets executed. The problem is I have no idea how to pass a value back into my .html page, the response to my ajax call. I have a basic php book that has nothing for it.
Do I need to have a method to have a return statement?
Ideally, I'd use HttpResponse::send(), but I can not get it to work - 500 error.

Please help, I'm lost! In all, I tested with:



Here is what my script looks like:



 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure where its your HttpResponse not returning or not working as it should but have you try using the old traditional AJAX approach using JavaScript getXmlHttpObject() stuff?

By the way, if your PHP script simply do send email, why not just return the status from the mail() function. But again currently that status is nowhere.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!