This file contains 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
/*------------------------------------------------------------ | |
Basic CSS Reset to give us a clean starting point | |
Referencing: | |
- https://github.com/jgthms/minireset.css | |
- https://www.joshwcomeau.com/css/custom-css-reset/ | |
- https://github.com/sindresorhus/modern-normalize | |
------------------------------------------------------------*/ | |
/* Size blocks logically */ | |
html { |
This file contains 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 | |
/*------------------------------------------------------------- | |
* Generate a random 32 character filename with same extension | |
* (including no extension) as the filename provided | |
*-------------------------------------------------------------*/ | |
function randomFilename( $originalFilename ) { | |
$filenameParts = explode( '.', $originalFilename ); // Break apart the filename | |
$fileExtension = $filenameParts[sizeof($filenameParts) - 1]; // To get the file extension |
This file contains 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 | |
/*------------------------------------------------------------- | |
* Display debug info at bottom right of window (shows on hover) | |
* for the standard PHP arrays: GET / POST / FILE / SESSION, as | |
* well as the contents of a global $DEBUG variable which can | |
* be set to any value when debugging code. | |
*-------------------------------------------------------------*/ | |
function showDebugInfo() { | |
global $DEBUG; |
This file contains 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 | |
require_once 'common-functions.php'; | |
// Values supplied via the POST request | |
$id = $_POST['id']; | |
// Do the data update | |
$sql = 'UPDATE people | |
SET likes = likes + 1 |
This file contains 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> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Responsive Navigation</title> | |
<link rel="stylesheet" href="styles.css"> | |
</head> |