0

Hi,

I´ve found a code that is exactly what I need for a POS system based on web language that I am developing.

What it does is send as soon as a pop-up window is activated, the information that appears (shopping items, quantities, etc.) to my email address (so I can later introduce the data in excel).

The problem is that despite receiving an email that has no content.
Does anyone know what might be the problem?


Thanks a lot

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>




<div id="1">

Teste


</div>


<script>
$.post("demo.php", { data : $("div#1").html() }, function(result){
  /* handle results */
});
</script>
<?php

  $to = "EMAIL HERE";
  $subject = "HTML Data";
  $message = $_POST["data"];
  $headers = "From: The Server <server@doe.com>" . "\r\n" .
             "Content-type: text/html" . "\r\n";

  mail($to, $subject, $message, $headers);

?>
2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by diafol
0

Personally, I wouldn't assign an 'id' a number as a value. Why don't you echo out your $message in the php script and alert it out in the js response function , e.g. alert(result); You need to isolate the error. Check the state of the data at each step.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.