home.php

1/1

lectures/5/src/login/ 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: .dtd"> 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42:


Home

Home

You are logged in!
log out You are not logged in!


Login Demos

include.php lectures/5/src/login/ 1:
// do some stuff

1/1

login5.php

1/2

lectures/5/src/login/ 1:
/** * login5.php * * A simple login module that checks a username and password * against a MySQL table with no encryption. * * David J. Malan * Computer Science E-75 * Harvard Extension School */ // enable sessions session_start(); // connect to database if (($connection = mysql_connect("", "", "")) === FALSE) die("Could not connect to database"); // select database if (mysql_select_db("", $connection) === FALSE) die("Could not select database"); // if username and password were submitted, check them if (isset($_POST["user"]) && isset($_POST["pass"])) { // prepare SQL $sql = sprintf("SELECT * FROM users WHERE user=’%s’", mysql_real_escape_string($_POST["user"])); // execute query $result = mysql_query($sql); if ($result === FALSE) die("Could not query database"); // check whether we found a row if (mysql_num_rows($result) == 1) { // fetch row $row = mysql_fetch_assoc($result); // check password if ($row["pass"] == $_POST["pass"]) { // remember that user’s logged in $_SESSION["authenticated"] = TRUE;

login5.php

2/2

lectures/5/src/login/ 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: .dtd"> 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84:

// redirect user to home page, using absolute path, per // http://us2.php.net/manual/en/function.header.php $host = $_SERVER["HTTP_HOST"]; $path = rtrim(dirname($_SERVER["PHP_SELF"]), "/\\"); header("Location: http://$host$path/home.php"); exit; } } } ?>
Log In
" method="post">
Username:
Password:


login6.php

1/2

lectures/5/src/login/ 1:
/** * login6.php * * A simple login module that checks a username and password * against a MySQL table with no encryption by asking for a binary answer. * * David J. Malan * Computer Science E-75 * Harvard Extension School */ // enable sessions session_start(); // connect to database if (($connection = mysql_connect("", "", "")) === FALSE) die("Could not connect to database"); // select database if (mysql_select_db("", $connection) === FALSE) die("Could not select database"); // if username and password were submitted, check them if (isset($_POST["user"]) && isset($_POST["pass"])) { // prepare SQL $sql = sprintf("SELECT 1 FROM users WHERE user=’%s’ AND pass=’%s’", mysql_real_escape_string($_POST["user"]), mysql_real_escape_string($_POST["pass"])); // execute query $result = mysql_query($sql); if ($result === FALSE) die("Could not query database"); // check whether we found a row if (mysql_num_rows($result) == 1) { // remember that user’s logged in $_SESSION["authenticated"] = TRUE; // redirect user to home page, using absolute path, per // http://us2.php.net/manual/en/function.header.php $host = $_SERVER["HTTP_HOST"]; $path = rtrim(dirname($_SERVER["PHP_SELF"]), "/\\"); header("Location: http://$host$path/home.php");

login6.php

2/2

lectures/5/src/login/ 48: 49: 50: 51: 52: 53: .dtd"> 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78:

exit; } } ?>
Log In
" method="post">
Username:
Password:


login7.php

1/2

lectures/5/src/login/ 1:
/** * login7.php * * A simple login module that checks a username and password * against a MySQL table with weak encryption (well, a weak hash). * * David J. Malan * Computer Science E-75 * Harvard Extension School */ // enable sessions session_start(); // connect to database if (($connection = mysql_connect("", "", "")) === FALSE) die("Could not connect to database"); // select database if (mysql_select_db("", $connection) === FALSE) die("Could not select database"); // if username and password were submitted, check them if (isset($_POST["user"]) && isset($_POST["pass"])) { // prepare SQL $sql = sprintf("SELECT 1 FROM users WHERE user=’%s’ AND pass=PASSWORD(’%s’)", mysql_real_escape_string($_POST["user"]), mysql_real_escape_string($_POST["pass"])); // execute query $result = mysql_query($sql); if ($result === FALSE) die("Could not query database"); // check whether we found a row if (mysql_num_rows($result) == 1) { // remember that user’s logged in $_SESSION["authenticated"] = TRUE; // redirect user to home page, using absolute path, per // http://us2.php.net/manual/en/function.header.php $host = $_SERVER["HTTP_HOST"]; $path = rtrim(dirname($_SERVER["PHP_SELF"]), "/\\"); header("Location: http://$host$path/home.php");

login7.php

2/2

lectures/5/src/login/ 48: 49: 50: 51: 52: 53: .dtd"> 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78:

exit; } } ?>
Log In
" method="post">
Username:
Password:


login8.php

1/2

