Re: [PHP] Discarded extension on file download

2002-04-19 Thread Tom Mikulecky

This don't work for me :(
Extension .gz is still throwed away.

Tom

Danny Shepherd wrote:

 Hi,

 I recently had this problem and, after hours of hair pulling, found that it
 seems to work best if you send
 the words Content-Type and Content-Disposition in **lower case**. Not sure
 why it has to be like that but it was the only way I found.

 HTH,

 Danny.

 - Original Message -
 From: Tomas Mikulecky [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, April 19, 2002 9:40 AM
 Subject: [PHP] Discarded extension on file download

  Hi
 
  I am trying to offer downloading files from a web server, using PHP.
 
  The files are gzipped text and have all .txt.gz extensions. Now while on
  Windows systems both IE and Netscape offers to download it under the
  full name (althought IE adds [some_number] to the base of the file
  name), under Unix or Linux systems (tested with netscape 4.7) the '.gz'
  part is discarded from the file name and the file is saved with .txt
  only. Downloaded file is still gzipped.
 
  The part of script serving the files is as follows:
 
  header(Content-type: application/octet-stream);
  header(Content-Disposition: attachment; filename=$my_filename);
  echo($file_body);
 
  What am-I doing wrong? Thanks in advance
 
  Tom
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP + Microsoft Access

2002-04-22 Thread Tom Mikulecky

Hello

I have to interface an MSAccess database and Apache server on a linux
box thru PHP. The only way I found to do that is to use ODBC with some
specific drivers (I tried Openlink). This solution needs sort of server
running on a Windows station, it serves requests to the Access database
file.

The problem is that I would like to do this WITHOUT any Windows station,
to achieve good reliability (we can't have a Windows station running
just for that). Also the database can't be ported to any other format
because there are some programs written in VB-Access that need it as is.

So what I need is sort of sql driver for accessing mdb files on a
unix/linux box. Does-it exist? I searched a lot on the web but with no
succes.

Any suggestions are welcome
Thanx in advance

Some details:
- The Access database file (mdb) is located on a Unix box in a shared
folder

Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Program execution stops at exec()

2002-05-24 Thread Tom Mikulecky

Hello

In one script I use exec() to execute a shell script which takes 2-3
hours to run. I disabled user abort and set time limit to more than one
day. The shell script finishes well but no instruction after exec() is
run. The script finishes with no error nor warnings.
Some of you know hwat happens?
Thanx in advance.

Tom

Code snaps:


ignore_user_abort(1);

set_time_limit(10);

(...)

exec('/home/tom/build.sh  ouput 2errlog');//takes 3 hours to complete

//  *** Nothing from here gets executed, 'build.sh' script completed with succes ***

(...)

I'm using php 4.0.4pl1(can't upgrade) with Apache 1.3.19 on Mandrake



[PHP] Re: Program execution stops at exec()

2002-05-27 Thread Tom Mikulecky

I read in php manual that set_time_limit() affects in fact max_execution_time.
You can see in my example code
I wrote in my initial post that I set it to 100k secs. Php don't run in safe
mode so it should go fine.

What I don't understand is why my php script dies while executing the shell
script. Set_limit_time should make it
wait. The build.sh script completes well.

Tom

Michael Virnstein wrote:

 note:
 i think the exec in your php waits for the shell to return, but before the
 shell can answer, php terminates the script, because of the max_exection.

 Michael

 Michael Virnstein [EMAIL PROTECTED] schrieb im Newsbeitrag
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  check your max_execution_time settings in php.ini
 
  Michael
 
  Tom Mikulecky [EMAIL PROTECTED] schrieb im Newsbeitrag
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Hello
  
   In one script I use exec() to execute a shell script which takes 2-3
   hours to run. I disabled user abort and set time limit to more than one
   day. The shell script finishes well but no instruction after exec() is
   run. The script finishes with no error nor warnings.
   Some of you know hwat happens?
   Thanx in advance.
  
   Tom
  
   Code snaps:
  
  
   ignore_user_abort(1);
  
   set_time_limit(10);
  
   (...)
  
   exec('/home/tom/build.sh  ouput 2errlog');//takes 3 hours to
  complete
  
   //  *** Nothing from here gets executed, 'build.sh' script completed
 with
  succes ***
  
   (...)
  
   I'm using php 4.0.4pl1(can't upgrade) with Apache 1.3.19 on Mandrake
  
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Program execution stops at exec()

2002-05-27 Thread Tom Mikulecky

David Freeman wrote:

   What I don't understand is why my php script dies while
   executing the shell script. Set_limit_time should make it
   wait. The build.sh script completes well.

 Not the exact solution here but perhaps a work-around.  How dynamic is
 the data you're generating with your shell script?  Perhaps you could
 get away with doing a cron on your shell script (once every hour or
 whatever) and outputing it to a text file that you then parse in php to
 deal with results.

 CYA, Dave

