문제

I'm trying to create a login strip utilising the PHPBB3 forum logins at the top of a page using the following code:

if ( !$user->data['is_registered'] ) {
  $c .= '<form action="./forum/ucp.php?mode=login" method="post">
    Username:<input style="height:16px;font-size:10px;" type="text" name="username" size="20" title="Username" />
    Password:<input style="height:16px;font-size:10px;" type="password" name="password" size="20" title="Password" />
    &nbsp;<input type="submit" name="login" value="Login" />
    &nbsp;Remember Me? <input type="checkbox" name="autologin" id="autologin" />
    <input type="hidden" name="redirect" value="./../index.php" />
  </form>'
}

yet whenever I use it, it insists on redirecting me to the index page for the forums rather than the index page that the user has just left. This also has the knock-on effect (I think it's caused by this at least) of effectively disabling the session checking on the front page of the website.

If anyone has an idea as to why this is going wrong, that would be much appreciated.

도움이 되었습니까?

해결책

As it turns out, using relative paths causes this to break. Switching to the absolute path of the file fixes the problem for some reason or another.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top