WiiScale - Custom URL Save

Step 1.

Create a page on your server to handle the form/json data.

Here's an example:

<?php
// Helper function.  This could save to a database or post to some other online service.
function save_mass($date, $mass, $src)
{
    file_put_contents("post.csv", $date . "," . $mass . "," . $src . "\n", FILE_APPEND);
}

// If data are coming from an HTML <form>, the values are in $_POST.
if($_SERVER['CONTENT_TYPE'] == "application/x-www-form-urlencoded")
{
    save_mass($_POST['date'], $_POST['mass'], "form");
}
// If data are coming in as JSON, the values are serialized in `php://input`.
else if($_SERVER['CONTENT_TYPE'] == "application/json")
{
    $obj = json_decode(file_get_contents("php://input"));
    save_mass($obj->date, $obj->mass, "json");
}
?>

Step 2.

Tell WiiScale about your page by typing in the full URL in your user's URL textbox (e.g., http://example.com below).

Optional: Change the "json" dropdown to "form" if your code is expecting data from an html form (the above PHP sample will handle both)