Reply to Re: Headers, session, include, - and header again?

Your name:

Reply:


Posted by AnrDaemon on 12/05/07 15:47

Greetings, jodleren.
In reply to Your message dated Tuesday, December 4, 2007, 10:02:57,

> I have this problem, that I need to check the user (using session data
> and some checks (included files)), then when ok, I can send a file to
> the user.... meaning (simplified):

> header("Pragma: no-cache");
> header("Expires: -1");

> session_start();
> if($_SERVER['QUERY_STRING']=="logout")
> session_unset();

> include("session_control.php");
> include('classes.php');

> then, if needed, I might try this (sending a generated file to the
> user):

> header('Content-type: application/octet-stream');
> header("Content-Disposition: attachment; filename=\"$filename\"");
> readfile($userfile);

> But, I cannot set the headers any more. Then again, I need the
> $_SESSION information to check this first, and I need some included
> functions to do that.

> The very ugly solution is all code in one file. There must be another
> way....

> Any idea how to overcome this?

One more idea - enable output buffering.


--
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация