This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//server info | |
$server = 'server'; | |
$user = 'user'; | |
$pass = 'pass'; | |
$db = 'data'; | |
// connect to the database | |
$mysqli = new mysqli($server, $user, $pass, $db); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<?php | |
include "connect-db.php"; | |
//create form function | |
function renderForm($id='', $dateF='', $dateD='', $collection='', $repos='', $repos_loc='') | |
{ ?> | |
<form action="" method="post"> | |
<?php if ($id != '') { ?> | |
<input type="hidden" name="docID" value="<?php echo $id; ?>" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<title>HTML form for insert users</title> | |
</head> | |
<body> | |
<h2>Add Place to Maury Database</h2> | |
<form action="insert_place.php" method="post"> | |
Place Name*: <input type="text" name="name" /><br /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<title>Form to Insert Persons, Maury1a</title> | |
</head> | |
<body> | |
<h2>Create New Person Record</h2> | |
<p>This form creates a new person record for the database Maury1a. Please include as much information as possible.</p> | |
<form action="insert4.php" method="post"> | |
First Name: <input type="text" name="firstname" /><br /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<title>Maury Database: Add Document</title> | |
</head> | |
<body> | |
<h2>Add new documents to Maury database</h2> | |
<form method="post" action="insert_doc.php"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create join link between sender and document | |
$senders=($_POST['senders']); | |
print_r ($senders); | |
foreach($senders as $sender) { | |
if ($sender >='1') { | |
$addSender = "INSERT INTO sender (sender_doc_id, sender_pers_id) VALUES ('".$newDocid."', '".$sender."')"; | |
mysql_query($addSender) or die('Error '. mysql_error()); | |
echo "<br />Sender(s) successfully linked to document." ; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<title>Maury Database: Add Document</title> | |
</head> | |
<body> | |
<h2>Add new documents to Maury database</h2> | |
<form method="post" action="insert_doc.php"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<title>Form to Insert Persons, Maury1a</title> | |
</head> | |
<body> | |
<h2>Create New Person Record</h2> | |
<p>This form creates a new person record for the database Maury1a. Please include as much information as possible.</p> | |
<form action="insert.php" method="post"> | |
First Name: <input type="text" name="firstname" /><br /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//connect to database | |
$con = mysql_connect('localhost', 'root', 'root'); | |
//check connection | |
if (!$con) { | |
die('Could not connect');} | |
/*else{echo 'Success';}*/ | |
mysql_select_db('maury1'); |