Jump to content

ebolisa

Members
  • Content Count

    14
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ebolisa

  • Rank
    Member

Profile Information

  • Location
    Madrid, Spain
  1. Could you give me a hint on how to do that, please.
  2. I understand, but I need to automate the process for my IOT projects 🤔
  3. Yes, I have phpMyAdmin access but only once logged in their system. Do not have access to it directly.
  4. <?php include 'db_conn.php'; // Keep this API Key value to be compatible with the ESP32 code provided in the project page. If you change this value, the ESP32 sketch needs to match $api_key_value = "myKey"; $api_key = $board = $ip = ""; //printf('<pre>Contents of $_POST %s</pre>', print_r($_POST, true)); if ($_SERVER["REQUEST_METHOD"] == "POST") { //printf('<pre>Contents of $_POST %s</pre>', print_r($_POST, true)); //var_dump($_POST)."<br>"; $api_key = test_input($_POST["api_key"]); //printf('<pre>Contents of $api_key: %s<
  5. Hi, My ISP doesn't allow direct access to mysql Server so I created a bridge and stored the PHP code in the main web folder (https://www.mydomain.com/post.php). The bridge works fine and is used mainly for my IOT projects. In the same web folder, is located the conn.php code containing the server's credentials. The question is, how safe is the PHP code at that location? I can create a subfolder but not sure if it matters as far as security is concerned. TIA
  6. Hum, If I comment line 3, it fixes the issue.
  7. Hi, I've a simple code which uses a class from here. When I execute it, I get this error and I cannot understand why my code doesn't see the class. Both files, the class.php and test.php, are in the same folder. Any help is appreciated. TIA <?php require("phpMQTT.php"); $server = "192.168.0.250"; // change if necessary $port = 1883; // change if necessary $username = ""; // set your username $password = ""; // set your password $client_id = "phpMQTT-publisher"; // make sure this is unique for connect
  8. Ok, found the solution. Thank you. <div class="field"> <label for="ck1">Activa</label> <input name="ck1" type="checkbox" value = 1 <?php echo ($status=="1" ? 'checked' : '');?> /> </div>
  9. In my first post you can see the php If statement within the form code.
  10. Ok, so how do I include an If statement within a form code?
  11. Modified a bit the code but still no avail... <?php if ($status == 1){ echo '<input name="ck1" type="checkbox" value='.$status.' checked >'; } else { echo '<input name="ck1" type="checkbox" value='.$status.' >'; } ?> The html output is this... <div class="field"> <label for="ck1">Activa</label> <input name="ck1" type="checkbox" value=0 > </div>
  12. Yes, remains unchecked. It always sends out 0 instead of 1 when checked. I noticed that the double quotes remain around the word checked. Is I remove them, it works.
  13. Hi, I'm trying to check a box in a form based on the $status variable read from a json file. If it's a 1 then the checkbox is checked, otherwise not. If I check/uncheck it, then the $status is written back to the json file. It's a rather simple code but I just cannot get it right. I appreciate any help. TIA <div class="field"> <?php if ($status == 1){ $checked = "checked"; } echo '<input name="ck1" type="checkbox" value='.$status.' '.$checked.' >'; ?> <label for="ck1">Active</label> <!-- <in
  14. Hi, In the following code I'm using a combo box to select a relay and activate it. The code works but if I refresh the page, the last selected relay is activated again. How can I reset the page to default to value '0' which has no relay control? TIA <!DOCTYPE html> <html> <head> <title>Relay control</title> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> <li
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.