login system problem

Links for php scripts

Moderators: egami, macek, gesf

Post Reply
User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2192
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Wed Jun 20, 2012 8:25 am

if (isset($_SESSION['httpURL'])) {
$url = $_SESSION['httpURL'];
unset($_SESSION['httpURL']);
header("Location: $url");
}


This is how it's done when you go to a book mark that requires a login. The login page appears, you apply credentials, and after a successful authentication, it'll redirect you to the page.. so in theory.. this should be what you want..

Code: Select all

<?php

session_start();
if (!isset($_SESSION['loggedin'])) { 
  /* If user isn't logged in.. assign the URL to a session variable, force a login and then redirect after success */
  $_SESSION['httpURL'] = $_SERVER['REQUEST_URI'];
  include ('loginform.php');
  include ('footer.php');
  die();
} 
 

User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2192
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Thu Jun 21, 2012 6:52 am

That was pretty clear, but you want me to do it for you, and I'm not going to give it away for free. Pitch me 150 bux through paypal, and I'll get your website working.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests