Pages: 1 [2]   Go Down
Author Topic: Asking for help to execute a PHP script  (Read 2135 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Problem solved!
My problem was a matter of rights on WAMP server.
For others who has same problem, you have to look in the Apache log file.
I change the Apache ini file "httpd.conf". Look for:
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    deny from all     <<<-- Change from deny to Allow
</Directory>

Also check your Firewall allow post 3306 (default).
Logged

0
Offline Offline
God Member
*****
Karma: 39
Posts: 988
Get Bitlash: http://bitlash.net
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't think this code is generating the correct GET syntax:

GET updateDB2.php HTTP/1.1

I think it's generating:

GET updateDB2.php
HTTP/1.1

Which will not make the server happy.

Code:
if (client.connect(server, 80))
 {
    Serial.println("connected");
    Serial.println(t);
    Serial.println(h);
    Serial.println(d);
    client.println("GET updateDB2.php");
    client.println("HTTP/1.1");
    client.println("Host: localhost");
    client.println("User-Agent: Arduino\r\n");
    client.println("Accept: text/html\r\n");
    client.println("Connection: close");
    client.stop();
    client.println();
    Serial.println("Client closed!");
  }

Further, it is stopping the client connection before closing the header, sort of bad form.  Swap the bottom two lines:

Code:
    client.println("Connection: close");
    client.stop();
    client.println();

-br
Logged

Pages: 1 [2]   Go Up
Jump to: