0

I saved my deviceID in the local storage of the browser with javascript:

<button onclick="store()" type="submit">Zoeken</button>
<script  type="text/javascript">

    //Store deviceID in local storage on button click
    function store(){
        var inputDeviceID= document.getElementById("deviceID");
        localStorage.setItem("deviceID", inputDeviceID.value);
    }
</script>

Now I want to look with php if any data is stored into the local storage and if there is data stored when opening the page go to that URL path, ../sigfoxapp/?deviceID=1B2E4F

$FOLDER = '../sigfoxdata/';
$dir = scandir($FOLDER);
$file = $_GET['deviceID'].'.json' ?: 'DEMO.json';
$fileUrl = $FOLDER.$file;
Zakaria Acharki
  • 66,747
  • 15
  • 75
  • 101

0 Answers0