• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

PHP Send Form to Email

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
Ranch Hand
Posts: 71
PHP Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 71
PHP Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!