This is handy for following pages that don’t provide RSS access: Turn the page into RSS.
Monthly Archives: March 2016
PHP: Script Base Url
To get the url of current script’s directory:
$script_url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']; $dir_url = preg_replace("/[^\/]*.php/", "", $script_url);
Essential Differences between Session and Cookie
- Cookie gets send with every single request to server, sessions don’t.
- Cookies are saved on client side. Sessions on server side.
- Cookie can be created with an expire date (e.g., 30 days), so that users won’t have to re-login after closing browser window. Sessions die with page close*.
PHP: Select from Database Error
$link = mysqli_connect("localhost", "root", "root"); $result = mysqli_select_db($link, 'internship'); $email_duplicate = "SELECT * FROM Interns WHERE email='$email';"; $result = mysqli_query($link, $email_duplicate);
PHP: Check Server Method
if ($_SERVER['REQUEST_METHOD'] === 'POST') {...}
The POST
part is all CAPITAL.
Angular: Anti-Compressing CoffeScript
You’d get the Unknown Provider error if you’re publishing compressed CoffeeScript. It usually goes like this:
Error: [$injector:unpr] Unknown provider...
Simplifying
I’m trying to teach myself figure drawing. Following Proko’s tutorial, this part in particular struck me as the essence of learning: