Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="mode.php" method="POST">
- <input style="background-color: green;" id="home" name="home" type="submit" value="HOME"></br>
- <input style="background-color: red;" id="away" name="away" type="submit" value="AWAY">
- </form>
- <?php
- $dbhost = 'localhost:3036';
- $dbuser = 'xxx';
- $dbpass = 'abc1234';
- $conn = mysql_connect($dbhost, $dbuser, $dbpass);
- if(! $conn ) {
- die('Could not connect: ' . mysql_error());
- }
- if (isset($_POST['home'])) {
- $sql= insert into home_mode (id, status) value (null, "HOME");
- mysql_select_db('home_mode');
- $retval = mysql_query( $sql, $conn );
- if(! $retval ) {
- die('Could not enter data: ' . mysql_error());
- }
- echo "Mode changed to HOME";}
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement