Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DS1820
Fork of J_HTTP_Client by
Diff: ForServer/nucleoin.php
- Revision:
- 0:d90e1f7bda1f
diff -r 000000000000 -r d90e1f7bda1f ForServer/nucleoin.php
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ForServer/nucleoin.php Sun May 13 16:31:13 2018 +0000
@@ -0,0 +1,41 @@
+<?php
+ $server = "sql.someweb.com"; // Here you place your MySQL server address
+ $user = "johnybravo"; // Here you place your user name of your MySQL
+ $pass = "bravo"; // Here you place your password of your MySQL
+ $db = "dtb"; // Here you place your name of your DTB
+
+ $mysql = mysql_connect($server, $user, $pass); // Connect to MySQL
+ mysql_select_db($db); // Select DTB of MySQL
+
+ if(!$mysql)
+ {
+ die("Unable connect to server!");
+ }
+
+ $doSql = mysql_query('SELECT * FROM nucleo_data WHERE id=1');
+
+ if(mysql_num_rows($doSql) == 0){
+ mysql_query('INSERT INTO nucleo_data (id, time, date, temp) VALUES (1, '.date("H:i:s",time()).', '.date("Y-m-d",time()).', 0)');
+ }
+
+ if($mysql and isset($_GET['temp'])){
+ $temp = sanitize($_GET['temp']);
+
+ $sqll = 'UPDATE nucleo_data SET temp="'.$temp.'", time="'.date("H:i:s",time()).'", date="'.date("Y-m-d",time()).'" WHERE id=1';
+ $doSqll = mysql_query($sqll);
+
+ if($doSqll){
+ echo 'Zapis byl uspesny';
+ }
+ else{
+ die('Invalid query: ' . mysql_error());
+ }
+ }
+ function sanitize($input){
+ $input = htmlspecialchars($input);
+ $input = htmlentities($input);
+ $input = strip_tags($input);
+ $input = trim($input);
+ return $input;
+ }
+?>
\ No newline at end of file
