Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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.
 
On top of spaghetti all covered in cheese, there was this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic