Académique Documents
Professionnel Documents
Culture Documents
<!DOCTYPE html>
<html lang="en">
<head>
<title>Evan's Form</title>
</head>
<style>
</style>
<body>
<p>
<br>
<br>
<label for="FirstName">First Name:</label>
<input type="text" name="FirstName" id="FirstName">
</p>
<p>
<label for="LastName">Last Name:</label>
<input type="text" name="LastName" id="LastName">
</p>
</form>
</body>
</html>
Note: db_connect is another way to get to the “insert” document that connects to the
MySQL server.
<?php
$con=mysqli_connect('localhost', 'pi', 'Everelk1', 'The_Form') or die ("Could n$
echo "Successful Connection";
?>
<?php
/* Attempt MySQL server connection. Assuming you are running MySQL
server with default setting (user 'root' with no password) */
$link = mysqli_connect(‘localhost’, ‘pi’, ‘Everelk1’, ‘The_Form’) or die (“Could not connect to
MySQL”);
// Check connection
if($link === false)
{
die("ERROR: Could not connect. " . mysqli_connect_error());
}
// close connection
mysqli_close($link);
?>
Form V2
HTML Extended Form
This needs to be connected to the Database
HTMLV2
<!DOCTYPE html>
<html lang="en">
<head>
<title>Evan's Form</title>
</head>
<style>
<!--body {
background:url('file:/Users/Evan_Roth/Desktop/Artboard 1.svg') no-repeat top center fixed
}-->
p, h1 {
text-align:center; color:white
}
</style>
<body >
<p>
<br>
<br>
<label for="firstName">First Name:</label>
<input type="text" name="firstName" id="firstName">
</p>
<p>
<label for="lastName">Last Name:</label>
<input type="text" name="lastName" id="lastName">
</p>
<p>
<label for="favoritePet">What's your favorite pet?:</label>
<input type="text" name="favoritePet" id="favoritePet">
</p>
<p>
<label for="bestFood">What's the best food to have at any time?:</label>
<input type="text" name="bestFood" id="bestFood">
</p>
<p>
<label for="favoriteColor">What's your favorite color?:</label>
<input type="text" name="favoriteColor" id="favoriteColor">
</p>
<p>
<label for="bestSuperHero">Who's the best superhero?:</label>
<input type="text" name="bestSuperHero" id="bestSuperHero">
</p>
<div>
<input type="submit" value="Submit" style="display: block; margin: 0 auto;">
</div>
</form>
</body>
</html>
HPH V2
<?php
/* Attempt MySQL server connection. Assuming you are running MySQL
server with default setting (user 'root' with no password) */
$link = mysqli_connect(‘localhost’, ‘pi’, ‘Everelk1’, ‘The_Form’) or die (“Could not connect to
MySQL”);
// Check connection
if($link === false)
{
die("ERROR: Could not connect. " . mysqli_connect_error());
}
} else{
echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}
// close connection
mysqli_close($link);
?>
Excess Stuff
PHPV2
<?php
/* Attempt MySQL server connection. Assuming you are running MySQL
server with default setting (user 'root' with no password) */
$link = mysqli_connect("10.10.106.3", "pi", "Everelk1");
// Check connection
if($link === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
// close connection
mysqli_close($link);
?>
PHPV3
<?php
/* Attempt MySQL server connection. Assuming you are running MySQL
server with default setting (user 'root' with no password) */
$link = mysqli_connect("10.10.106.3", "pi", "Everelk1");
// Check connection
if($link === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
// close connection
mysqli_close($link);
?>