• Hello,

    I hope you're doing well.

    I'm new to this and I'm working on a small project with Puck.js. Here's what I'm trying to do:

    I've made a simple webpage using PHP. When a user logs in on their mobile, it takes them to a details page showing a few pieces of information.

    Now, when the user taps their phone on the Puck device, I want the NFC function to activate and record the date and time.

    I have code that currently works fine. It shows the date and time when the phone is tapped on the Puck device. Here's the code:

    NRF.nfcURL('https://www.espruino.com');

    NRF.on('NFCon', function() {

    var currentTime = new Date();
    var day = currentTime.getDate();
    var month = currentTime.getMonth() + 1;
    var year = currentTime.getFullYear();
    var hours = currentTime.getHours();
    var minutes = currentTime.getMinutes();
    var formattedDate = padNumber(day) + '/' + padNumber(month) + '/' + year;
    var formattedTime = padNumber(hours) + ':' + padNumber(minutes);
    console.log("Student checked-in at: " + formattedDate + " " + formattedTime);
    

    });

    function padNumber(number){return (number < 10 ? '0': '') + number;}

    But now, I'm not sure how to send this data from the Puck device to my webpage or a text file. I've tried different methods but couldn't figure it out. Please help me. Thank you.

    Let me know if you need the PHP code too.

    Best regards,

About

Avatar for user157613 @user157613 started