Flood Detection System

UKHeliBob:
How is the input wired ?
Any pullup or pulldown resistors in place ?
What do you see if you print x (a truly awful name for a variable, by the way) after reading the input ?

i already figure it out. Turn out my switch are broke. I replace the float switch with a simple button and it gave me the output i want. Now, i do not know how to send my raw data (1 or 0) to php script for processing and send it to my mysql database. I already find many example(most of it use temperature sensors) but do not understand the code.