corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » PHP is this possible?


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author PHP is this possible?
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
18th Nov 06 at 14:09   View Garage View User's Profile U2U Member Reply With Quote

Ok iv made it on the homepage at vagweb that to gain access to the drop down brochure lists you have to be registered and logged in.

That works fine, but if someone already had the full link to the brochure ie

http://www.vagweb.co.uk/brochures/blah.pdf

how could i stop them direct linking to this path ? or even direct link only if they are logged in?
Liam
Member

Registered: 19th Jan 06
Location: Stafford
User status: Offline
18th Nov 06 at 14:19   View User's Profile U2U Member Reply With Quote

Password it?
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
18th Nov 06 at 14:26   View Garage View User's Profile U2U Member Reply With Quote

i have password protected the directory but then it doesnt work when linking from the site, asks for password etc
PaulW
Member

Registered: 26th Jan 03
Location: Atherton, Greater Manchester
User status: Offline
18th Nov 06 at 14:28   View User's Profile U2U Member Reply With Quote

will you be authenticating the brochure download to the phpbb system??

how about a download mod or something, or are you looking for something more custom?

yes it is possible, but for a full custom system to allow you to upload and assign download permissions to existing groups may take some time if your not 100% familiar with the phpbb structure...

saying that, im currently doing a re-write of FAP to allow for group quota's on disc space instead of image allocations, aswell as hotlink enable/disable per group... fun!
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
18th Nov 06 at 14:30   View Garage View User's Profile U2U Member Reply With Quote

i am familiar with the php system, all i want it to do is load the brochures when using the drop down menus on the site, but not using a direct link
Laney
Member

Registered: 6th May 03
Location: Leeds
User status: Offline
18th Nov 06 at 14:37   View User's Profile U2U Member Reply With Quote

Use Permissions that are set with a cookie?
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
18th Nov 06 at 14:38   View Garage View User's Profile U2U Member Reply With Quote

cookies im not great with, any clues?

i know how to set a cookie but dont know how to work with permissions and cookies
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
18th Nov 06 at 15:40   View Garage View User's Profile U2U Member Reply With Quote

Put the brochures outside web root, then have a PHP script stream the data to the authenticated user.

Basically select user and pass from your member table, compare those to your cookie variables, when you're happy with that set the appropriate headers with header() function, then do a readfile() to dump out the contents of the file you've fetched from the filesystem which doesn't have a URL.

We have one here which may be some use except its written for this basecode.
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
18th Nov 06 at 15:41   View Garage View User's Profile U2U Member Reply With Quote

ps. alternatively put the brochures user/pass in a thread in one of the member areas and use htaccess to protect the folder.
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
18th Nov 06 at 16:06   View Garage View User's Profile U2U Member Reply With Quote

2nd idea is the most straight forward but id like it to just work.

readfile() - il look up the usage of that command, that sounds promising thanks
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
18th Nov 06 at 16:15   View Garage View User's Profile U2U Member Reply With Quote

Yeah all you're doing is streaming data to the client that you're getting from the other file which doesn't have a URL. Script would be very simple indeed were it not for the need to authenticate as well.
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
18th Nov 06 at 17:35   View Garage View User's Profile U2U Member Reply With Quote

ok i have something working

for example

http://www.vagweb.co.uk/brochures/octavia01.php

takes you to login page if your not logged in otherwise it starts to stream the pdf using readfile

i assume it took you to login page ian?




[Edited on 18-11-2006 by Steve]
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
18th Nov 06 at 17:49   View Garage View User's Profile U2U Member Reply With Quote

Indeed.

You should really have that as one script with a query though - brochure.php?octavia01 for example
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
18th Nov 06 at 17:52   View Garage View User's Profile U2U Member Reply With Quote

yes that was my next move lol
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
18th Nov 06 at 18:17   View Garage View User's Profile U2U Member Reply With Quote

ok done that

http://www.vagweb.co.uk/brochures/brochure.php?octavia01

should give you the brochure or the login page if your not logged in
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
18th Nov 06 at 18:54   View Garage View User's Profile U2U Member Reply With Quote

thanks for helping me sort that out guys btw

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
good deal ? antonOO2 General Chat 4 781
7th Sep 03 at 12:44
by antonOO2
 
Interet techies! Macca_G Geek Day 3 954
9th Mar 04 at 14:48
by Macca_G
 
Few Pics from the Pod (56K Warning) PaulW General Chat 12 1058
21st Feb 05 at 16:40
by Jambo
 

Corsa Sport » Message Board » Off Day » Geek Day » PHP is this possible? 29 database queries in 0.0136812 seconds