Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['desc'])) {
- if (!isset($_POST['iscorrect']) || $_POST['iscorrect'] == "") {
- echo "Sorry, important data to submit your question is missing. Please press back in your browser and try again and make sure you select a correct answer for the question.";
- exit();
- }
- if (!isset($_POST['type']) || $_POST['type'] == "") {
- echo "Sorry, there was an error parsing the form. Please press back in your browser and try again";
- exit();
- }
- require_once("scripts/connect_db.php");
- $name = $_POST['name'];
- $email = $_POST['email'];
- $name = mysqli_real_escape_string($connection, $name);
- $name = strip_tags($name);
- $email = mysqli_real_escape_string($connection, $email);
- $email = strip_tags($email);
- if (isset($_FILES['image'])) {
- $name = $_FILES['image']['tmp_name'];
- $image = base64_encode(
- file_get_contents(
- $_FILES['image']['tmp_name']
- )
- );
- }
- $sql = mysqli_query($connection, "INSERT INTO users (name,email,image) VALUES ('$name', '$email','$image')")or die(mysqli_error($connection));
- header('location: index.php?msg=' . $msg . '');
- $msg = 'merge';
- }
- ?>
- <?php
- $msg = "";
- if (isset($_GET['msg'])) {
- $msg = $_GET['msg'];
- }
- ?>
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Licenta Ionut</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
- <!-- font files -->
- <link href='//fonts.googleapis.com/css?family=Muli:400,300' rel='stylesheet' type='text/css'>
- <link href='//fonts.googleapis.com/css?family=Nunito:400,300,700' rel='stylesheet' type='text/css'>
- <!-- /font files -->
- <!-- css files -->
- <link href="css/style.css" rel='stylesheet' type='text/css' media="all" />
- <link href="web.js" rel='stylesheet' type='text/css' media="all" />
- <script type="text/javascript" src="web.js"></script>
- <!-- /css files -->
- </head>
- <body>
- <p style="color:#06F;"><?php echo $msg; ?></p>
- <h1>LogIn with Webcam Password</h1>
- <div class="log">
- <div class="content1">
- <h2>Sign In Form</h2>
- <form>
- <input type="text" name="userid" value="USERNAME" onfocus="this.value = '';" onblur="if (this.value == '') {
- this.value = 'USERNAME';
- }">
- <input type="password" name="psw" value="PASSWORD" onfocus="this.value = '';" onblur="if (this.value == '') {
- this.value = 'PASSWORD';}">
- <div class="button-row">
- <input type="submit" class="sign-in" value="Sign In">
- <input type="reset" class="reset" value="Reset">
- <div class="clear"></div>
- </div>
- </form>
- </div>
- <div class="content2">
- <h2>Register</h2>
- <form action="index.php", name="index.php" method="post" enctype="multipart/form-data">
- <input type="text" id="name" name="name" value="Nume">
- <input type="text" id="email" name="email" value="EmailAdress">
- <br>
- <script type="text/javascript" src="webcam.js"></script>
- <script language="JavaScript">
- document.write(webcam.get_html(320, 240));
- </script>
- <div class="button-row">
- <input class="sign-in" type=button value="Configure" onClick="webcam.configure()" class="shiva">
- <input class="reset" type="submit" value="Register" id="image" onClick="take_snapshot()" class="shiva">
- </div>
- </form>
- </div>
- <div class="clear"></div>
- </div>
- </body>
- </html>
- <?php
- $db_host = "localhost";
- // Place the username for the MySQL database here
- $db_username = "Ionut";
- // Place the password for the MySQL database here
- $db_pass = "1993";
- // Place the name for the MySQL database here
- $db_name = "users";
- // Run the connection here
- $connection=mysqli_connect("$db_host","$db_username","$db_pass") or die (mysqli_connect_error());
- mysqli_select_db($connection,"$db_name") or die ("no database");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement