"jbrave" wrote:
Wow, thanks for all that! What is the UUID for, is it just to prevent simultanious access to the same record?
curl -d "channel=mychannelname&uuid=13594446900000&key=195158&value=http%3A%2F%2Fasdf.s3.amazonaws.com%2Ftf%2F001%2F396%2F124%2F30204.64k.m4a" http://www.myserver.com/badm4a.php
Error saving data!
<?php
// Define settings
$dbserver = "mysql"; // Change as required
$dbname = "mydbname"; // Whatever DB you have access to
$dbuser = "myusername"; // User to connect to DB as
$dbpass = "mypassword";// Password for DB user
// Connect to DB
$dbconn = mysql_connect("mysql","myusername","mypassword");
if (!$dbconn) die("Error connecting to database!");
if (!mysql_select_db($dbname)) die("Error selecting database $dbname");
// Get args
$channel = !empty($_REQUEST['channel']) ? mysql_real_escape_string($_REQUEST['channel']) : "";
$uuid = !empty($_REQUEST['uuid']) ? mysql_real_escape_string($_REQUEST['uuid']) : "";
$key = !empty($_REQUEST['key']) ? mysql_real_escape_string($_REQUEST['key']) : "";
$value = !empty($_REQUEST['value']) ? mysql_real_escape_string($_REQUEST['value']) : "";
$ip = mysql_real_escape_string($_SERVER['REMOTE_ADDR']);
// Verify args
if (empty($channel)) die("Missing or invalid paramater 1");
if (empty($uuid) or !preg_match('/^[0-9a-f]{32}$/i',$uuid)) die("Missing or invalid paramater 2");
if (empty($key)) die("Missing or invalid paramater 3");
if (empty($value)) die("Missing or invalid paramater 4");
// Store data
$insert_sql = "INSERT INTO storedata (`time`, `channel`, `ip`, `uuid`, `key`, `value`) VALUES (NOW(),'$channel','$ip','$uuid','$key','$value')";
$result = mysql_query($insert_sql); // Stupid default PHP mysql functions without binding...
if (!$result) die("Error saving data!");
print "Data saved";
?>
if (!$result) die("Error saving data!");
if (!$result) die(mysql_errno($link) . ": " . mysql_error($link));
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
Thanks for your patience — we’re excited to share what’s next!