Today is Sunday, February 9th, 2025.
Why do they say, “You made your bed, now you have to sleep in it”? It's just that, using the words "have to" makes it sound like punishment. Well that's what we mean, isn't it? We mean to say that, "you made a decision, and now you have to live with it". But it doesn't sound like a very bad punishment to lie in a bed that you already made. If anything, we should be saying, “You never made your bed, but now you have to sleep in it.”
This is probably the most useful trick you'll learn when creating a website.
<?php echo "Copyright " . date('Y') . ". All Rights Reserved."; ?>
Some helpful code snippets I found on the web to help you shorten your time.
// Test for admin privileges $is_admin = ($user['permissions'] == 'admin') ? true : false;
// Customize greeting for site users echo 'Hello ' . ($user['is_logged_in'] ? $user['first_name'] : 'Guest') . '!';
// Find out if it's a leap year $is_leap_year = ((($year % 4) == 0) && ((($year % 100) != 0) || (($year %400) == 0)));
// Send user to a different page based on valid login header('Location: ' . ($valid_login ? '/members/index.php' : 'login.php?errors=1'));
With a few lines of code, you can easily add content before and after each page in a directory without using require()
or include()
PHP commands.
# Prepend to the file php_value auto_prepend_file "includes/header.php" # Append to the file php_value auto_append_file "includes/footer.php"
Josh Ashmore is a freelance web designer, full-stack developer, content creator and aspiring artist based in Houston, Texas where he works full time in asset management and marketing.