Add learnphp

main
Jeff Elkner 2 years ago
parent 7eafa4aef1
commit 03aa36f4ce

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Abduction Form</title>
<style>
@import url(style.css);
form {
display: block;
margin-left: 30vw;
}
</style>
</head>
<body>
<h1>Abduction Form</h1>
<main>
<p>
Share your story of alien abduction:
</p>
<form action="report.php" method="post">
<label for="firstname">First name:</label>
<input type="text" id="firstname" name="firstname"><br>
<label for="lastname">Last name:</label>
<input type="text" id="lastname" name="lastname"><br>
<label for="email">What is your email address?</label>
<input type="text" id="email" name="email"><br>
<label for="occurred">When did it happen?</label>
<input type="text" id="occurred" name="occurred"><br>
<label for="howlong">How long were you gone?</label>
<input type="text" id="howlong" name="howlong"><br>
<label for="howmany">How many did you see?</label>
<input type="text" id="howmany" name="howmany"><br>
<label for="description">Describe them:</label>
<input type="text" id="description" name="description"><br>
<label for="whattheydid">What did they do to you?</label>
<input type="text" id="whattheydid" name="whattheydid"><br>
<label for="tabbyspotted">Have you seen my cat Tabby?</label>
Yes <input id="tabbyspotted" name="tabbyspotted" type="radio" value="yes">
No <input id="tabbyspotted" name="tabbyspotted" type="radio" value="no"><br>
<img src="images/tabby.jpg" height="175" alt="My abducted cat Tabby"><br>
<label for="other" name="other">Anything else you want to add?</label>
<textarea id="other" name="other"></textarea><br>
<input type="submit" value="Report Abduction" name="submit">
</form>
</main>
<footer id="vLinks">
</footer>
<script>
var loc = window.location.href;
var linkStr = '<a href="http://validator.w3.org/check?uri=';
linkStr += loc;
linkStr += '">\n<strong> HTML </strong> Valid! </a> |';
linkStr +=' <a href="http://jigsaw.w3.org/css-validator/validator?uri='
linkStr += loc;
linkStr += '?profile=css3">\n<strong> CSS </strong> Valid! </a>'
console.log(linkStr);
var footer = document.getElementById("vLinks");
console.log(footer);
footer.innerHTML = linkStr;
</script>
</body>
</html>

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<style>
@import url(style.css);
</style>
</head>
<body>
<h1></h1>
<main>
<?php
$dir = 'sqlite:/home/jelkner/Data/phpliteadmin/alien_abductions.sqlite';
$dbh = new PDO($dir) or die("Cannot open the database");
$query = "SELECT * FROM Abductions";
foreach ($dbh->query($query) as $row)
{
echo $row[1];
}
$dbh = null; //This is how you close a PDO connection
?>
</main>
<footer id="vLinks">
</footer>
<script>
var loc = window.location.href;
var linkStr = '<a href="http://validator.w3.org/check?uri=';
linkStr += loc;
linkStr += '">\n<strong> HTML </strong> Valid! </a> |';
linkStr +=' <a href="http://jigsaw.w3.org/css-validator/validator?uri='
linkStr += loc;
linkStr += '?profile=css3">\n<strong> CSS </strong> Valid! </a>'
console.log(linkStr);
var footer = document.getElementById("vLinks");
console.log(footer);
footer.innerHTML = linkStr;
</script>
</body>
</html>

@ -0,0 +1,15 @@
DROP TABLE IF EXISTS Abductions;
CREATE TABLE Abductions(
id INTEGER PRIMARY KEY AUTOINCREMENT,
firstname TEXT NOT NULL,
lastname TEXT NOT NULL,
email TEXT NOT NULL,
occured TEXT NOT NULL,
howlong TEXT NOT NULL,
howmany TEXT NOT NULL,
description TEXT NOT NULL,
whattheydid TEXT NOT NULL,
tabbyspotted INTEGER NOT NULL,
other TEXT NOT NULL
);

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Head First PHP &amp; MySQL</title>
<style>
@import url(../main.css);
</style>
</head>
<body>
<h1>Head First PHP &amp; MySQL</h1>
<main>
<h2>Projects</h2>
<ul>
<li><a href="abduction_form.html">Alien Abduction</a></li>
</ul>
<h2>Who Am I?</h2>
<p>
<?php
print shell_exec( 'whoami' );
?>
</p>
</main>
<footer id="vLinks">
</footer>
<script>
var loc = window.location.href;
var linkStr = '<a href="http://validator.w3.org/check?uri=';
linkStr += loc;
linkStr += '">\n<strong> HTML </strong> Valid! </a> |';
linkStr +=' <a href="http://jigsaw.w3.org/css-validator/validator?uri='
linkStr += loc;
linkStr += '?profile=css3">\n<strong> CSS </strong> Valid! </a>'
console.log(linkStr);
var footer = document.getElementById("vLinks");
console.log(footer);
footer.innerHTML = linkStr;
</script>
</body>
</html>

@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Aliens Abducted Me - Abduction Report</title>
<style>
</style>
</head>
<body>
<h1>Aliens Abducted Me - Abduction Report</h1>
<main>
<?php
$when_it_happened = $_POST['when'];
$how_long = $_POST['howlong'];
$alien_description = $_POST['description'];
$tabby_spotted = $_POST['tabbyspotted'];
$email = $_POST['email'];
echo '<p>Thanks for submitting the form.<br>';
echo 'You were abducted ' . $when_it_happened;
echo ' and were gone for ' . $how_long . '<br>';
echo 'Describe them: ' . $alien_description . '<br>';
echo 'Was Tabby there? '. $tabby_spotted . '<br>';
echo 'Your email address is ' . $email . '</p>';
?>
</main>
<footer id="vLinks">
</footer>
<script>
var loc = window.location.href;
var linkStr = '<a href="http://validator.w3.org/check?uri=';
linkStr += loc;
linkStr += '">\n<strong> HTML </strong> Valid! </a> |';
linkStr +=' <a href="http://jigsaw.w3.org/css-validator/validator?uri='
linkStr += loc;
linkStr += '?profile=css3">\n<strong> CSS </strong> Valid! </a>'
console.log(linkStr);
var footer = document.getElementById("vLinks");
console.log(footer);
footer.innerHTML = linkStr;
</script>
</body>
</html>

@ -0,0 +1,16 @@
main {
margin: 30px;
padding: 30px;
border: 1px dotted #555;
}
h1 {
text-align: center;
}
a, a:visited {
text-decoration: none;
color: #555;
}
footer {
text-align: center;
margin-top: 20px;
}

@ -0,0 +1,53 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Book List</title>
<style>
@import url(style.css);
header > nav {
text-align: center;
}
</style>
</head>
<body>
<header>
<h1>Book List</h1>
<nav>
<a href="index.php">Home</a>
</nav>
</header>
<main>
<?php
$dir = 'sqlite:database/acclib.db';
$dbh = new PDO($dir) or die("Cannot open the database");
$query = "SELECT * FROM Books";
foreach ($dbh->query($query) as $row)
{
echo $row[1];
}
$dbh = null; //This is how you close a PDO connection
?>
</main>
<footer id="vLinks">
</footer>
<script>
var loc = window.location.href;
var linkStr = '<a href="http://validator.w3.org/check?uri=';
linkStr += loc;
linkStr += '">\n<strong> HTML </strong> Valid! </a> |';
linkStr +=' <a href="http://jigsaw.w3.org/css-validator/validator?uri='
linkStr += loc;
linkStr += '?profile=css3">\n<strong> CSS </strong> Valid! </a>'
console.log(linkStr);
var footer = document.getElementById("vLinks");
console.log(footer);
footer.innerHTML = linkStr;
</script>
</body>
</html>

@ -0,0 +1,12 @@
.mode column
.headers on
SELECT
title, class, subclass, cutter, suppl
FROM
Books
ORDER BY
class ASC,
subclass ASC,
cutter ASC,
suppl ASC;

