I hope I can explain my problem well enough for someone to help me.
Problem
One line in a PHP file, within an includes folder on a HTTPS server will not execute (is ignored). If the same PHP file is in an includes folder of a HTTP server, the line will execute.
PHP File
This is a simple PHP file that sends a text message to my cell phone.
Here is the function that contains the problematic code line:
void send_text(int interval, float tank_level){
String current_tank_level = String (tank_level,2);
postData = postVariable + current_tank_level;
unsigned long tank_level_currentMillis = millis();
if (tank_level_currentMillis - tank_level_previousMillis >= interval)
{
tank_level_previousMillis = tank_level_currentMillis;
if (client.connect(server, portNumber))
{
Serial.println("\t ... Connected to Talavera server ....\n");
client.println("POST /includes/test_text.php HTTP/1.1");
client.println("Host: www.talaveramdwca.org");
client.println( "Content-Type: application/x-www-form-urlencoded" );
client.print("Content-Length: ");
client.println(postData.length());
client.println();
client.print(postData);
Serial.println("\n\t\t ... TEXT Sent!\n");
}
if (client.connected()) {
client.stop();
}
}
}
The line of code in question is:
client.println("POST /includes/test_text.php HTTP/1.1");
Using Port 443
If my code uses port 443 all the lines within this if-stmt
if (client.connect(server, portNumber))
are executed except the line in question. So while it seems certain that I am actually connected to the HTTPS server - because the âConnected to âŚâ and âText sentâŚâ lines are executed - the text is never received.
Using Port 80
On the other hand, using this HTTP server and the same exact PHP file, the code executes and the text is received.
So my question is this: How can the problem code line be ignored if I am connected to an HTTPS server, yet execute normally if connected to an HTTP server?
I have failed to solve this issue for months so I hope someone can provide some guidance on solving it.
Thank you very much,
Phillip