Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set("display_errors", 1);
- error_reporting(E_ALL);
- $encoded_body = isset($_POST['body']) ? $_POST['body'] : '';
- $body = urldecode($encoded_body);
- $vars = explode(' ', $body);
- $vid = $vars[1];
- echo "Number is $body";
- $con=mysqli_connect("phpmyadminserver","username","password","databasename");
- //Check connection
- if (mysqli_connect_errno())
- {
- echo "Failed to connect to MySQL: " . mysqli_connect_error();
- }
- else
- {
- $sql = "UPDATE GasReadings SET Gas_Value='".$vid."' WHERE id=0";
- }
- if (!mysqli_query($con,$sql))
- {
- die('Error: ' . mysqli_error($con));
- }
- mysqli_close($con);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement