Jump to content

Recommended Posts

I have code for display user name and image avatar on external page.

Error is: You don't have permission to access /forum/images/avatars/upload/2_1271130956.gif on this server.

 

Image path is ok when I click on avatar with right click "show image"

 

I asume that error is in code somwhere, Is something wrong or missing?

 

tnx

 

<?php
define('IN_PHPBB', true);
$phpbb_root_path = 'forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

if (!$user->data['is_registered'])
{
?>
<body bgcolor="#FFFFFF">
<div id="loginbox" class="loginbox">
<form method="POST" action="forum/ucp.php?mode=login" >
  <p>Username:
    <input type="text" name="username" size="20">
    <br />
    Password:
    <input type="password" name="password" size="20">
    <br />
    Remember Me?:
    <input type="checkbox" name="autologin">
    <br />
    <input type="submit" value="Submit" name="login">
  </p>
  <p>
    <input type="hidden" name="redirect" value="../index.php">
  </p>
</form>

<?php
}
else
{
?>

<div id="userbox" class="userbox">

<?php
echo 'Pozdrav, ', $user->data['username'];
}
?>


<table width="268" cellspacing="0" cellpadding="0">
    <tr>
      <th scope="col"><div align="left">
<img src="forum/images/avatars/upload/<?PHP echo  $user->data['user_avatar']; ?>" class="floatLeft" width="90" height="90" /> </div></th>
    </tr>
  </table>
</div>

 

Link to comment
https://forums.phpfreaks.com/topic/198360-phpbb3-and-avatar-image-error/
Share on other sites

you cant access it from an external source probably because the prepackaged .htaccess file for the avatars folder doesn't permit people viewing the avatars from external sources. You could just delete the .htaccess file but that might create some sort of security issue

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.