@ -0,0 +1,501 @@
INSERT INTO Books VALUES(
1,
'Good Faith Collaboration: The Culture of Wikipedia',
'AE',
100,
'R43',
'2010',
'9780262014472',
'shelf'
);
INSERT INTO Books VALUES(
2,
'Algorithms to Live By: The Computer Science of Human Decisions',
'BF',
39,
'C4885',
'2016',
'9781627790369',
'shelf'
);
INSERT INTO Books VALUES(
3,
'Ours to Hack and to Own: The Rise of Platform Cooperativism, A New Vision for the Future of Work and a Fairer Internet',
'HM',
851,
'O973',
'2016',
'9781944869335',
'shelf'
);
INSERT INTO Books VALUES(
4,
'The Mathematics of Elections and Voting',
'JF',
1001,
'W35',
'2014',
'9783319098098',
'shelf'
);
INSERT INTO Books VALUES(
5,
'Beyond Transparency: Open Data and the Future of Civic Innovation',
'JK',
468,
'T7 B49',
'2013',
'9780615889085',
'shelf'
);
INSERT INTO Books VALUES(
6,
'Trusting Teachers with School Success: What Happens when Teachers Call the Shots',
'LB',
2806.45,
'F36',
'2013',
'9781610485104',
'shelf'
);
INSERT INTO Books VALUES(
7,
'Murphy''s Law and Other Reasons Why Things Go Wrong',
'PN',
6231,
'M82 B57',
'',
'0843104287',
'shelf'
);
INSERT INTO Books VALUES(
8,
'The Annotated Alice: Alice''s Adventures in Wonderland & Through the Looking Glass',
'PR',
4611,
'A7',
'1960',
'9780452010413',
'shelf'
);
INSERT INTO Books VALUES(
9,
'Gödel, Escher, Bach: An Eternal Golden Braid',
'QA',
9.8,
'H63',
'1980',
'0394745027',
'shelf'
);
INSERT INTO Books VALUES(
10,
'Doing Math with Python: Use Programming to Explore Algebra, Statistics, Calculus, and More!',
'QA',
20,
'C65 S24',
'2015',
'9781593276409',
'shelf'
);
INSERT INTO Books VALUES(
11,
'Rethinking Mathematics: Teaching Social Justice by the Numbers',
'QA',
22.3,
'R478',
'2013',
'9780942961553',
'shelf'
);
INSERT INTO Books VALUES(
12,
'Unlocking the Clubhouse: Women in Computing',
'QA',
76.25,
'M35',
'2001',
'9780262632690',
'shelf'
);
INSERT INTO Books VALUES(
13,
'Stuck in the Shallow End: Education, Race, and Computing',
'QA',
76.27,
'M347',
'2008eb',
'9780262514040',
'shelf'
);
INSERT INTO Books VALUES(
14,
'Turtles, Termites, and Traffic Jams: Explorations in Massively Parallel Microworlds',
'QA',
76.58,
'R47',
'1994',
'9780262680936',
'shelf'
);
INSERT INTO Books VALUES(
15,
'The C Trilogy: A Complete Library for C Programmers',
'QA',
76.73,
'C15 B56',
'1987',
'0830628908',
'shelf'
);
INSERT INTO Books VALUES(
16,
'The C Programming Language',
'QA',
76.73,
'C15 K47',
'1988',
'9780131103702',
'shelf'
);
INSERT INTO Books VALUES(
17,
'The C Answer Book: Solutions to the Exercises in The C Programming Language, Second Edition, by Brian W. Kernighan and Dennis M. Ritchie',
'QA',
76.73,
'C15 K47',
'1988 suppl',
'9780131096530',
'shelf'
);
INSERT INTO Books VALUES(
18,
'C Programming: A Complete Guide to Mastering the C Language',
'QA',
76.73,
'C15 H364',
'1989',
'9780201194449',
'shelf'
);
INSERT INTO Books VALUES(
19,
'Data Structures Using C',
'QA',
76.73,
'C15 T46',
'1990',
'9780131997462',
'shelf'
);
INSERT INTO Books VALUES(
20,
'C: A Reference Manual',
'QA',
76.73,
'C15 H38',
'1991',
'9780131109339',
'shelf'
);
INSERT INTO Books VALUES(
21,
'The Beginner''s Guide to C',
'QA',
76.73,
'C15 H668',
'1994',
'9781874416159',
'shelf'
);
INSERT INTO Books VALUES(
22,
'C Primer Plus',
'QA',
76.73,
'C15 P733',
'1988',
'0672225824',
'shelf'
);
INSERT INTO Books VALUES(
23,
'C: The Complete Reference',
'QA',
76.73,
'C15 S353',
'1995',
'9780078821011',
'shelf'
);
INSERT INTO Books VALUES(
24,
'Eloquent JavaScript, 3rd Edition: A Modern Introduction to Programming',
'QA',
76.73,
'J39 H38',
'2019',
'9781593279509',
'shelf'
);
INSERT INTO Books VALUES(
25,
'Head First JavaScript Programming',
'QA',
76.73,
'J39 F735',
'2014',
'9781449340131',
'shelf'
);
INSERT INTO Books VALUES(
26,
'Javascript: The Good Parts',
'QA',
76.73,
'J39 C763',
'2008',
'9780596517748',
'shelf'
);
INSERT INTO Books VALUES(
27,
'Python Testing Beginner''s Guide: An Easy and Convenient Approach to Testing Your Python Projects',
'QA',
76.73,
'P98 A73',
'2010eb',
'9781847198846',
'shelf'
);
INSERT INTO Books VALUES(
28,
'Data Structures and Algorithms in Python',
'QA',
76.73,
'P98 G66',
'2013',
'9788126562176',
'shelf'
);
INSERT INTO Books VALUES(
29,
'Python Algorithms: Mastering Basic Algorithms in the Python Language',
'QA',
76.73,
'P98 H485',
'2010',
'9781430232377',
'shelf'
);
INSERT INTO Books VALUES(
30,
'Python for Data Analysis',
'QA',
76.73,
'P98 M42',
'2013',
'9781449319793',
'shelf'
);
INSERT INTO Books VALUES(
31,
'Introduction to Computer Science Using Python: A Computational Problem-Solving Focus',
'QA',
76.73,
'P98 D547',
'2013',
'9780470555156',
'shelf'
);
INSERT INTO Books VALUES(
32,
'Think Python',
'QA',
76.73,
'P98 D694',
'2012',
'9781449330729',
'shelf'
);
INSERT INTO Books VALUES(
33,
'Problem Solving with Algorithms and Data Structures Using Python',
'QA',
76.73,
'P98 M54',
'2011',
'9781590282571',
'shelf'
);
INSERT INTO Books VALUES(
34,
'Python Testing Beginner''s Guide: An Easy and Convenient Approach to Testing Your Python Projects',
'QA',
76.73,
'P98 A73',
'2010',
'9781847198846',
'shelf'
);
INSERT INTO Books VALUES(
35,
'Mathematics for the Digital Age and Programming in Python',
'QA',
76.73,
'P98 L58',
'2010',
'9780982477540',
'shelf'
);
INSERT INTO Books VALUES(
36,
'Python Testing Cookbook over 70 Simple but Incredibly Effective Recipes for Taking Control of Automated Testing Using Powerful Python Testing Tools',
'QA',
76.73,
'P98 T87',
'2011',
'9781849514668',
'shelf'
);
INSERT INTO Books VALUES(
37,
'The SQL Guide to SQLite',
'QA',
76.73,
'S67 L3617',
'2009',
'9780557076765',
'shelf'
);
INSERT INTO Books VALUES(
38,
'The Definitive Guide to Sqlite, Second Edition',
'QA',
76.73,
'S67 A45',
'2010eb',
'9781430232254',
'shelf'
);
INSERT INTO Books VALUES(
39,
'Test-Driven Development: A Practical Guide',
'QA',
76.76,
'D47 A783',
'2003',
'9780131016491',
'shelf'
);
INSERT INTO Books VALUES(
40,
'Clean Code: A Handbook of Agile Software Craftsmanship',
'QA',
76.76,
'D47 C583',
'2009',
'9780132350884',
'shelf'
);
INSERT INTO Books VALUES(
41,
'Learning the Vi Editor',
'QA',
76.76,
'O63 L355',
'1990',
'9780937175675',
'shelf'
);
INSERT INTO Books VALUES(
42,
'The UNIX-Haters Handbook',
'QA',
76.76,
'O63 U54518',
'1994',
'9781568842035',
'shelf'
);
INSERT INTO Books VALUES(
43,
'Test-Driven Development: By Example',
'QA',
76.76,
'T48 B43',
'2003',
'9780321146533',
'shelf'
);
INSERT INTO Books VALUES(
44,
'Assembly Language for x86 Processors: Sixth Edition',
'QA',
76.8,
'I77',
'2011',
'9780136022121',
'shelf'
);
INSERT INTO Books VALUES(
45,
'Data Structure and Algorithmic Thinking with Python',
'QA',
76.9,
'A43 K368',
'2016',
'9788192107592',
'shelf'
);
INSERT INTO Books VALUES(
46,
'Data Structures and Algorithms with Python',
'QA',
76.9,
'D35',
'',
'9783319130712',
'shelf'
);
INSERT INTO Books VALUES(
47,
'Data Structures and Algorithms',
'QA',
76.9,
'D35 A38',
'1982',
'0201000237',
'shelf'
);
INSERT INTO Books VALUES(
48,
'Discrete Mathematics',
'QA',
76.9,
'M35 R67',
'1988',
'0132154277',
'shelf'
);
INSERT INTO Books VALUES(
49,
'Think Stats',
'QA',
276.4,
'D69',
'2014',
'9781491907337',
'shelf'
);
INSERT INTO Books VALUES(
50,
'Think Bayes',
'QA',
279.5,
'D69',
'2013',
'9781449370787',
'shelf'
);

@ -0,0 +1,12 @@
DROP TABLE IF EXISTS Books;
CREATE TABLE Books (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
class TEXT NOT NULL,
subclass REAL NOT NULL,
cutter TEXT,
suppl TEXT,
isbn TEXT,
stat TEXT NOT NULL
);

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Arlington Career Center CS / ICT Library</title>
<style>
@import url(../main.css);
</style>
</head>
<body>
<h1>Arlington Career Center CS / ICT Library</h1>
<main>
<nav>
<a href="book_list.php">Browse Books</a>
</nav>
</main>
<footer id="vLinks">
</footer>
<script>
var loc = window.location.href;
var linkStr = '<a href="http://validator.w3.org/check?uri=';
linkStr += loc;
linkStr += '">\n<strong> HTML </strong> Valid! </a> |';
linkStr +=' <a href="http://jigsaw.w3.org/css-validator/validator?uri='
linkStr += loc;
linkStr += '?profile=css3">\n<strong> CSS </strong> Valid! </a>'
console.log(linkStr);
var footer = document.getElementById("vLinks");
console.log(footer);
footer.innerHTML = linkStr;
</script>
</body>
</html>

@ -0,0 +1,9 @@
<?php
$dir = 'sqlite:database/acclib.db';
$dbh = new PDO($dir) or die("Cannot open the database");
$query = "SELECT * FROM Books";
foreach ($dbh->query($query) as $row)
{
echo $row[0] . ' ' . substr($row[1], 0, 75) . "\n";
}
$dbh = null; //This is how you close a PDO connection