lectures/5/src/login/ 1:
/** * login8.php * * A simple login module that checks a username and password * against a MySQL table with strong encryption (but insecure secret). * * David J. Malan * Computer Science E-75 * Harvard Extension School */ // enable sessions session_start(); // connect to database if (($connection = mysql_connect("", "", "")) === FALSE) die("Could not connect to database"); // select database if (mysql_select_db("", $connection) === FALSE) die("Could not select database"); // if username and password were submitted, check them if (isset($_POST["user"]) && isset($_POST["pass"])) { // prepare SQL $sql = sprintf("SELECT 1 FROM users WHERE user=’%s’ AND pass=AES_ENCRYPT(’%s’, ’secret’)", mysql_real_escape_string($_POST["user"]), mysql_real_escape_string($_POST["pass"])); // execute query $result = mysql_query($sql); if ($result === FALSE) die("Could not query database"); // check whether we found a row if (mysql_num_rows($result) == 1) { // remember that user’s logged in $_SESSION["authenticated"] = TRUE; // redirect user to home page, using absolute path, per // http://us2.php.net/manual/en/function.header.php $host = $_SERVER["HTTP_HOST"]; $path = rtrim(dirname($_SERVER["PHP_SELF"]), "/\\"); header("Location: http://$host$path/home.php");

login8.php

2/2

lectures/5/src/login/ 48: 49: 50: 51: 52: 53: .dtd"> 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78:

exit; } } ?>
Log In
" method="post">
Username:
Password:


logout.php

1/1

lectures/5/src/login/ 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: .dtd"> 25: 26: 27: 28: 29: 30: 31: 32: 33: 34:


Log Out

You are logged out!

home



lolcat.php

1/1

lectures/5/src/lolcat/ 1: 2: 5: 6: 7: 8: Lolcat of teh Day 9: 10: 11:
12:

Lolcat of teh Day

13: channel->item[0]; 17: preg_match("/^.* - (.*)description, $matches); 18: $alt = htmlspecialchars($matches[1], ENT_QUOTES); 19: $link = $item->link; 20: foreach ($item->children("http://search.yahoo.com/mrss/") as $content) 21: { 22: $attributes = $content->attributes(); 23: $src = $attributes["url"]; 24: } 25: print("’{$alt}’"); 26: 27: ?> 28:
29: 30: 31:

csv.php

1/1

lectures/5/src/lunch/development/ 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34:

Lunch One for , coming right up!

lunch.php

1/1

lectures/5/src/lunch/development/ 1: 4: 5: 8: 9: 10: 11: Lunch 12: 13: 14:
15: Name: 16:

17: 18: xpath("/menu/category[@name=’Specialty Sandwiches’]/item") as $item): ?> 19: 20: 21: 28: 29: 30:
" name="item" type="radio" value="" /> 22: 27:
31:
32: 33:

sqlite.php

1/1

lectures/5/src/lunch/development/ 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41:

setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // prepare fields $name = $dbh->quote($_POST["name"]); $item = $dbh->quote($_POST["item"]); // insert order $dbh->exec("INSERT INTO orders (name, item) VALUES($name, $item)"); } catch (PDOException $e) { die($e->getMessage()); } ?> Lunch One for , coming right up!

xml.php

1/1

lectures/5/src/lunch/development/ 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44:

addChild("order"); $order->addChild("name", $_POST["name"]); $order->addChild("item", $_POST["item"]); // overwrite original XML file rewind($handle); fwrite($handle, $xml->asXML()); fclose($handle); ?> Lunch One for , coming right up!

home.php 1/1 include.php 1/1

remember that user's logged in. 46: $_SESSION["authenticated"] = TRUE;. 47: login5.php. 2/2 lectures/5/src/login/. 48: // redirect user to home page, using absolute path, per. 49: // http://us2.php.net/manual/en/function.header.php. 50: $host = $_SERVER["HTTP_HOST"];. 51: $path = rtrim(dirname($_SERVER["PHP_SELF"]), ...

28KB Sizes 0 Downloads 452 Views

Recommend Documents

11
MEMORANDUM. To: Asst. Sch. Division Superintendent,. CID Chief, SGOD Chief, EPSs, PSDSs,. Senior High School Heads. &11~~. From: MANUELA S. TOLENTINO, Ed.D. Officer-In-Charge. Schools Division Superintendent. Subject: MEETING FOR SHS UPDATES AND CONC

11 003.001 Hud 11 003.002 Hud 11 003.003 Hud 11 ...
for you fear. Translit: Kui salaykum. أخاف :Translit aha. ' fu. Day (the Day of Ressurection) the torment. Translit: ?i yawmin. Translit: lúé cadaāba. (of) a Great. Translit: s kabīyrin.

