1 (edited by Tubby 2006-12-10 09:00)

Topic: Any suggestions?

Just wondering if any of you had any suggestions on what i could possibly tack on to this current line of code to possibly make it more secure when it comes to redirecting from index.php to login.php?

Here is my code:

// Check to see if the login redirection is enabled for guests //
if ($pun_config['o_login_redirect'] == '1' && $pun_user['g_id'] == PUN_GUEST)
    header('location: '.$pun_config['o_base_url'].'/login.php');

I have everything set up in the database along with the option in admin_options.php......what this does exactly is it lets me enable or disable a feature that automatically redirects all guests to login.php when attempting to visit index.php....this would make index.php inaccessable to guests along with encouraging them to either login or register.

Edit- Do you think it would be more efficient to use the redirect function rather than the header location?

Example:

// Check to see if the login redirection is enabled for guests //
if ($pun_config['o_login_redirect'] == '1' && $pun_user['g_id'] == PUN_GUEST)
    redirect(''.$pun_config['o_base_url'].'/login.php', 'Redirecting you to our login page. …');

if that code is correct that is