Jump to content

Recommended Posts

I have a page which is in the secure part of my site.

Each page starts with

 

include("../checkadminlogin.php");
include("../../global/connection.php");

 

I am trying to put a link in that page that opens in a new window to some files the user uploaded

 

<tr>
<td class="norm"> 
<a href="../clients/<?=$username?>/<?=$idphoto?>"><?=$idphoto?></a>
</td>
<td class="norm"> 
<a href="../clients/<?=$username?>/<?=$idaddress?>" target="_new"><?=$idaddress?></a>
</td>
</tr>

 

the new page opens the url is correct but I keep getting a forbidden 403 error

 

You don't have permission to access /site/secure/admin/clients/johnny99/photid.jpg on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.7a mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at www.website.com Port 80

 

the documents that are being called at definately there is there anyway i can get around this?

 

Link to comment
https://forums.phpfreaks.com/topic/146778-solved-403-forbidden-error/
Share on other sites

Use .htaccess to set the error document or modify the apache http.conf file and set it there (.htaccess is probably a safer and easier bet).

 

Google htaccess errordocument and you should find examples.

 

EDIT:

Re-read the post:

 

Additionally, this can indicate a problem with your server. Verify that image is there and that the directory is accessible via web, if you have it setup to not be accessible via web you will need a script that can locate and readfile the image you want to grab.

just wondering is it my fault? when i made the directory i used

 

mkdir("../secure/admin/clients/$username", 0700);

 

Yes. That gives permission to the owner only. You would need to give read access to the public (the last 0) I am not sure what that is (5 or 6).

strange i used 700 when i told it to make the file but i just checked the permissions on core ftp and it says the permissions are already 755 readable by everyone so why won't it let me read files from it the permissions are set to the same values as say my images diectory that i created ??

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.