2013-11-11-001_PLAN -NAVIGATION.pdf
Page 1. Whoops! There was a problem loading more pages. Retrying... 2013-11-11-001_PLAN -NAVIGATION.pdf. 2013-11-11-001_PLAN -NAVIGATION.pdf.

10-11-11 Accounts Payable.pdf
124805 STAPLES ADVANTAGE 10/12/2011 110400767 Flash lights 1001112067 225.40. 124805 STAPLES ADVANTAGE 10/12/2011 110400768 Salmon ...

QUANTUM MECHANICS AND MOLECULAR STRUCTURE - 11 11 ...
The expression for the slater type orbitals for 2s electron in nitrogen ... Displaying QUANTUM MECHANICS AND MOLECULAR STRUCTURE - 11 11.pdf.

UNOpenSource_GIS_Webinar-2016-11-11.pdf
Sign in. Loading… Page 1. Whoops! There was a problem loading more pages. Retrying... UNOpenSource_GIS_Webinar-2016-11-11.pdf.

Recommendation - Definitions 11-11.pdf
Try one of the apps below to open or edit this item. Recommendation - Definitions 11-11.pdf. Recommendation - Definitions 11-11.pdf. Open. Extract. Open with.

5A 11-11-16.pdf
Great Bend 70. Andover 35. Valley Center 28. Newton 20. Maize 22. Salina South 0. Topeka West 31. Arkansas City 20. Eisenhower 14. All games 7 p.m. unless ...

NIPP-25-11-11.pdf
Fuel Poverty ...................................................................................................................................1. Fear of Crime . ... NIPP-25-11-11.pdf. NIPP-25-11-11.pdf. Open. Extract.

BIOMOLECULES - 1 - 11 11.pdf
Write short notes on Kiliani'ssynthesis. 27. Give a ... Mention the significance of pteridine ring system in biology. ... Displaying BIOMOLECULES - 1 - 11 11.pdf.

11 002.001 Hud 11 002.002 Hud 11 002.003 Hud 11 ...
verily I (Muhammad) am. Translit: sil innanai. Translit: paki lakum a warner from Him. Translit: Fiú nadirun. Translit: is minhu and a bringer of glad tidings.

FBSeason2016-11-11.pdf
... 1 other) blocked field goal attempt & recovery. Defensive Points Allowed: Total Points: 169. Avg Points / Game: 15.4. Page 3 of 4. FBSeason2016-11-11.pdf.

11-11-14.pdf
*Tonight, 11/11 Jr High Basketball @ HOME vs Princeton 4:30 start, 4 games. *Thursday, 11/13 Jr High Basketball @ Gallatin 4:30 start, bus leaves @ 3:15.

11-11-2012.pdf
(3) Marginal cost. (4) Opportunity cost. Solution: 3. 2. In a perfectly competitive market, a firm's. (1) Average Revenue is always equal to Marginal Revenue.

HipdeTuc - 20-11-11.pdf
9SI-4 1 FALTAS BEBO Alazán R.O. Camos Q.-3 4-56 Missionary - Falta Grave San Cayetano J.A. Tejeda. 2-4-3-2 2 IXA BONITA Zaina C.A. Fuentes - 4 5-52 Ixal ...

0600-11
Jul 24, 2017 - statement/declaration mineral owners must file with the Assessor in the county in which the interest is located in accordance with T.C.A. § 67-5-804(b). ... (d) Estimate a discount rate and management allowance utilizing the best avai

0600-11
Jul 24, 2017 - 0600-11-.15 ASSESSOR'S RECORDS. The Assessor shall note on the property record card all instances when mineral reserves have been.

1140-11
Feb 20, 2017 - (d) Personnel of the following entities actively engaged in analysis of controlled substances ... The Medicaid Fraud Control Unit; and. 3.

MEG-11
Mar 31, 2015 - to other texts or critics as this will add some depth to your analysis. ... Discuss the title of The Color Purple in relation to its theme. 20. 3.

U \ 11
Apr 25, 2008 - asymmetrical punched hole is formed, With Which the fas tening element, even if of rotationally symmetrical con?gu ration as such, Will make ...

VOLUME 11
Corporation and MS-DOS, Windows, and Excel are trademarks of Microsoft ..... You will know the maximum peak-to-valley drawdown that your strategy has ...

0100-11
Nov 15, 2017 - RULES FOR SALES OF WINE AT RETAIL FOOD STORES. TABLE OF CONTENTS. 0100-11-.01 .... P.C. 1061 (2012);. 18. Designation by the ...

0720-11
May 31, 2017 - HEALTH SERVICES AND DEVELOPMENT AGENCY ... following general criteria in determining whether an application for a certificate of need ...