interfacing rfid troubleshoot

hi, i am working on a project which reads an rfid tag using an em18 reader and sends the id through serial coms to the pc. Unfortunately i happen to receive multiple values of the id. Like if 12345678 was an id, the i would be receiving 1234567812 45678123 etc. Any helps would be appreciated.

int id=12;
char input[12];
int sensor;
int status=13;

void setup()

void loop() 
int off=5;
int on=10;
if (sensor>5)  //this is an ldr which would enable or disable rfid reader
   digitalWrite(id,LOW);   //disable rfid

   digitalWrite(id,HIGH);  //activate rfid


What is connected to the Serial port? Is it the PC or the RFID reader? Both is the wrong answer.

input is NOT a string. Do not attempt to use it like it is a string. A string is a NULL terminated array of chars. You have not bothered to NULL terminate your array, so it is NOT a string, and should not be passed to functions that expect strings.