This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes PHP and the fly likes PHP Send Form to Email Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Languages » PHP
Bookmark "PHP Send Form to Email" Watch "PHP Send Form to Email" New topic
Author

PHP Send Form to Email

Anthony Palazzo
Greenhorn

Joined: Oct 09, 2012
Posts: 3
Hi all. I am fairly new to PHP and I'm running into a few problems and I don't really know where to start. I have a form that is trying to submit and send to an email address. I am using jQuery ajax function along with php mail function. I installed a WAMP server on my PC (not sure if that's where I'm running into an issue). I typically get "syntaxerror: json.parse: unexpected character" error message. Also, if this is not the proper forum to post in, I apologize in advance and please point in the right direction. Thanks! Here's the JavaScript and PHP code:

JavaScript:


PHP:
Nick Charles
Ranch Hand

Joined: Oct 09, 2011
Posts: 67

I suspect that json_encode doesn't like the HTML string contents. Try removing json_encode and just echo the msg. Or remove the HTML tags from the message text.

Anthony Palazzo
Greenhorn

Joined: Oct 09, 2012
Posts: 3
Nick Charles wrote:I suspect that json_encode doesn't like the HTML string contents. Try removing json_encode and just echo the msg. Or remove the HTML tags from the message text.


Hm. Neither seems to be working unfortunately.
Nick Charles
Ranch Hand

Joined: Oct 09, 2011
Posts: 67

If you removed the calls to json_encode you should be getting a different error message. What error are you getting now?

Also, it might help to post the entire error message, or web page with the error message. The full text might provide some insight.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PHP Send Form to Email
 
Similar Threads
Problems sending and receiving with XMLHttpRequest
Javascript and PHP
Using a Variable with AJAX
phpmailer. can not connect to server
Making Two different function run on same element but for different events.