Go Down

Topic: Asking for help to execute a PHP script (Read 2570 times) previous topic - next topic

psnap

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).

billroy

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: [Select]

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: [Select]

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


-br

Go Up