links..

They have: 164 posts

Joined: Nov 2001

hi...faced problem here.

i have this page, where i clicked a link and i can go to a page where exam questions are shown. i wanted to do it in such a way where only registered users are allowed to take the exam.

therefore, when user clicked the link, it will checked whether is he login or not, if not, it will go to the login page to let the user login. the problem i'm facing is..after i login, i can' t seem to go back to the page where i first in..instead, i will go to the usercp page..
for eg. this is the exam page:
abc.com?quiz=1
i was found that i'm not login, therefore i was brought to the usercp.php, after i login, i suppose to go back to abc.com?quiz=1 but i was brought to usercp.php. pls help...

this is my code:

<?php
if ($bbuserinfo[userid]==0)
    {
        include_once(\
"../forum/global.php\");   
       
$thispage=urlencode(\"$PHP_SELF?quiz=$quiz\");
        header(\"Location:<a href=\"http://www.certifyexpress.com/forum/usercp.php?urloverride=1&prevpage=\" class=\"bb-url\">http://www.certifyexpress.com/forum/usercp.php?urloverride=1&prevpage=</a>\".
$thispage);

    }
?>

in global.php:

<?php
if(!$urloverride) { $scriptpath=$REQUEST_URI; }
else {
$scriptpath=urldecode($prevpage); }
?>

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Your header call is wrong, try this:

<?php
header
(\"Location: $thispage\");
?>

They have: 164 posts

Joined: Nov 2001

my header?? that header is for, when user are not login, it goes to that page for user to login. if i changed to $thispage, then the link is incorrect already..isn't it??

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.