ESP8266 Developer Zone The Official ESP8266 Forum 2016-12-12T17:21:45+08:00 https://bbs.espressif.com:443/feed.php?f=65&t=3165 2016-12-12T17:21:45+08:00 2016-12-12T17:21:45+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3165&p=10879#p10879 <![CDATA[Re: Problem with send data on the website]]> This is Greg, did I write back to you about this issue from feedback? I don't quite remember.....

Statistics: Posted by Guest — Mon Dec 12, 2016 5:21 pm


]]>
2016-12-04T05:13:15+08:00 2016-12-04T05:13:15+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3165&p=10765#p10765 <![CDATA[Problem with send data on the website]]> I have problem with ESP8266.
I wanna send data on the web page but the data does not arrive.
I use AT command.
I send

Code:

AT+CWJAP="MK_WiFi","password"
AT+CWMODE=3
AT+CIPMUX=1
AT+CIPSTART=1,"TCP","77.89.97.41",80
AT+CIPSEND=1,155
POST /send.php HTTP/1.1\r\n
Host: 77.89.97.41\r\n
Content-type: application/x-www-form-urlencoded\r\n
Content-length: 19\r\n\r\n
field=255&value=255


The PHP code

Code:

<?php
include("./admin/config.php");

   $field = $_POST['field'];
   $value = $_POST['value'];
   
echo '<! DOCTYPE HTML PUBLIC "- // // DTD HTML IETF 1.1 // EN">
<html>
   <head>
      <title>Wysylanie daty</title>
   </head>
<body>';
   db_connect();
      $datenow = date("Y-m-d H:i:s");
      $sql = "INSERT INTO test (logdata, field, value) VALUES('$datenow', '$field', '$value')";
      $result = mysql_query($sql);
      echo "Wyslano....";
   db_close();
?>
</body>
</html>

The code work.

The answer

Code:

+IPD,1,462:HTTP/1.1 400 Bad Request
Date: Sat, 03 Dec 2016 15:56:04 GMT
Server: Apache

Content-Length: 296
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
Request header field is missing ':' separator.<br />
<pre>
\n\r</pre>
</p>
</body></html>

OK


Thank you for help.

Statistics: Posted by matti9410 — Sun Dec 04, 2016 5:13 am


]]>