Large commit, multiple projects/labs
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
$databaseHost = 'localhost'; // localhost
|
||||
$databaseName = 'lab7'; // your db_name
|
||||
$databaseUsername = 'root'; // root by default for localhost
|
||||
$mysqli = mysqli_connect($databaseHost, $databaseUsername, $databaseName);
|
||||
?>
|
||||
<?php
|
||||
if(isset($_POST['submit']))
|
||||
{
|
||||
$fname = $_POST['fname'];
|
||||
$lname = $_POST['lname'];
|
||||
$email = $_POST['email'];
|
||||
$password = $_POST['password'];
|
||||
$address = $_POST['address'];
|
||||
$city = $_POST['city'];
|
||||
$country = $_POST['country'];
|
||||
$result = mysqli_query($mysqli,"insert into user values('','$fname','$lname','$email','$password','$address','$city','$country')");
|
||||
if($result) {
|
||||
echo "Registration Successfully";
|
||||
}
|
||||
else {
|
||||
echo "failed:";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Lab 7 Levi McLean</title>
|
||||
<link rel="stylesheet" href="./style.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div>
|
||||
<form method="post" action="action.php">
|
||||
<label for="fname">First Name</label>
|
||||
<input type="text" name="fname"><br>
|
||||
<label for="lname">Last Name</label>
|
||||
<input type="text" name="lname"><br>
|
||||
<label for="email">Email</label>
|
||||
<input type="email" name="email"><br>
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="password"><br>
|
||||
<label for="address">Address</label>
|
||||
<input type="text" name="address"><br>
|
||||
<label for="city">City</label>
|
||||
<input type="text" name="city"><br>
|
||||
<label for="country">Country</label>
|
||||
<input type="text" name="country"><br>
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
body {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
background-color: darkred;
|
||||
}
|
||||
Reference in New Issue
Block a user