Post on 20-Jan-2016
Creating A Database Driven Website
1. Setting Up Your Web Server2. Creating a Database3. Creating a Webpage to Display Information From a Database4. Creating a form to Add information to a Database5. Registering a Domain Name 6. Associating a Domain Name to Your Server
http://cis3630.org/donotuse.html
<!DOCTYPE html><html>
<head><meta charset="UTF-8"> <title>Title descriptive of the page's contents or purpose</title><meta name="description" content="A longer description of the page's contents." /></head>
<body>Your content goes here</body>
</html>
CREATE TABLE IF NOT EXISTS `students` (`id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL, `email` varchar(100) NOT NULL, `url` varchar(100) NOT NULL, `added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `name` (`name`), KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=128 ;
INSERT INTO `students` (`id`, `name`, `email`, `url`, `added`) VALUES(2, 'Ira Cross', 'iracross@gmail.com', '', '2015-09-17 18:39:55'),(3, 'Anna Rios', 'annarios@gmail.com', 'http://annarios.domainsforauthors.com/', '2015-10-27 22:43:00'),(4, 'Troy Johnson', 'Troy.Johnson@baruch.cuny.edu', 'http://demo.domainsforauthors.com', '2015-10-27 23:01:54'),(5, 'Wonder Woman', 'wonder@woman.com', 'http://www.dccomics.com/characters/wonder-woman', '2015-10-27 23:50:28'),(1, 'Junjie Low', 'junjiel@aol.com', '', '2015-10-28 22:44:18');
<?php $servername = "sql305.domainsforauthors.com"; $username = "dmnsf_16833743"; $password = "your_password"; $dbname = "dmnsf_16363720_database";?>
Create new a file call it database-connect.php
Create a new file called students.php<!DOCTYPE html><html>
<head><meta charset="UTF-8"> <title>Student Demo Page</title><meta name="description" content="A longer description of the page's contents." /></head>
<body><h2>Student Demo Page</h2><hr /><?php include('database-connect.php');
// Create connection$conn = new mysqli($servername, $username, $password, $dbname);// Check connectionif ($conn->connect_error) {die("Connection failed: " . $conn->connect_error);}
$sql = "SELECT id,name,email,url,added FROM students";$result = $conn->query($sql);
if ($result->num_rows > 0) {// output data of each rowwhile($row = $result->fetch_assoc()) {echo $row["id"]. $row["name"]. $row["website"]. "<br>";}} else {echo "0 results";}$conn->close();?><hr /></body></html>
Create a php file called add-student.php You may download the HTML here: http://cis3630.org/add-student.php-file.txt
Registering a Domain Name
You will be presented with multiple screens attempting to up sell you on with multiple, typically unneeded products.
Registering 2 domain names cost $19.98 via Network Solutions
Remember, you need to change the nameservers on a domain via registrar control panel BEFORE adding it to your account, it may take 24 to 72 hours to completely update the nameservers (it usually does not take that long):
Please verify your nameservers and/or change them to:
ns1.byet.orgns2.byet.orgns3.byet.orgns4.byet.orgns5.byet.org
The nameservers are changed via your domain registrar [in our case Network Solutions] control panel, NOT your hosting control panel [in our case domainsforauthors.com].
With free domainsforauthors account name servers MUST be set first, before adding the domain here in control panel.
After ___ hours http://studentdemo.org now pointa to the web site hosted at domainforauthors.com
For SEO reasons previously discussed you should stop using the original URL in this case
Use http://studentdemo.org
Stop using http://demo.domainsforauthors.com
Insert screen shot of classdemo.org