Search found 17 matches

by obay
Tue Sep 01, 2009 11:01 am
Forum: PHP - Code
Topic: PHP+Oracle problem - oci_fetch_all() fails for certain schem
Replies: 0
Views: 41

PHP+Oracle problem - oci_fetch_all() fails for certain schem

Hi all, I have a weird problem with PHP + Oracle. Within my PHP program, I have a function which executes all queries: //all queries are executed by this function //simplified for readability function query($db, $query) {     $result = array();     $parse_result = oci_parse($db, $query);     $execut...
by obay
Tue Mar 17, 2009 12:44 pm
Forum: PHP - Security
Topic: How do I make photos of my products in my website secure?
Replies: 3
Views: 2039

Re: How do I make photos of my products in my website secure?

here is my showImage.php <?php   $filename = "../natura_photos_large/".$_GET[trans]."-".$_GET[size].".jpg"; header("Content-Type: image/jpeg"); echo file_get_contents($filename);   ?> here is my test.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transi...
by obay
Tue Mar 17, 2009 5:20 am
Forum: PHP - Security
Topic: How do I make photos of my products in my website secure?
Replies: 3
Views: 2039

How do I make photos of my products in my website secure?

How do I make photos of my products in my website secure, such that only "members" can view them? I have tried using putting them in a secure folder (outside public_html) and using a showimage.php but it doesn't work. It only outputs the url (text) of the image, not the image itself. I rec...
by obay
Tue Mar 10, 2009 11:05 am
Forum: PHP - Security
Topic: What CHMOD to use?
Replies: 26
Views: 3349

Re: What CHMOD to use?

i tried saving it as .jpg, and it can't be opened by my image viewer, not even thumbnail on windows explorer

must be a problem with the server? cos everything works fine in my local setup.

*sigh*
by obay
Tue Mar 10, 2009 10:21 am
Forum: PHP - Security
Topic: What CHMOD to use?
Replies: 26
Views: 3349

Re: What CHMOD to use?

this is the beginning of the random characters ÿØÿà\0JFIF\0\0\0d\0d\0\0ÿìDucky\0\0\0\0\0<\0\0\0\0€\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \...
by obay
Tue Mar 10, 2009 8:39 am
Forum: PHP - Security
Topic: What CHMOD to use?
Replies: 26
Views: 3349

Re: What CHMOD to use?

the content-type header i used was header('Content-Type: image/jpeg'); because all photos are .jpg files i have 3 versions for each image. 1=small (public), 2=medium (level2 users), 3=large (level3 users) i'll post my code below. note this: - header() call is present: no output - header() call is no...
by obay
Fri Mar 06, 2009 5:02 am
Forum: PHP - Security
Topic: What CHMOD to use?
Replies: 26
Views: 3349

Re: What CHMOD to use?

Chris Corbyn wrote:Please post the code. You did *change* this pseudo code right?

Code: Select all

echo file_get_contents($path_to_the_photo);
$path_to_the_photo won't actually exist. You need to code that. Please show us what you did.
yes i did. i'll post the code later tonight. im still at work. lol
by obay
Fri Mar 06, 2009 5:00 am
Forum: PHP - Security
Topic: What CHMOD to use?
Replies: 26
Views: 3349

Re: What CHMOD to use?

i removed the header() call, and got a weird result from IE

Firefox: random characters
IE: placeholder for an image which contains a red "X"
Opera: random characters
Chrome: random characters

all browsers cannot display the image when header() call is present

hmm..
by obay
Thu Mar 05, 2009 4:55 am
Forum: PHP - Security
Topic: What CHMOD to use?
Replies: 26
Views: 3349

Re: What CHMOD to use?

i am on hostgator.com 1. "myphotos" folder outside public_html: yes, i have been able to create a folder outside public_html and have been read and write to it. the path is /myphotos with permissions 755. but photos don't display. when i try to access the showImage.php from the address bar...
by obay
Wed Mar 04, 2009 4:47 pm
Forum: PHP - Security
Topic: What CHMOD to use?
Replies: 26
Views: 3349

Re: What CHMOD to use?

i have to redo everything.

any ideas? :(
by obay
Wed Mar 04, 2009 4:36 pm
Forum: PHP - Security
Topic: What CHMOD to use?
Replies: 26
Views: 3349

Re: What CHMOD to use?

i just talked with my hosting company.

images need to be inside public_html

this sucks!
by obay
Wed Mar 04, 2009 4:01 pm
Forum: PHP - Security
Topic: What CHMOD to use?
Replies: 26
Views: 3349

Re: What CHMOD to use?

i tried to open my showImage.php file from the address bar, and i've discovered that instead of "echo"ing the photo, it just "echo"es the full path of the file (that is, the http://www.mysite.com/showImage.php?photoid=123) when i do this on my local server, it displays the photo,...
by obay
Wed Mar 04, 2009 3:54 pm
Forum: PHP - Security
Topic: What CHMOD to use?
Replies: 26
Views: 3349

Re: What CHMOD to use?

hi again!

i've done everything you said and everything works fine in my local webserver. but when i uploaded it to my host, the images don't show. i've set the folder permissions to 755, even now that it's outside public_html, but images dont show.

what might be the problem?
by obay
Sun Mar 01, 2009 1:53 pm
Forum: PHP - Security
Topic: What CHMOD to use?
Replies: 26
Views: 3349

Re: What CHMOD to use?

thanks! you've been most helpful!! :)
by obay
Sun Mar 01, 2009 1:28 pm
Forum: PHP - Security
Topic: What CHMOD to use?
Replies: 26
Views: 3349

Re: What CHMOD to use?

this is great! so this means i can now set the photos to CHMOD 700 and still have them displayed (thru PHP), correct?