It is generated rarely. I wanted to do a sort of interface to start
generation of some files at distance. It would be cool to have it done
just by pushing single button. My work-around is that now I have to push
another button after 3 hours ;) No big deal, it is generated once or twice
a year.

Thanks to everyone who tried to help me

Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Session's is slowing the page ??

2002-05-28 Thread Tom Mikulecky

Hi

PHP's sessions are blocking, i.e. until a session is closed, all other calls to
session_start() are pending. If you don't close a session explicitely, it
remains opened until the script is terminated.
The solution is to close a session as soon as possible (session_write_close) or
use non-blocking read-only sessions (session_readonly instead of session_start)
in case you don't need to modify registered variables.

Tom


Dima Dubin wrote:

 Hello,
 I have very wierd problem :
 I use session to manage users and I have this structure of the page :
 -
 include(db.php);
 include(header.php);
 bla bla
 include(footer.php);
 -

 in the db.php I have :

 
 session_start();
 #some mysql connect stuff
 

 I use session with the $_SESSION array (cheking if registered[isset($_S...)]
 and registering...)
 and all work fine
 but sometimes the page loading is very very very slow (and its a really
 really fast host) and when I removing session_start(); from the top of the
 page, the page load normaly.

 the PHP version is 4.1.1, someone have an idea ?
 thanks in advance,
 Dima.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Session's is slowing the page ??

2002-05-28 Thread Tom Mikulecky

Login page:


// suppose that user login was verified
// Following code have to be executed only if user is valid

session_start();
session_register(user,user_email);//register here all needed data.
   //In this case, it will register $user
and $user_email in the session

Put the following in session.inc and include session.inc on top of each script
that has to be run for logged users

session_readonly();
if((!session_is_registered(user)) || (!session_is_registered(user_email)))

header(Location: login.php);

This will redirect user to the login page if not logged in. If he was logged,
script will go on and you can access $user and $user_email. Any change of
their value will not be saved in the session

Tom

PS: in my PHP version 4.04 , function session_readonly() is unknown. What I
use instead is:

session_start();

session_write_close();   //session_end is also unknown by 4.0.4



Dima Dubin wrote:

 Hello Tom

 I looked in the manual for session_readonly because its basicly what I need
 : 1 login page, and the just read the session data in other pages
 but, there is no examples or anything like that in the manual could you
 please show me a little example how to use it on my pages ?

 THANKS !!
 Dima.

 Tom Mikulecky [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi
 
  PHP's sessions are blocking, i.e. until a session is closed, all other
 calls to
  session_start() are pending. If you don't close a session explicitely, it
  remains opened until the script is terminated.
  The solution is to close a session as soon as possible
 (session_write_close) or
  use non-blocking read-only sessions (session_readonly instead of
 session_start)
  in case you don't need to modify registered variables.
 
  Tom
 
 
  Dima Dubin wrote:
 
   Hello,
   I have very wierd problem :
   I use session to manage users and I have this structure of the page :
   -
   include(db.php);
   include(header.php);
   bla bla
   include(footer.php);
   -
  
   in the db.php I have :
  
   
   session_start();
   #some mysql connect stuff
   
  
   I use session with the $_SESSION array (cheking if
 registered[isset($_S...)]
   and registering...)
   and all work fine
   but sometimes the page loading is very very very slow (and its a really
   really fast host) and when I removing session_start(); from the top of
 the
   page, the page load normaly.
  
   the PHP version is 4.1.1, someone have an idea ?
   thanks in advance,
   Dima.
 



[PHP] Re: Session's is slowing the page ??

2002-05-28 Thread Tom Mikulecky

Hat you do is the same as if you do nothing, because your session_write_close()
is called near the end of script and sessions are automatically closed at the
end of a script. You should 'copy' all needed variables from the session in
your header.php like this:

session_start();
$copy_user = $user;//if $user and $user_email are session data
$copy_user_email = $user_email;
session_write_close();//or session_end() if your php knows it

That way you can access $copy_* in the body instead of session variables.
It works as readonly access to session data

Tom

Dima Dubin wrote:

 Hi Tom
 Thanks for your help but the problem  still happens :-(
 First I tried to use session_readonly() but it was unknown FUNC` in my php,
 then I try the second way :
 I have header.php  footer.php in the header I use session_start(); and in
 the footer I use session_write_close() and still every minute the site
 freezes.
 Is there any other way ? I really need to use these session's...

 thanks again for your great help,
 Dima.




[PHP] Re: httpd runs forever

2002-05-30 Thread Tom Mikulecky

There's always at least one httpd process running which listens to
incoming http connections.

Tom

Jacob Friis Larsen wrote:

 I sometimes have a httpd process that when I look at top has run for
 more than 100 min.

 Can I in some way find out why it will not stop or its url?

 Regards Jacob


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php