Search found 14 matches

by Kestas
Fri Aug 04, 2006 1:38 am
Forum: PHP - Code
Topic: PHP sessions
Replies: 17
Views: 1112

Thanks everyone, it works now. The solution was: index.php <?php session_start(); header("Content-type: image/jpeg"); $maindir="C:/web/docs/sventes/saskrydis/thumbs/"; $mydir = opendir($maindir); $_SESSION["directory"]=$maindir; $exclude = array(".", "..&...
by Kestas
Thu Aug 03, 2006 11:37 pm
Forum: PHP - Code
Topic: PHP sessions
Replies: 17
Views: 1112

I know it`s server-side, but thought output is being sent during compilation. As I understood now, php sends it only after EVERYTHING is compiled.
by Kestas
Thu Aug 03, 2006 8:31 am
Forum: PHP - Code
Topic: PHP sessions
Replies: 17
Views: 1112

Thanks a lot!
Now it's all clear to me. All that I needed was "everything in PHP is compiled BEFORE the user sees ANYTHING on their screen"(by Jenk).
by Kestas
Thu Aug 03, 2006 6:58 am
Forum: PHP - Code
Topic: PHP sessions
Replies: 17
Views: 1112

I understand that. To explain what I don't understand, I will give you an example: In "C:/web/docs/thumbs/" we have files : 1.jpg, 2.jpg, 3.jpg. When itterations start , first itteration sets $_SESSION["photo"] to "1.jpg". Value of $_SESSION["photo"] is output...
by Kestas
Tue Aug 01, 2006 7:35 am
Forum: PHP - Code
Topic: PHP sessions
Replies: 17
Views: 1112

If output to the browser is sent after all iterations had been done, then of couse $_SESSION["photo"] will always stay the same(the last value). Otherwise it should be different every time.
by Kestas
Tue Aug 01, 2006 7:14 am
Forum: PHP - Code
Topic: PHP sessions
Replies: 17
Views: 1112

Yes, I know what you mean, but in my code echo'<img src="next.php"/>' is called not after but during itterations. I just thought maybe output to the browser by PHP is being sent only after all iterations had been done, not during them?
by Kestas
Tue Aug 01, 2006 6:45 am
Forum: PHP - Code
Topic: PHP sessions
Replies: 17
Views: 1112

I am completely lost now:

Code: Select all

echo"$fn<br>";   // outputs image name(different every itteration)
    $_SESSION["photo"]=$fn;      // $_SESSION["photo"] equals to whatever $fn is, so should be different every iteration too
Please explain me: where am I wrong?
by Kestas
Tue Aug 01, 2006 6:23 am
Forum: PHP - Code
Topic: PHP sessions
Replies: 17
Views: 1112

But everytime $_SESSION["photo"] is being accessed from "next.php" it should have different values. At every iteration $fn changes, so should $_SESSION["photo"]. Why does it not happen so?
by Kestas
Tue Aug 01, 2006 3:47 am
Forum: PHP - Code
Topic: PHP sessions
Replies: 17
Views: 1112

PHP sessions

Hi! Need some help with PHP sessions(I quess so). My php code should be outputting to browser all images in a specified folder, but for some reasons it outputs always the same image - the last one in folder. It reads files correctly, dislplays their names. It`s just the images that are always the sa...
by Kestas
Mon Jul 31, 2006 1:14 pm
Forum: PHP - Code
Topic: output of imagejpeg() function
Replies: 9
Views: 458

It works beautifully! Thanks everyone a lot!
by Kestas
Mon Jul 31, 2006 11:47 am
Forum: PHP - Code
Topic: output of imagejpeg() function
Replies: 9
Views: 458

I have followed all your suggestions and came up with the code that still doesn`t work and does the same as previous ones - outputs symbols instead of image(only one image this time). My code: <? session_start(); $maindir="E:\web\docs\\thumbs"; $mydir = opendir($maindir); $exclude = array(...
by Kestas
Mon Jul 31, 2006 11:10 am
Forum: PHP - Code
Topic: output of imagejpeg() function
Replies: 9
Views: 458

Thank you for your replies. No, there`s nothing to separate images from the stream. Did I get you right: with a single .php file I will not be able to send all files in a specified folder to a browser?
by Kestas
Mon Jul 31, 2006 6:32 am
Forum: PHP - Code
Topic: output of imagejpeg() function
Replies: 9
Views: 458

feyd | Please use , and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color] M...
by Kestas
Mon Jul 31, 2006 12:22 am
Forum: PHP - Code
Topic: output of imagejpeg() function
Replies: 9
Views: 458

output of imagejpeg() function

Everah | Please use , and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color] Hi! Nee...