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'])
Did you know?Explore Trending and Topic pages for more stories like this.
?>
<?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.
No comments posted yet

Your Answer:

Login to answer
291 Like 12 Dislike
Previous forums Next forums
Other forums

How do I know when getBounds Method is ready to be called.
I have an application that changes out stylesheets client side. Once I change stylesheet the browse

using a loop help
Hi guys , i need some help. I have this loop :
while ($row = mysql_fetch_assoc($Result)) { ?&

Problem with shopcart code
Hello, I am having a bit of trouble being able to add a product to my shopcart. My mysql database i

php automatically escaping single quotes
I'm trying to test out my security a bit and I've noticed that php is escaping my single quotes. For

Ball movement
I want to move a ball from one point to another and it should hit a group of balls at the other end

php/xmlrpc class issue
I am working on xml-rpc in php to start with.

I have a class that only has variables defined

Email logic not working
I would like to send an email using the php email() function then if it does execute i.e sends i wou

Points for Wiki contribution
Hi everyone,

I want to know how long does it take for the moderator to award points for a

building a function with multiple outputs
I want to build a function that has multiple outputs.

I know but am not to sure how I should

Feed Maker
Hi all.
First of all I must say I am not a php developer so I am afraid I don't know much about i

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