Interfacing arduino and php

hello,
Am trying to send the rfid tag value from arduino to a text box in php. Any idea how to do this? :slight_smile:
I am using EM-18 reader module, Ethernet shield, Arduino uno r3.. provide me with the code please!

Am trying to send the rfid tag value from arduino to a text box in php.

PHP doesn't have text boxes. HTML forms that might include PHP scripting might. A client that renders the HTML form might render something that looks like a text box.

You can NOT send data from the Arduino to a client, unless the Arduino is wearing an Ethernet shield and acting as a server. If that is the case, PHP won't be involved, since the Arduino can not execute PHP scripts.

You could have the Arduino as client invoke a PHP script that runs on a server, and have the PHP script store the data in a database.

Then, you could have another PHP script, that the client executes, that gets data from the database.

provide me with the code please!

The code to do what, exactly?

I am not familiar with Ethernet shield. I want the code to interface arduino and php which runs on the system.
Actually, I have fetched the RFID tag value using RFID reader and arduino. I have created a form in php which contains some labels and textboxes. I need to print that fetched RFID tag value to one of the textboxes in that form(in PHP), so that i would complete other details in the form and i would save it to mysql database.
I need code for this part- about sending RFID tag value from arduino to that form in a php is confusing.

Thanks in advance! :slight_smile:

I want the code to interface arduino and php which runs on the system.

Runs on what system? PHP can not run on the Arduino. So, you need some way to get data from the Arduino to the machine where PHP can run. How are you going to do that?

There must be some application running on the machine that the Arduino is talking to, that can read serial data and get some PHP script running. What application is that going to be?

I saw in one article about sending arduino data to php via ethernet shield. That data was from a sensor. I am using RFID. so i need to send the rfid tag value to php.
Is that possible?
And regarding that application, I have no clue. Any example please.

Is that possible?

Data is data. It doesn't matter where the Arduino got it. So, yes.

Thank you :slight_smile: Any idea how this can be done?

Any idea how this can be done?

What part of it? Buying the ethernet shield? That seems pretty simple.
Connecting it? It only fits one way.
Making the Arduino act as a client? There is an example in the ethernet library folder that you customize to talk to your server/script.
Reading the RFID data from the RFID device?
Writing the PHP script?

Thanks. Yes, Quite simple. I have bought Ethernet module instead of ethernet shield. So, have included ethermaster libraries. The code for ethernet shield and ethernet module differs right?