@ -0,0 +1,2 @@
<?php
phpinfo();

@ -0,0 +1,16 @@
main {
margin: 30px;
padding: 30px;
border: 1px dotted #555;
}
h1 {
text-align: center;
}
a, a:visited {
text-decoration: none;
color: #555;
}
footer {
text-align: center;
margin-top: 20px;
}

@ -0,0 +1,18 @@
<footer id="vLinks">
</footer>
<script>
var loc = window.location.href;
var linkStr = '<a href="http://validator.w3.org/check?uri=';
linkStr += loc;
linkStr += '">\n<strong> HTML </strong> Valid! </a> |';
linkStr +=' <a href="http://jigsaw.w3.org/css-validator/validator?uri='
linkStr += loc;
linkStr += '?profile=css3">\n<strong> CSS </strong> Valid! </a>'
console.log(linkStr);
var footer = document.getElementById("vLinks");
console.log(footer);
footer.innerHTML = linkStr;
</script>

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Learning PHP with TDD</title>
<style>
@import url(main.css);
</style>
</head>
<body>
<h1>Learning PHP with TDD</h1>
<main>
<h2>Projects</h2>
<ul>
<li><a href="HeadFirst">Head First PHP &amp; MySQL</a></li>
<li><a href="acclib">ACC CS / ICT Library</a></li>
</ul>
</main>
<footer id="vLinks">
</footer>
<script>
var loc = window.location.href;
var linkStr = '<a href="http://validator.w3.org/check?uri=';
linkStr += loc;
linkStr += '">\n<strong> HTML </strong> Valid! </a> |';
linkStr +=' <a href="http://jigsaw.w3.org/css-validator/validator?uri='
linkStr += loc;
linkStr += '?profile=css3">\n<strong> CSS </strong> Valid! </a>'
console.log(linkStr);
var footer = document.getElementById("vLinks");
console.log(footer);
footer.innerHTML = linkStr;
</script>
</body>
</html>

@ -0,0 +1,15 @@
main {
margin: 30px;
padding: 30px;
border: 1px dotted #555;
}
h1 {
text-align: center;
}
a, a:visited {
text-decoration: none;
color: #555;
}
footer {
text-align: center;
}

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<style>
</style>
</head>
<body>
<h1></h1>
<main>
</main>
<footer id="vLinks">
</footer>
<script>
var loc = window.location.href;
var linkStr = '<a href="http://validator.w3.org/check?uri=';
linkStr += loc;
linkStr += '">\n<strong> HTML </strong> Valid! </a> |';
linkStr +=' <a href="http://jigsaw.w3.org/css-validator/validator?uri='
linkStr += loc;
linkStr += '?profile=css3">\n<strong> CSS </strong> Valid! </a>'
console.log(linkStr);
var footer = document.getElementById("vLinks");
console.log(footer);
footer.innerHTML = linkStr;
</script>
</body>
</html>
Loading…
Cancel
Save