Required to login help


Posted on 16th Feb 2014 07:03 pm by admin

I'm trying to set up my site so users have to be logged into the forum to access the site.I've been working with this bit of code
Code: [Select]<?php
writeLog();
if ($context['user']['is_logged'])
?>
<?php
else if ($context['user']['is_guest'])
{
redirectexit('action=login');
}
?>
But the problem is that it won't let me stay on the requested page. It'll still redirects even if you are logged in. I want it to check if you are logged in. Then stay on current page as normal, and if you'r not logged in. To redirect you to the login page of the forum.

Any help on this would be great.

291 Like 12 Dislike
Previous php-forum Next php-forum
Other php-forum

Inserting into MySQL Newbie
Hi ive got a slight problem where ive made a simple web form where the customer inserts the ammount

using file_get_contents??
okay how would i create a script using file_get_contents() in php have it grab search pages 1-20 and

FTP issues
Hi all,


I am currently facing some serious problems with a script and really need some ad

Disable html within defined tags
I have a mysql database that allows users to enter content with html, but I also want to have a tag

please, need help coding this voting for your favorite car polling system.
hi, my code needs a lot of work, but i want to be able to let users vote on their favorite car, upda

ereg_replace in Wordpress
Heya - so I'm working on this site: http://world-of-smiles.theportlandco.com/new-patients

The

Add a sign-up feature to a flat file login script
I'm working on a flat file login script and I would like to add a sign-up feature to it with a email

Option box to change variable
Hello, i need help by making a script!

I need to write a file with option box, so a dropdown

Why does this file not return file names that start with numbers?
This file returns a list of filenames to help populate a drop down in my form. For some reason it ig

Session is not saving
I am not trying to do anything too fancy, I am just trying to get some $_SESSION data to save and us

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash