arduino connection xampp + php

:frowning: :frowning: I wanna connect arduino ethernet over xampp. below is my arduino code which connect with sd card webserver. now i connect with xampp . what is changes in below code please help me.

simply switch status display on webpage . php page stored in xampp and connect with arduino .

please help me please suggest changes in below code.
Thanks

webpage.txt (1.71 KB)

arduino code.ino (6.29 KB)

#1
#2
#3
#4
#5

This is the sixth time you start the exact same thread.

Here's what I'd do:

  • Save the webpage to your hosting folder on the server
  • In JavaScript on the web page, send an XMLHttpRequest to the Arduino
  • Have the Arduino respond with the states of the buttons
  • Update the web page using JavaScript

You could send the button states as a JSON array if you have multiple buttons:

char state_str[nb_outputs * 2 + 1 + 1]; // one '[' , one digit + 1 comma for each output, last one doesn't have a comma but a ']', then a NULL terminator
  state_str[0] = '[';                      // Get the state of the selected output
  for (uint8_t i = 0; i < nb_outputs - 1; i++) {
    state_str[2 * i + 1] = digitalRead(outputs[i]) + '0';
    state_str[2 * i + 2] = ',';
  }
  state_str[nb_outputs * 2 - 1] = digitalRead(outputs[nb_outputs - 1]) + '0';
  state_str[nb_outputs * 2] = ']';
  state_str[nb_outputs * 2 + 1] = '\0';

Pieter

That's not how it works. You can ask for general advice, or you can show your attempts and ask for help when you get stuck, but no one is going to write sample code for you if you're just too lazy to try it yourself.

Pieter

STOP CROSS-POSTING

Duplicates deleted.