Archive

Posts Tagged ‘functions’

Using the PHP Include Command

May 11th, 2009 Gertjan No comments

This tutorial will teach you the very basics on how to use a PHP #include command. The #include command is used to insert the content of an external HTML page into an existing PHP page. For example, the header and footer of this page you are reading right now are actually external files which are loaded into the page when you request the server to display the page. Using this technique makes it easier to update the header of all the pages of our website by simple updating a single included header file without having to update any code in any of our pages.
Read more…

Categories: PHP Tags: , , ,

Working with dates and times in PHP

May 11th, 2009 Gertjan No comments

When developing more complex PHP sites, especially forums, discussion boards and blogs where date and time functions are important, you’ll regularly encounter situations where you need to display and manipulate values based around the current date and time. PHP includes a range of functions which can help you to easily format and adjust your date and time displays to suit your needs.

In this tutorial, we’ll look at some easy ways to display calendar information for your visitors.
Read more…

Categories: PHP Tags: , , ,

Complete advanced login member system – PHP tutorial

January 11th, 2008 Gertjan 223 comments

In this advanced tutorial i will teach you the steps required to create a custom build login/member system with PHP.

The system itself ofcourse has alot of room for improvements, also, it’s very easily expandable, i’ve chosen to work in a modular way, so that if you change something you only have to change it in 1 file. I’ve done this by using functions, this script is a good example of the real power of PHP.

Features:

  • Registration
  • Lost password
  • Various checks on passwords and usernames
  • users can change their password
  • Passwords are stored in a database with a seed added to it and they have sha1 encryption
  • Easy to adjust & use

Requirements:

  • Mysql database
  • a php & mysql enabled host
  • php mail() enabled host
  • ftp access to your website

Overview

Steps:

  1. Creating the mysql table
  2. Creating a db_connect.inc.php file
  3. Creating the header.php file
  4. Creating the footer.php file
  5. Creating the index.php file
  6. Creating the login.php file
  7. Creating the logout.php file
  8. Creating a function.inc.php file
  9. Creating the mail.functions.inc.php file
  10. Creating the display.functions.inc.php file
  11. Creating the login.functions.inc.php file
  12. Creating the user.functions.inc.php file
  13. Creating the validation.functions.inc.php file
  14. Creating the lostpassword.php file
  15. Creating the changepassword.php file
  16. Creating the register.php file
  17. Creating the activate.php file

Read more…