Search found 89 matches

by bradles
Wed Dec 01, 2004 1:52 am
Forum: PHP - Code
Topic: percentages of over 1000
Replies: 2
Views: 586

percentages of over 1000

For some strange reason if I try and get 10 % of my session variable $x when it is over 1000 I end up with the answer being 0.1 when it should be 100. I have tried with amounts under 1000 like 975 and it returns 97.5 as it should but the minute i go over 1000 i get 0.1. Stupid thing is that I can do...
by bradles
Sun Nov 28, 2004 3:57 am
Forum: PHP - Code
Topic: Session behaviour bizarre to newbie
Replies: 3
Views: 1159

I think the session is being shared with both connections as I have client TWO's images on client ONE's preview page.
by bradles
Sun Nov 28, 2004 3:52 am
Forum: PHP - Code
Topic: Session behaviour bizarre to newbie
Replies: 3
Views: 1159

Ok...here goes - sorry for two large scripts. I included my login.php script and my previews.php script that shows a particular client's images. Client one has 323 images in their folder. At 12 images per page on the preview page that translates to 27 pages of images. Client two has 421 images that ...
by bradles
Sun Nov 28, 2004 3:07 am
Forum: PHP - Code
Topic: Session behaviour bizarre to newbie
Replies: 3
Views: 1159

Session behaviour bizarre to newbie

Hi All, I have an image gallery working for my clients to login and view their portraits. I'm just testing it on my local server at the moment but I am getting some bizarre results with my little experience with sessions. I have setup galleries for two clients that both contain an 'images' and 'thum...
by bradles
Sun Nov 28, 2004 12:01 am
Forum: PHP - Code
Topic: Preventing direct image link?
Replies: 16
Views: 3883

Thanks rehfeld, I am setting $_SESSION['logged_in'] = true I've been trying all afternoon to get this but I am determined not to fail. I think maybe my script is becoming out of control so I am trying to clean it up. I tried files inside the doc root and outside it with unreliable results. At the mo...
by bradles
Sat Nov 27, 2004 9:47 pm
Forum: PHP - Code
Topic: Preventing direct image link?
Replies: 16
Views: 3883

rehfeld, Thanks for your help. You are certainly leading me in the right direction and I appreciate your help. I have tweaked the code(below) for my login script. <? session_start(); if (empty($_SESSION['logged_in']) || $_SESSION['logged_in'] != 'true') { exit; } if (!isSet($_GET['thumb'])) { exit; ...
by bradles
Sat Nov 27, 2004 5:13 pm
Forum: PHP - Code
Topic: Preventing direct image link?
Replies: 16
Views: 3883

you could use the code i gave you, w 1 change instead of having the picture_dir the same for all users $picture_dir = "path/to/images/$username/"; Rehfeld, I'm trying your suggestion but I am having trouble with my understanding of how it works. <? $picture_dir = 'clients/smith/images/'; ...
by bradles
Sat Nov 27, 2004 7:11 am
Forum: PHP - Code
Topic: login security opinion?
Replies: 7
Views: 2115

login security opinion?

Hi All, I have developed a simple login script for my site so my clients are able to login to view their portraits. I wanted a login system as most clients don't wish their portraits to be available for the whole world to see. I understand very few login systems are 100% fool proof and I am not tryi...
by bradles
Sat Nov 27, 2004 6:57 am
Forum: PHP - Code
Topic: Preventing direct image link?
Replies: 16
Views: 3883

I went back to having my directory's live on the site eg., http://www.domain.com/clients/smith/images/001.JPG. I applied a .htaccess password required in order to access the 'clients' folder. I thought I would be able to put a .htaccess on the 'clients' directory and have the php script still be abl...
by bradles
Thu Nov 25, 2004 5:09 pm
Forum: PHP - Code
Topic: Preventing direct image link?
Replies: 16
Views: 3883

The site is nearly finished. I am using a fairly simple session login system and will probably need to tighten security of it at a later stage. It would be nice to be able to do a something creative with a .htaccess if it makes it easier to access the images. I am just trying to make it as difficult...
by bradles
Thu Nov 25, 2004 8:54 am
Forum: PHP - Code
Topic: Preventing direct image link?
Replies: 16
Views: 3883

Problem is now I can't get my script to pull them in.

I checked the source code for one of the images i'm trying to bring in with my script on the server.
<img src="../clients/smith/images/001.jpg"

But no image. What am I missing?

Brad.
by bradles
Thu Nov 25, 2004 8:41 am
Forum: PHP - Code
Topic: Preventing direct image link?
Replies: 16
Views: 3883

Hedge,

If that works I'm going to call you a genius!!! :)

Brad
by bradles
Thu Nov 25, 2004 8:33 am
Forum: PHP - Code
Topic: Preventing direct image link?
Replies: 16
Views: 3883

Preventing direct image link?

Hi All, I have an image gallery that my client's log into to view their pictures. How does one go about preventing a user just simply accessing the images from the browser like: http://www.domain.com/clients/smith/images/001.jpg I have the folder set up so you cannot get a directory listing but it d...
by bradles
Tue Nov 23, 2004 6:00 pm
Forum: PHP - Code
Topic: Storing reference to images in database?
Replies: 3
Views: 1018

Thanks Phenom, I looked at phpwebgallery and noticed that in their script they upload the images into a folder but they also run a process which stores all the names in the database. As I'm still wrapping my head around PHP, I didn't know if I should be doing the same thing or not. I think I will tr...
by bradles
Tue Nov 23, 2004 5:26 pm
Forum: PHP - Code
Topic: Storing reference to images in database?
Replies: 3
Views: 1018

Storing reference to images in database?

Hi All, I have a script for my image gallery that retrieves an array of image names from a folder. Are there any advantages of having these names of images listed in the database? Am I better to run my script based on what is stored in a database or should I just retrieve the list from the folder an...