HTML / PHP / Javascript help with Arduino + Ethern

Hello,

I'm trying to control an arduino with ethernet shield using another webserver that has PHP, HTML, and Javascript.
I just help figuring out how to run the POST method without actually going to that link.

For instance, on my network, if I go to "http://192.168.1.77/?l=rgb000000255", it will turn the RGB led on the arduino on with blue coloration.
now for red I would do the same but use rgb255000000.
Now for my home webserver, I created a button that on submit, it use the method POST, and go to that link, which turns on the light, no problem.

The problem is doing it like that, it also go to a "blank" page because it treats it as a link. How can I get it to execute the link, without actually going to it?

Sorry if it's a little confusing, I dont know how else to explain it. I know I did it before like this using PHP, but I was getting a lot of errors using .include in php.

For instance, on my network, if I go to "http://192.168.1.77/?l=rgb000000255", it will turn the RGB led on the arduino on with blue coloration.

How do you "go to" that URL?

The problem is doing it like that, it also go to a "blank" page because it treats it as a link.

It? The "blank" page is probably because the Arduino isn't properly returning a html page.

but I was getting a lot of errors using .include in php.

We could probably help resolve them, if you posted the PHP file and the error messages.

I got it to work by using setting the Arduino to redirect after running the command to the original website :slight_smile: Thanks anyway.

I got it to work by using setting the Arduino to redirect after running the command to the original website.

A better way (better in that you wouldn't need the page refresh and attendant web traffic that entails) would be to have the link be a dummy (ie, href="#"), with the onclick event calling a javascript function that performs an ajax post to the link in question.