user46842: I want to send RFID tag number to PHP page. So far I have sent a fixed string to php and it worked, now I am not getting data in string when i scan rfid tag. I want to store every RFID tag number in a string when it is scanned, so that I can send it to php page.
if (rfid.isCard()) {

    String rfid_uid = "";
    if (rfid.readCardSerial()) {
        String rfid_uid = "";
        for (int i = 0; i < 4; i++) {
            Serial.print(rfid.serNum[i], HEX);
            rfid_uid = rfid.serNum[i];
        }

        Serial.println();
    }
    //delay(7000);
    Serial.print("User ID \n");
    Serial.println(rfid_uid);
    make_request(rfid_uid);
}

This is the path to php page
         String method = "GET /ethernet/data.php?rfid_uid=";


user30175: String rfid_uid = "";
if (rfid.readCardSerial()) {
    String rfid_uid = "";
    for (int i = 0; i < 4; i++) {
        Serial.print(rfid.serNum[i], HEX);
        rfid_uid = rfid.serNum[i];
    }

    Serial.println();
}

This code has multiple problems: 

the variable rfid_uid is defined twice, they are overshadowing each other. The inner part only assigns a value to the rfid_uid delcared in the inside of the if statement, the outer rfid_uid will remain empty
As you can see with Serial.print(rfid.serNum[i], HEX);, the element rfid.serNum[i] is an integer, which is printed as hex. (e.g. 123 = 7B), in rfid_uid = rfid.serNum[i]; you however assign the direct numerical value, without converting it to hex

You can try the following, if you want the serial number as a 4 byte hex string:
String rfid_uid = "";
if (rfid.readCardSerial()) {
    for (int i = 0; i < 4; i++) {
        String uid_part = String(rfid.serNum[i], HEX); 
        Serial.print(uid_part);
        rfid_uid += uid_part;
    }

    Serial.println();
}
//rest as before

This should construct a String object from the integer in HEX format and append (using the += operator it to the rfid_uid string). Thus, after 4 iterations, the String value is built up and can be used in the request.

46842: <p>I want to send RFID tag number to PHP page. So far I have sent a fixed string to php and it worked, now I am not getting data in string when i scan rfid tag. I want to store every RFID tag number in a string when it is scanned, so that I can send it to php page.</p>

<pre><code>if (rfid.isCard()) {

    String rfid_uid = "";
    if (rfid.readCardSerial()) {
        String rfid_uid = "";
        for (int i = 0; i &lt; 4; i++) {
            Serial.print(rfid.serNum[i], HEX);
            rfid_uid = rfid.serNum[i];
        }

        Serial.println();
    }
    //delay(7000);
    Serial.print("User ID \n");
    Serial.println(rfid_uid);
    make_request(rfid_uid);
}
</code></pre>

<p>This is the path to php page</p>

<pre><code>         String method = "GET /ethernet/data.php?rfid_uid=";
</code></pre>
 30175: <pre><code>String rfid_uid = "";
if (rfid.readCardSerial()) {
    String rfid_uid = "";
    for (int i = 0; i &lt; 4; i++) {
        Serial.print(rfid.serNum[i], HEX);
        rfid_uid = rfid.serNum[i];
    }

    Serial.println();
}
</code></pre>

<p>This code has multiple problems: </p>

<ul>
<li>the variable <code>rfid_uid</code> is defined twice, they are overshadowing each other. The inner part only assigns a value to the <code>rfid_uid</code> delcared in the inside of the <code>if</code> statement, the outer <code>rfid_uid</code> will remain empty</li>
<li>As you can see with <code>Serial.print(rfid.serNum[i], HEX);</code>, the element <code>rfid.serNum[i]</code> is an integer, which is printed as hex. (e.g. 123 = <code>7B</code>), in <code>rfid_uid = rfid.serNum[i];</code> you however assign the direct numerical value, without converting it to hex</li>
</ul>

<p>You can try the following, if you want the serial number as a 4 byte hex string:</p>

<pre><code>String rfid_uid = "";
if (rfid.readCardSerial()) {
    for (int i = 0; i &lt; 4; i++) {
        String uid_part = String(rfid.serNum[i], HEX); 
        Serial.print(uid_part);
        rfid_uid += uid_part;
    }

    Serial.println();
}
//rest as before
</code></pre>

<p>This should construct a <code>String</code> object from the integer in <code>HEX</code> format and append (using the <code>+=</code> operator it to the <code>rfid_uid</code> string). Thus, after 4 iterations, the <code>String</code> value is built up and can be used in the request.</p>
