Showing posts with label PHP Source Codes. Show all posts
Showing posts with label PHP Source Codes. Show all posts

Sunday, July 5, 2015

Prevent back button after logging out

Adding the script below at the top of each PHP page will prevent user from using the back button after logging out.

<?php
session_start();

// Check if session is active or not
if(!isset($_SESSION['session_variable_here'])) { 
$_SESSION['session_variable_here']=NULL;

//Display message below if there is no more active session
echo "Sorry you are no longer active. Please <a href='index.php'>login</a> again.";
die();
}

else

//Your action here if session is active

}
?>

Friday, June 19, 2015

Member Login and Edit Member Information in PHP

Description:

The code is a simple demo on how to edit user information, it has login and registration page and it uses session to fetch user information.

The downloadable file includes:

index.php
loginprocess.php
register.php
registerprocess.php
profile.php
editprofile.php
editaccountprocess.php
logout.php

Preview:

Member Login and Edit Member Information in PHP
Member Profile Info

Member Login and Edit Member Information in PHP
Member Edit Profile Info


Download Link:


Click here to download

Tuesday, June 16, 2015

Connect to MySQL Database using Textbox in PHP

Description:

This simple program will allow you to connect to the MySQL database using the database information you entered on the text boxes.

I signed up in a free hosting service to test the codes. I created a MySQL database inside the free hosting service I signed up and used the database information to test the program.

The downloadable file includes:

index.php
connect.php

Preview:
Connect to MySQL Database using Textbox in PHP

The program was tested many times and it worked just fine. The database information you see in the screenshot above is the one I created. You can download the source code below and then install it in your server.


  • All the boxes need to be filled out else it will result to an error.
  • One wrong database information will also result to an error.
Download Link:

Click here to download