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.

No comments posted yet

Your Answer:

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

i want run some web server under the ip sharer
hello i want run some web server under the ip sharer
my ip is floating ip but it doesnt matter

output printing as hexadecmal... XD
Everything works except the calcem call for the totusold and totuprice. The out put shows up as hex.

How do I get the row number from from an sql table query
Hi all

I have a table that I query and it returns a number of rows.
mysql_num_rows($query)

Vertical Alligning - Not working in 1 cell?
<?php

echo "<table id="valign" width="60%" style=

Passing JS to PHP
So I have the following
Code: <?php
getdetails(?><script type="text/

Delete HTML file after loading
I have limited experience with php and its been a year or two since I've last used it. I have a sma

Something like an INI editor or a DelimitedText-Editor
Hi all,

Am very, very, very new to PHP and not sure if I should be posting this to a Javascri

Polymorphism
Was wondering if someone could explain this a little better to me. I had always assumed that it had

Multiple if statements
Ok so seems basic but for some reason I'm not doing it right. What I want is to be able to have 2 se

difference between datetimes
($row['totime']-$row['fromtime'])/60

this is giving me 0

example of totime and fromtim

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