Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $checkin = stripslashes($_POST["checkin"]);
- $val = json_decode($checkin);
- $firstname = $val->user->firstName;
- $lastname = $val->user->lastName;
- $display = $firstname . " " . $lastname . " just checked in! Welcome, " . $firstname . "!";
- $display = urlencode($display);
- // I'm using +++ to indicate the start of the string and &&& to indicate the end for now
- // I plan on writing Arduino code to interpret GET parameters so that it can be more
- // easily ported for other uses.
- $url = "http://ARDUINO_ADDRESS_HERE/+++" . $display . "&&&";
- $str = file_get_contents($url);
- $myFile = "logFile.txt";
- $fh = fopen($myFile, 'a');
- $checkin .= "\n\n";
- fwrite($fh, $checkin);
- fclose($fh);
- echo "OK";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement