Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <?php require_once('databaseapp.php');?>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>The HTML5 Herald</title>
- <meta name="description" content="The HTML5 Herald">
- <meta name="author" content="SitePoint">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
- </head>
- <body>
- <form method = "post">
- <label>Type your nickname so you can leave some messages in the sidebar</label>
- <input type = "text" name = "nickname" id ="nick" placeholder = "type your nickname" required>
- </form>
- <script src="js/scripts.js"></script>
- </body>
- </html>
- <?php
- $nickname = $_POST['nickname'];
- $dbserver = '127.0.0.1';
- $dbuser = 'mysql';
- $dbpass = 'mysql';
- $dbname = 'testapp';
- $dbconnect = mysqli_connect($dbserver,$dbuser,$dbpass,$dbname);
- if(mysqli_connect){
- echo "We all good Mike";
- }
- else {
- echo "We all fucked Mike";
- }
- if(isset($_POST) & !empty($_POST)){
- echo $nickname;
- /*$record ="INSERT INTO nufack (nickname) VALUES ('".$nickname."')";*/
- $record ="INSERT INTO `nufack` (`nickname`) VALUES ('".$_POST['nickname']."')";
- $rec = mysqli_query($dbconnect, $record);
- if($rec){
- echo "success!";
- }
- else {
- echo "Database fucked up!";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement