php-general Digest 14 Jan 2002 21:01:07 -0000 Issue 1111

Topics (messages 80436 through 80492):

Re: How to get a function backtrace?
        80436 by: Martin Wickman

Re: Setting up an XML platform/website
        80437 by: Jon Farmer

Re: How to get a stacktrace? (was how to get a function backtrace)
        80438 by: Stefan Rusterholz
        80439 by: Neil Kimber

Passing variables with include()
        80440 by: Imar de Vries
        80441 by: Nick Wilson
        80442 by: Tino Didriksen
        80443 by: Stefan Rusterholz
        80444 by: Stefan Rusterholz
        80447 by: Imar de Vries
        80450 by: Imar de Vries
        80452 by: Martin Wickman
        80453 by: Scott Houseman
        80454 by: Stefan Rusterholz
        80455 by: Martin Wickman
        80458 by: Stefan Rusterholz
        80461 by: Rick Emery
        80478 by: Mark Roedel

open a New Window
        80445 by: Simos Varelakis
        80448 by: Henning Sprang
        80451 by: Rambo Amadeus

Creating rich interfaces for web applications??
        80446 by: Geoff Caplan
        80449 by: Henning Sprang
        80456 by: John Lim
        80464 by: Geoff Caplan
        80466 by: Geoff Caplan
        80473 by: Henning Sprang
        80480 by: Geoff Caplan

problem with apache php module on solaris
        80457 by: Gino Paoletti
        80459 by: Dennis Moore

Re: CSS Editors
        80460 by: Geoff Caplan
        80467 by: Erik Price

in-browser WYSIWYG html editor
        80462 by: Serge
        80476 by: Serge
        80481 by: Mark

Re: strtok bug
        80463 by: Robert Mena

help using ereg_replace()
        80465 by: Erik Price
        80468 by: Jimmy
        80469 by: liljim
        80470 by: Erik Price
        80471 by: liljim
        80472 by: Bart Brinkmann

Image Fields and PHP...
        80474 by: Gonzalez, Zara E

Header problem
        80475 by: Petr Rezek
        80477 by: Krzysztof Kocjan

apache authentication
        80479 by: aaron.lake.kvaerner.com
        80482 by: Simon Ritchie
        80487 by: aaron.lake.kvaerner.com

Persistent Database Resources?
        80483 by: Nathan Cassano
        80484 by: Nick Wilson

Re: Php.ini file missing
        80485 by: Michael Sciascia
        80488 by: Jason Wong

I18n problems: Working with double-byte languages
        80486 by: Junior, Ricardo

Looking for article writers.
        80489 by: Vlasyuk Valera

how to control hook calling order
        80490 by: Charmaine Tian

problems with includes and extending classes
        80491 by: Chris Jackson

override [EMAIL PROTECTED]
        80492 by: toni baker

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Stefan Rusterholz wrote:

> Im not sure if "function-backtrace" is the correct word for what I need, so I'll 
>explain:
> If I have for example


What you are looking for is a "stacktrace", ie the stack of called 
functions. Dunno if php has any support for it, but it is normally 
used when debugging and error/exception handling.

--- End Message ---
--- Begin Message ---
> Is anyone interested in setting up an XML platform for PHP, where the use
of
> XML is explained, with sample PHP/XML applications and in-depth real live
> tutorials? Since lot's of people underestimate the power of XML. Maybe,
it's
> nice to be ready when Microsoft's dotNet crashes in and launches an new
XML
> era.
>
> Anyone wants to help building such an platform/website?

I used the XML parser in a credit card authorisation front end i wrote. Both
the info to and from the credit card server was in XML and i used PHP to
both build and parse the XML.

I dont mind writing a tutorial on what I did, it works well but not sure how
proficient it was in using XML.

--
--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send email with subject: Send PGP Key


--- End Message ---
--- Begin Message ---
hmmm, i spent now a lot of time searching for such a function (discovering
many many to me unknown but interesting functions :) - but it seems that
there is no such function.

And yes: I wanted to use it for debugging stuff. I have a lot of recursive
functions and callback functions and it's sometimes incredibly hard to
determine when exactly an error happened because I don't know the how
maniest instance of a function actually is running and from where it got
called. I have made some workarounds, but they are all unsatisfying compared
to the possibilities a stacktrace function would offer...

Just to give you a little impression what perl has got for such things (and
i'd love to see that or something similar in PHP) an extract from the
manual:
caller EXPR

caller

Returns the context of the current subroutine call. In scalar context,
returns the caller's package name if there is a caller, that is, if we're in
a subroutine or eval or require, and the undefined value otherwise. In list
context, returns
    ($package, $filename, $line) = caller;
With EXPR, it returns some extra information that the debugger uses to print
a stack trace. The value of EXPR indicates how many call frames to go back
before the current one.

    ($package, $filename, $line, $subroutine, $hasargs,
    $wantarray, $evaltext, $is_require, $hints, $bitmask) = caller($i);
Here $subroutine may be (eval) if the frame is not a subroutine call, but an
eval. In such a case additional elements $evaltext and $is_require are set:
$is_require is true if the frame is created by a require or use statement,
$evaltext contains the text of the eval EXPR statement. In particular, for
an eval BLOCK statement, $filename is (eval), but $evaltext is undefined.
(Note also that each use statement creates a require frame inside an eval
EXPR) frame. $hasargs is true if a new instance of @_ was set up for the
frame. $hints and $bitmask contain pragmatic hints that the caller was
compiled with. The $hints and $bitmask values are subject to change between
versions of Perl, and are not meant for external use.

Furthermore, when called from within the DB package, caller returns more
detailed information: it sets the list variable @DB::args to be the
arguments with which the subroutine was invoked.

Be aware that the optimizer might have optimized call frames away before
caller had a chance to get the information. That means that caller(N) might
not return information about the call frame you expect it do, for N > 1. In
particular, @DB::args might have information from the previous time caller
was called.

----- Original Message -----
From: "Martin Wickman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 14, 2002 10:24 AM
Subject: [PHP] Re: How to get a function backtrace?


> Stefan Rusterholz wrote:
>
> > Im not sure if "function-backtrace" is the correct word for what I need,
so I'll explain:
> > If I have for example
>
>
> What you are looking for is a "stacktrace", ie the stack of called
> functions. Dunno if php has any support for it, but it is normally
> used when debugging and error/exception handling.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>

--- End Message ---
--- Begin Message ---
There is no native PHP function for getting a stack trace. This has been
discussed many times on the PHP-DEV mailing list. It has always been
discarded due to an unacceptable overhead that would be introduced into the
parsing process.
I'm not sure if any decision has been made with respect to the Zend 2
engine, you may want to make a request there ([EMAIL PROTECTED]).

> -----Original Message-----
> From: Stefan Rusterholz [mailto:[EMAIL PROTECTED]]
> Sent: 14 January 2002 10:39
> To: PHP
> Subject: Re: [PHP] Re: How to get a stacktrace? (was how to get a
> function backtrace)
>
>
> hmmm, i spent now a lot of time searching for such a function (discovering
> many many to me unknown but interesting functions :) - but it seems that
> there is no such function.
>
> And yes: I wanted to use it for debugging stuff. I have a lot of recursive
> functions and callback functions and it's sometimes incredibly hard to
> determine when exactly an error happened because I don't know the how
> maniest instance of a function actually is running and from where it got
> called. I have made some workarounds, but they are all
> unsatisfying compared
> to the possibilities a stacktrace function would offer...
>
> Just to give you a little impression what perl has got for such
> things (and
> i'd love to see that or something similar in PHP) an extract from the
> manual:
> caller EXPR
>
> caller
>
> Returns the context of the current subroutine call. In scalar context,
> returns the caller's package name if there is a caller, that is,
> if we're in
> a subroutine or eval or require, and the undefined value
> otherwise. In list
> context, returns
>     ($package, $filename, $line) = caller;
> With EXPR, it returns some extra information that the debugger
> uses to print
> a stack trace. The value of EXPR indicates how many call frames to go back
> before the current one.
>
>     ($package, $filename, $line, $subroutine, $hasargs,
>     $wantarray, $evaltext, $is_require, $hints, $bitmask) = caller($i);
> Here $subroutine may be (eval) if the frame is not a subroutine
> call, but an
> eval. In such a case additional elements $evaltext and
> $is_require are set:
> $is_require is true if the frame is created by a require or use statement,
> $evaltext contains the text of the eval EXPR statement. In particular, for
> an eval BLOCK statement, $filename is (eval), but $evaltext is undefined.
> (Note also that each use statement creates a require frame inside an eval
> EXPR) frame. $hasargs is true if a new instance of @_ was set up for the
> frame. $hints and $bitmask contain pragmatic hints that the caller was
> compiled with. The $hints and $bitmask values are subject to
> change between
> versions of Perl, and are not meant for external use.
>
> Furthermore, when called from within the DB package, caller returns more
> detailed information: it sets the list variable @DB::args to be the
> arguments with which the subroutine was invoked.
>
> Be aware that the optimizer might have optimized call frames away before
> caller had a chance to get the information. That means that
> caller(N) might
> not return information about the call frame you expect it do, for
> N > 1. In
> particular, @DB::args might have information from the previous time caller
> was called.
>
> ----- Original Message -----
> From: "Martin Wickman" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, January 14, 2002 10:24 AM
> Subject: [PHP] Re: How to get a function backtrace?
>
>
> > Stefan Rusterholz wrote:
> >
> > > Im not sure if "function-backtrace" is the correct word for
> what I need,
> so I'll explain:
> > > If I have for example
> >
> >
> > What you are looking for is a "stacktrace", ie the stack of called
> > functions. Dunno if php has any support for it, but it is normally
> > used when debugging and error/exception handling.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Hi all,

at this moment I am working on a script that calculates standings of our
online racing competition. In order to do that, I have to connect to a
database on a remote server.

I have read in the php manual that

[quote]
When a file is include()ed, the code it contains inherits the variable
scope of the line on which the include() occurs. Any variables available
at that line in the calling file will be available within the called
file. If the include() occurs inside a function within the calling file,
then all of the code contained in the called file will behave as though
it had been defined inside that function.
[/quote]

But for some reason, i simply do not get the script to work. I use a
form in the local script to determine which standings are to be shown,
and the value is stored in $serie_id. This is done in the main scope (no
function used). $serie_id can be 2, 3 or 4.

Then I make an include call to the remote script:

include("http://www.someremote.server/calculate_drivers.php";);

In that remote script I use $serie_id to make a database query. But so
far, the query fails because $serie_id is not known.

Are there any known exceptions (f.i. specific server settings) that
might explain why the variable is not known on the remote server?

Thanks in advance!
--
Imar de Vries - [EMAIL PROTECTED] - ICQ 6972439


--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


* On 14-01-02 at 13:01 
* Imar de Vries said....

> Hi all,
> 
Hello!

> at this moment I am working on a script that calculates standings of our
> online racing competition. In order to do that, I have to connect to a
> database on a remote server.
> 
> 
> But for some reason, i simply do not get the script to work. I use a
> form in the local script to determine which standings are to be shown,
> and the value is stored in $serie_id. This is done in the main scope (no
> function used). $serie_id can be 2, 3 or 4.
> 
> Then I make an include call to the remote script:
> 
> include("http://www.someremote.server/calculate_drivers.php";);
> 
> In that remote script I use $serie_id to make a database query. But so
> far, the query fails because $serie_id is not known.
> 
> Are there any known exceptions (f.i. specific server settings) that
> might explain why the variable is not known on the remote server?
> 
> Thanks in advance!
> --
> Imar de Vries - [EMAIL PROTECTED] - ICQ 6972439

Are you absolutely certain that the var is being set properly?
Try printing it to the screen just before you call the script.
- -- 

Nick Wilson

Tel:    +45 3325 0688
Fax:    +45 3325 0677
Web:    www.explodingnet.com



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8QspAHpvrrTa6L5oRAistAKCmkjCwFRXf57JBwRn2gA65vyr6EACgiOqu
kmrKG/BaSZtyMcaIUa/xWT8=
=X8wX
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
> include("http://www.someremote.server/calculate_drivers.php";);

Very simple really: You cannot include remote files...

--|--
Tino Didriksen
http://ProjectJJ.dk/


--- End Message ---
--- Begin Message ---

----- Original Message -----
From: "Imar de Vries" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 14, 2002 12:53 PM
Subject: [PHP] Passing variables with include()


> Hi all,
>
> at this moment I am working on a script that calculates standings of our
> online racing competition. In order to do that, I have to connect to a
> database on a remote server.
>
> I have read in the php manual that
>
> [quote]
> When a file is include()ed, the code it contains inherits the variable
> scope of the line on which the include() occurs. Any variables available
> at that line in the calling file will be available within the called
> file. If the include() occurs inside a function within the calling file,
> then all of the code contained in the called file will behave as though
> it had been defined inside that function.
> [/quote]
>
> But for some reason, i simply do not get the script to work. I use a
> form in the local script to determine which standings are to be shown,
> and the value is stored in $serie_id. This is done in the main scope (no
> function used). $serie_id can be 2, 3 or 4.
>
> Then I make an include call to the remote script:
>
> include("http://www.someremote.server/calculate_drivers.php";);

I'd make a bet (I haven't tried it) that you receive the file already parsed
and so as pure html.
Try it with the extension .txt or something that the remote webserver
doesn't process before it outputs the content.

>
> In that remote script I use $serie_id to make a database query. But so
> far, the query fails because $serie_id is not known.
>
> Are there any known exceptions (f.i. specific server settings) that
> might explain why the variable is not known on the remote server?
>
> Thanks in advance!
> --
> Imar de Vries - [EMAIL PROTECTED] - ICQ 6972439

best regards
Stefan Rusterholz

--- End Message ---
--- Begin Message ---
Sure you can. Right out from the manual:

If "URL fopen wrappers" are enabled in PHP (which they are in the default
configuration), you can specify the file to be include()ed using an URL
instead of a local pathname. See Remote files and fopen() for more
information.

best regards
Stefan Rusterholz

----- Original Message -----
From: "Tino Didriksen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 14, 2002 1:53 PM
Subject: [PHP] Re: Passing variables with include()


> > include("http://www.someremote.server/calculate_drivers.php";);
>
> Very simple really: You cannot include remote files...
>
> --|--
> Tino Didriksen
> http://ProjectJJ.dk/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>

--- End Message ---
--- Begin Message ---
A lot of different answers, which I will respond to:

- The variable is definately set before the include call is made, there is
no doubt about that  at all :)

- Including remote files *is* possible. The php manual does not mention this
does not work, and when I add the variable to the call (include
..../calculate_drivers?serie_id=3.php) the code is processed perfectly. The
thing is, I can not pass the variable with the call, because it's value is
determined by the form field. I could use a switch statement of course, but
that adds a lot more text to the code.

- I'm not sure changing the file extension will help (because the code in
that remote php file has to be processed on the remote server, in order to
be able to query the db), but I will give it a try.

--
Imar de Vries - [EMAIL PROTECTED] - ICQ 6972439


--- End Message ---
--- Begin Message ---
Imar De Vries wrote:

> - Including remote files *is* possible. The php manual does not mention this
> does not work, and when I add the variable to the call (include
> ..../calculate_drivers?serie_id=3.php) the code is processed perfectly. The
> thing is, I can not pass the variable with the call, because it's value is
> determined by the form field. I could use a switch statement of course, but
> that adds a lot more text to the code.

I just changed the code to (include
.../calculate_drivers?serie_id=$serie_id.php)

... and this worked! Weird solution...
--
Imar de Vries - [EMAIL PROTECTED] - ICQ 6972439


--- End Message ---
--- Begin Message ---
Imar De Vries wrote:

> Imar De Vries wrote:
> 
> 
>>- Including remote files *is* possible. The php manual does not mention this
>>does not work, and when I add the variable to the call (include
>>..../calculate_drivers?serie_id=3.php) the code is processed perfectly. The
>>thing is, I can not pass the variable with the call, because it's value is
>>determined by the form field. I could use a switch statement of course, but
>>that adds a lot more text to the code.
>>
> 
> I just changed the code to (include
> .../calculate_drivers?serie_id=$serie_id.php)
> 
> ... and this worked! Weird solution...

Not really. The http://.../foo.php request returns html and not php. 
The foo.php file is parsed and executed by the remote server and 
returned to you as html. By adding serie_id=xxx you actually give the 
remote php-script the name and value of the variable.

You should think of include/require as a way to *include* any file 
into your script. Instead of cutting and pasting code into your file, 
you use include. Thats the way it works in practice. No magic is going 
on here :-)

--- End Message ---
--- Begin Message ---
Hi Al.

While we are on topic, what are the key differences between include() &
require() ?

Cheers

Scott

----- Original Message -----
From: "Martin Wickman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 14, 2002 3:40 PM
Subject: [PHP] Re: Passing variables with include()


> Imar De Vries wrote:
>
> > Imar De Vries wrote:
> >
> >
> >>- Including remote files *is* possible. The php manual does not mention
this
> >>does not work, and when I add the variable to the call (include
> >>..../calculate_drivers?serie_id=3.php) the code is processed perfectly.
The
> >>thing is, I can not pass the variable with the call, because it's value
is
> >>determined by the form field. I could use a switch statement of course,
but
> >>that adds a lot more text to the code.
> >>
> >
> > I just changed the code to (include
> > .../calculate_drivers?serie_id=$serie_id.php)
> >
> > ... and this worked! Weird solution...
>
> Not really. The http://.../foo.php request returns html and not php.
> The foo.php file is parsed and executed by the remote server and
> returned to you as html. By adding serie_id=xxx you actually give the
> remote php-script the name and value of the variable.
>
> You should think of include/require as a way to *include* any file
> into your script. Instead of cutting and pasting code into your file,
> you use include. Thats the way it works in practice. No magic is going
> on here :-)
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>

--- End Message ---
--- Begin Message ---
Since some time there has only one difference left (don't know at which
version it changed):
include causes a warning and require an error on fail. (very useful for
debugging - require your error-handler and include everything else)

best regards
Stefan Rusterholz

----- Original Message -----
From: "Scott Houseman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 13, 2002 2:54 PM
Subject: Re: [PHP] Re: Passing variables with include()


> Hi Al.
>
> While we are on topic, what are the key differences between include() &
> require() ?
>
> Cheers
>
> Scott
>
> ----- Original Message -----
> From: "Martin Wickman" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, January 14, 2002 3:40 PM
> Subject: [PHP] Re: Passing variables with include()
>
>
> > Imar De Vries wrote:
> >
> > > Imar De Vries wrote:
> > >
> > >
> > >>- Including remote files *is* possible. The php manual does not
mention
> this
> > >>does not work, and when I add the variable to the call (include
> > >>..../calculate_drivers?serie_id=3.php) the code is processed
perfectly.
> The
> > >>thing is, I can not pass the variable with the call, because it's
value
> is
> > >>determined by the form field. I could use a switch statement of
course,
> but
> > >>that adds a lot more text to the code.
> > >>
> > >
> > > I just changed the code to (include
> > > .../calculate_drivers?serie_id=$serie_id.php)
> > >
> > > ... and this worked! Weird solution...
> >
> > Not really. The http://.../foo.php request returns html and not php.
> > The foo.php file is parsed and executed by the remote server and
> > returned to you as html. By adding serie_id=xxx you actually give the
> > remote php-script the name and value of the variable.
> >
> > You should think of include/require as a way to *include* any file
> > into your script. Instead of cutting and pasting code into your file,
> > you use include. Thats the way it works in practice. No magic is going
> > on here :-)
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>

--- End Message ---
--- Begin Message ---
Scott Houseman wrote:

> Hi Al.
> 
> While we are on topic, what are the key differences between include() &
> require() ?


"Unlike include(), require()  will always read in the target file, 
even if the line it's on never executes. If you want to conditionally 
include a file, use include(). The conditional statement won't affect 
the require(). However, if the line on which the require() occurs is 
not executed, neither will any of the code in the target file be 
executed."

--- End Message ---
--- Begin Message ---
> Scott Houseman wrote:
>
> > Hi Al.
> >
> > While we are on topic, what are the key differences between include() &
> > require() ?
>
>
> "Unlike include(), require()  will always read in the target file,
> even if the line it's on never executes. If you want to conditionally
> include a file, use include(). The conditional statement won't affect
> the require(). However, if the line on which the require() occurs is
> not executed, neither will any of the code in the target file be
> executed."

I'm pretty sure that at last for PHP 4.06 or higher this is deprecated. I
don't know why it is still in the manual.
Please correct me if I'm wrong.

best regards
Stefan Rusterholz

--- End Message ---
--- Begin Message ---
Does "http://www.someremote.server/calculate_drivers.php"; contain a
function?  If so, you may have to declare "$serie_id" as global within it.

-----Original Message-----
From: Imar de Vries [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 14, 2002 5:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Passing variables with include()


Hi all,

at this moment I am working on a script that calculates standings of our
online racing competition. In order to do that, I have to connect to a
database on a remote server.

I have read in the php manual that

[quote]
When a file is include()ed, the code it contains inherits the variable
scope of the line on which the include() occurs. Any variables available
at that line in the calling file will be available within the called
file. If the include() occurs inside a function within the calling file,
then all of the code contained in the called file will behave as though
it had been defined inside that function.
[/quote]

But for some reason, i simply do not get the script to work. I use a
form in the local script to determine which standings are to be shown,
and the value is stored in $serie_id. This is done in the main scope (no
function used). $serie_id can be 2, 3 or 4.

Then I make an include call to the remote script:

include("http://www.someremote.server/calculate_drivers.php";);

In that remote script I use $serie_id to make a database query. But so
far, the query fails because $serie_id is not known.

Are there any known exceptions (f.i. specific server settings) that
might explain why the variable is not known on the remote server?

Thanks in advance!
--
Imar de Vries - [EMAIL PROTECTED] - ICQ 6972439



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Imar de Vries [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, January 14, 2002 5:53 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Passing variables with include()
> 
> 
> at this moment I am working on a script that calculates 
> standings of our online racing competition. In order to
> do that, I have to connect to a database on a remote server.
> 
> I have read in the php manual that
> 
> [quote]
> When a file is include()ed, the code it contains inherits the
> variable scope of the line on which the include() occurs. Any 
> variables available at that line in the calling file will be
> available within the called file. If the include() occurs inside
> a function within the calling file, then all of the code contained
> in the called file will behave as though it had been defined inside
> that function.
> [/quote]

This is only true for include()s that occur on a local file.  

The next paragraph from the manual contains the information that you'll
actually need:

[quote]
If the include()ed file is called via HTTP using the fopen wrappers, and
if the target server interprets the target file as PHP code, variables
may be passed to the include()ed file using an URL request string as
used with HTTP GET. This is not strictly speaking the same thing as
include()ing the file and having it inherit the parent file's variable
scope; the script is actually being run on the remote server and the
result is then being included into the local script. 
[/quote]
 
The distinction is:

When you include() a local file, the parser will insert the *code* from
that file into your script, and it will behave just as if the code
itself was typed in at that point.

When you include() a remote file, all the parser has access to is the
*results* of the remote file request.


---
Mark Roedel           | "Blessed is he who has learned to laugh
Systems Programmer    |  at himself, for he shall never cease
LeTourneau University |  to be entertained."
Longview, Texas, USA  |                          -- John Powell

--- End Message ---
--- Begin Message ---
Hi to everybody

I wonder if is posiblle to open a new predefined size window  (new html
page) with php code.


Thanks in advance for your time.

Best Regards

Simos
--- End Message ---
--- Begin Message ---
Simos Varelakis wrote:

> Hi to everybody
> 
> I wonder if is posiblle to open a new predefined size window  (new html
> page) with php code.


This won't work with PHP, only with JavaScript Code which may be 
dynamically outputted by php, which means, you could open windows with a 
piece of javaScript, but you could save the size each individual user 
wants in a database and output the size part from there.

the Javascript Code that would open a new window would be something like:

window.open("datei.htm","Fenster1","width=310,height=400,left=0,top=0");

sorry, don't know a good JavaScript Reference in English or greek by 
now, you have to look for your own

Henning


--- End Message ---
--- Begin Message ---
no, its not possible. Try javascript


----- Original Message -----
From: Simos Varelakis <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 14. sije&thgr;anj 2002 14:08
Subject: [PHP] open a New Window


> Hi to everybody
>
> I wonder if is posiblle to open a new predefined size window  (new html
> page) with php code.
>
>
> Thanks in advance for your time.
>
> Best Regards
>
> Simos
>

--- End Message ---
--- Begin Message ---
Hi folks

I have been looking for a practical way to create rich dynamic forms in the
client using PHP, and would appreciate any pointers to workable approaches.
With the launch of .Net I suspect that customer expectations are going to
change, and good old plain HTML will begin to look dated.

I am thinking of client-side functionality such as lists that can sort and
filter, cascading dropdowns, drag and drop, validation in the client that is
double-checked on the server etc etc. I am doing quite large and complex
applications, so there is no way to code the client side stuff by hand - I
need some kind of dynamic library.

This is for intranet use, so I will be able to specifiy the browser verion
to be used, and any plugins required.

There seem to be all kinds of technologies emerging, but most of them are
either too immature, too slow (such as Flash based solutions - see
www.carels.com), or are based on Java.

For all its shorcomings, some kind of XML/DHTML solution seems best, and I
guess it will improve as Browsers catch up with CSS2.

I have spotted a very nice Java/Tomcat solution, for example (see
isomorphic.com), which shows what can be done. But the only DHTML/PHP
library I can find is dynapi, which looks promising but is still a bit
limited so far as functionality goes and the documentation is kinda thin.

Do any of you folks know of a workable way to do this - either commercial or
open source??

Any pointers would be much appreciated

Geoff Caplan.

--- End Message ---
--- Begin Message ---
Geoff Caplan wrote:

> Hi folks
> 
> I have been looking for a practical way to create rich dynamic forms in the
> client using PHP, and would appreciate any pointers to workable approaches.
> With the launch of .Net I suspect that customer expectations are going to
> change, and good old plain HTML will begin to look dated.

> 
> I am thinking of client-side functionality such as lists that can sort and
> filter, cascading dropdowns, drag and drop, validation in the client that is
> double-checked on the server etc etc. I am doing quite large and complex
> applications, so there is no way to code the client side stuff by hand - I
> need some kind of dynamic library.
> 
> This is for intranet use, so I will be able to specifiy the browser verion
> to be used, and any plugins required.


If you don't want to use HTML/CSS and are not bound to use a webbrowser,
you could try to use PHP-GTK - it lets you build GUI's very quickly and 
easily, and works on Win and UNix machines, the Data Processing can be 
done in the same way you always did when coding PHP.
It is in an early stage, but there are already some interesting 
applications, as a Mail Client and an editor.

look at http://gtk.php.net and subscribe to the Mailing Lists there if 
you run into problems.


> 
> There seem to be all kinds of technologies emerging, but most of them are
> either too immature, too slow (such as Flash based solutions - see
> www.carels.com), or are based on Java.
> 
> For all its shorcomings, some kind of XML/DHTML solution seems best, and I
> guess it will improve as Browsers catch up with CSS2.


hmm, my experience with JavaScript is not much better than with Java - 
both are error prone, lead to browser crashes, and are slow or just 
don't work, if things get real comlicated and beyond "displaying a page 
with some text and links and rollovers".


> 
> I have spotted a very nice Java/Tomcat solution, for example (see
> isomorphic.com), which shows what can be done. But the only DHTML/PHP
> library I can find is dynapi, which looks promising but is still a bit
> limited so far as functionality goes and the documentation is kinda thin.


aehm, above you are talking client-side, now here Java/Tomcat /PHP,
it's all server side... what is your _real_ problem?
Creating Lists and all that sort of things which are easily to program 
and maintain for developers - either client or server side, or what?
Are you just looking for a library that helps you to build forms and 
things like that dynamically?


henning






--- End Message ---
--- Begin Message ---
Hi Geoff,

Have a look at phpLens at http://phplens.com/ It's a commercial php software
that my company wrote that allows you to perform sort/filter/edit and
validation
too on your data. Many of our customers are using on Intranets/Extranets.

Works well with NN 4/6 and IE browsers.

Regards, John


Geoff Caplan <[EMAIL PROTECTED]> wrote in message
006c01c19cfb$c04caf60$0339a8c0@ajanta">news:006c01c19cfb$c04caf60$0339a8c0@ajanta...
> Hi folks
>
> I have been looking for a practical way to create rich dynamic forms in
the
> client using PHP, and would appreciate any pointers to workable
approaches.
> With the launch of .Net I suspect that customer expectations are going to
> change, and good old plain HTML will begin to look dated.
>
> I am thinking of client-side functionality such as lists that can sort and
> filter, cascading dropdowns, drag and drop, validation in the client that
is
> double-checked on the server etc etc. I am doing quite large and complex
> applications, so there is no way to code the client side stuff by hand - I
> need some kind of dynamic library.
>
> This is for intranet use, so I will be able to specifiy the browser verion
> to be used, and any plugins required.
>
> There seem to be all kinds of technologies emerging, but most of them are
> either too immature, too slow (such as Flash based solutions - see
> www.carels.com), or are based on Java.
>
> For all its shorcomings, some kind of XML/DHTML solution seems best, and I
> guess it will improve as Browsers catch up with CSS2.
>
> I have spotted a very nice Java/Tomcat solution, for example (see
> isomorphic.com), which shows what can be done. But the only DHTML/PHP
> library I can find is dynapi, which looks promising but is still a bit
> limited so far as functionality goes and the documentation is kinda thin.
>
> Do any of you folks know of a workable way to do this - either commercial
or
> open source??
>
> Any pointers would be much appreciated
>
> Geoff Caplan.
>


--- End Message ---
--- Begin Message ---
Oops - forgot to send this to the list...

Henning

> aehm, above you are talking client-side, now here Java/Tomcat /PHP,
> it's all server side... what is your _real_ problem?
> Creating Lists and all that sort of things which are easily to program
> and maintain for developers - either client or server side, or what?
> Are you just looking for a library that helps you to build forms and
> things like that dynamically?
>

Sorry if I didn't make it clear enough. I am talking about creating
client-side code dynamically on the server.

For example, I have an application that generates a data-entry system
dynamically from a data-dictionary and config files. Right now, it serves up
HTML 3.2, but I would like to be able to offer a more windoze-style
interface, with tabs, drag-and-drop, spreadsheet style grids, fancy combos
etc etc.

I am extending the app to include some CRM stuff, so I would also like
calendar widgets and stuff like that.

But it must be fast and reliable. So maybe HTML is still the only way to go.

Geoff


--- End Message ---
--- Begin Message ---
Henning

> I did not work a lot with applications in PHP-GTK until now to say
> something about speed and reliability ( the list may answer those
> questions, i am only working on the translation of the manual for now),
> but I think it's worth a look at, and i know there are already some
> people out there who use it in a commercial environment.

I think PHP-GTK is a great project, but I really do need to create the
interface on the server and send it to some kind of thin client.

But as you, maybe DHTML is just too unstable.

I don't know if there is some kind of commercial plugin that does this and
will work with PHP. You can do forms in Flash, and they seem to be stable,
but they are much too slow.

Geoff Caplan

--- End Message ---
--- Begin Message ---
Geoff Caplan wrote:

> Henning
> 
> 
>>I did not work a lot with applications in PHP-GTK until now to say
>>something about speed and reliability ( the list may answer those
>>questions, i am only working on the translation of the manual for now),
>>but I think it's worth a look at, and i know there are already some
>>people out there who use it in a commercial environment.
>>
> 
> I think PHP-GTK is a great project, but I really do need to create the
> interface on the server and send it to some kind of thin client.


It might seem that I am advocating PHP-GTK too much, but even this is 
possible. PHP-GTK Apps would run on any X or Windows System where you 
have the GTK Libs and PHP compiled - nothing more needed. I am not shure 
but it might even be very well that these both together still use less 
memory than a webbrowser - in RAM and on HD or when beeing fetched over 
the network at boot time.


When really want to write your application in PHP instead of C/C++ or 
maybe Java I would still consider it better than DHTML.

> 
> I don't know if there is some kind of commercial plugin that does this and
> will work with PHP. You can do forms in Flash, and they seem to be stable,
> but they are much too slow.

What exactly is too slow with flash? dynamical genberation with action 
script?
You could generate your content and data with PHP and display  it with 
flash.


henning

--- End Message ---
--- Begin Message ---
Hi

>
> What exactly is too slow with flash? dynamical genberation with action
> script?
> You could generate your content and data with PHP and display  it with
> flash.
>
>

I have just been talking to the engineers at Carrels, who have produced a
Flash based system for rich forms, but I said I found it too slow and they
agreed. Downloading and rendering the movies is just too slow, even if they
are cached on the server, so Carrels are creating their own specialised
plugin for forms, and also talking with Macromedia about how this aspect of
Flash can be speeded up. The Carrels solution may be a solution once it is
out of beta, but for now, Flash doesn't seem to be the way to go.

I am thinking of using Flash to produce printable documents, though, such as
letters, labels and invoices. I think the Flash format is easier to handle
than PDF, and is generally faster all round. There is an interesting looking
commercial product which looks a bit like Macromedia Generator, but which
has an PHP api. Have you ever heard of this?

http://www.blue-pac.com/products/phpturbine/default.htm

Geoff

--- End Message ---
--- Begin Message ---
Hi, I met some problems starting apache with php module on solaris 8.

Apache is so configured:

--prefix=/usr/local/apache-np --enable-shared=max

The httpd -l response is:

Compiled-in modules:
  http_core.c
  mod_so.c

Php indeed:

./configure --prefix=/usr/local/apache-np --with-apxs=/usr/local/apache-np/b
in/apxs --with-ldap=/usr/local/ns-solaris-ldap-sdk-5/ --with-mysql=/usr/loca
l/mysql --enable-ctype --enable-sockets --enable-ftp --with-java=/usr/local/
j2sdk1_3_1_02 --with-sybase=/usr/local/freetds

The error is:

Syntax error on line 223 of /usr/local/apache-np/conf/httpd.conf:
Cannot load /usr/local/apache-np/libexec/libphp4.so into server: ld.so.1:
/usr/local/apache-np/bin/httpd: fatal: relocation error: file
/usr/local/apache-np/libexec/libphp4.so: symbol uncompress: referenced
symbol not found

Any hint??

Nobody steals our chickens and lives to tell. (Duke Nukem)

Saluti                               Ginox.

--- End Message ---
--- Begin Message ---
I think you need to add the apache module extensions to your apache
configuration.

try adding  --enable-apxs or --with-apxs (I can remember the exact syntax)
to the apache configure.

----- Original Message -----
From: "Gino Paoletti" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 14, 2002 9:36 AM
Subject: [PHP] problem with apache php module on solaris


> Hi, I met some problems starting apache with php module on solaris 8.
>
> Apache is so configured:
>
> --prefix=/usr/local/apache-np --enable-shared=max
>
> The httpd -l response is:
>
> Compiled-in modules:
>   http_core.c
>   mod_so.c
>
> Php indeed:
>
>
./configure --prefix=/usr/local/apache-np --with-apxs=/usr/local/apache-np/b
>
in/apxs --with-ldap=/usr/local/ns-solaris-ldap-sdk-5/ --with-mysql=/usr/loca
>
l/mysql --enable-ctype --enable-sockets --enable-ftp --with-java=/usr/local/
> j2sdk1_3_1_02 --with-sybase=/usr/local/freetds
>
> The error is:
>
> Syntax error on line 223 of /usr/local/apache-np/conf/httpd.conf:
> Cannot load /usr/local/apache-np/libexec/libphp4.so into server: ld.so.1:
> /usr/local/apache-np/bin/httpd: fatal: relocation error: file
> /usr/local/apache-np/libexec/libphp4.so: symbol uncompress: referenced
> symbol not found
>
> Any hint??
>
> Nobody steals our chickens and lives to tell. (Duke Nukem)
>
> Saluti                               Ginox.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>

--- End Message ---
--- Begin Message ---
Hi


> TopStyle - http://www.bradsoft.com
>

I endorse that - it is an excellent product. And for casual use, they have a
free version with nags.

Geoff Caplan
Advantae.com

--- End Message ---
--- Begin Message ---
That looks cool -- is there anything like it that uses Tk or GTK?

On Monday, January 14, 2002, at 09:52  AM, Geoff Caplan wrote:

> Hi
>
>
>> TopStyle - http://www.bradsoft.com
>>
>
> I endorse that - it is an excellent product. And for casual use, they 
> have a
> free version with nags.
>
> Geoff Caplan
> Advantae.com

--- End Message ---
--- Begin Message ---
Hi,

I'm setting up a website and one of the needs is a good in-browser WYSIWYG
editor.
I want to be able that people with no HTML knowledge can manage to edit &
format content.
I've looked at several utilities, such as the one used in postnuke.

I need something with more image manipulation possibilities.
eg: list all images on a dir on the server when you click the insert image
button.

cfdev's activedit (http://www.cfdev.com/activedit/) is such a tool but i
find it a bit too expensive...

Could anyone help me ?

Thx very much

Serge


--- End Message ---
--- Begin Message ---
Hi,

I'm looking for an in-browser html editor.
I've got the scripts used in postnuke and ariadne...
But i need more "image" possibilities.
such as image listing of images on a certain directory on the server.

I know that activedit from cfdev does it but imho a bit to expensive.
http://www.cfdev.com/activedit/

does anybody know of an alternative ? opensource or commercial ?

thx ...

Serge


--- End Message ---
--- Begin Message ---
This is really a javascript thing so you'll probably get a better
response from a javascript group, but I can say that a script like
that will only ever work on IE.


On Sun, 13 Jan 2002 04:00:18 +0100, Serge wrote:
>Hi,
>
>I'm looking for an in-browser html editor.
>I've got the scripts used in postnuke and ariadne...
>But i need more "image" possibilities.
>such as image listing of images on a certain directory on the
server.
>
>I know that activedit from cfdev does it but imho a bit to
expensive.
>http://www.cfdev.com/activedit/
>
>does anybody know of an alternative ? opensource or commercial ?
>
>thx ...
>
>Serge
>
>
>



--- End Message ---
--- Begin Message ---
Hi Manuel and all developers.

I understand that the implementation of strtok was
"broken" (non POSIX compliant) but since it has been
like this for ages would be better to give a chance to
developers worldwide (that has been using and relied
on this broken implementation) to control the
behaviour of such feature much the same way
REGISTER_GLOBALS (or something) in recently 4.1.0.

Imagine recoding 100+ distributed scripts to change
this!

The decision of having this "fixed" is great but not
paying attention (like you always did in the past)
with backwards compatibility is (IMHO) a mistake.

Best regards,
Robert


--- Manuel Lemos <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> Robert Mena wrote:
> > 
> > Hi, does anybody know when the strtok bug
> introduced
> 
> After 4.0.6 .
> 
> > in 4.1.1 will be fixed ?
> > Will we have a 4.1.2 or should I try to grab a cvs
> > tree (assuming that it is already solved) ?
> 
> You may want to ask that in php-dev mailing list
> because last time that
> I reported it I was told that it would not be fixed
> because it was just
> me complaining.
> 
>

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
--- End Message ---
--- Begin Message ---
Hello everyone,

I am trying to learn how to use ereg_replace(), but I don't seem to be 
doing it correctly.

"$phone" is a 10-digit string.

I want to perform the following:

$phone = ereg_replace(".{10}", "[part where I am confused]", $phone);

I would like the output to be

$phone = "(555) 555-5555";

Can a regexp guru help me out? Thank you


Erik

--- End Message ---
--- Begin Message ---
Hi Erik,

> "$phone" is a 10-digit string.
> I would like the output to be
> $phone = "(555) 555-5555";

you don't need regex to do that.
just insert add "(" to the beginning of $phone,
add ") " to the 4th position,
and "-" to the 4th position from behind,
using substr_replace() function.

anyway if you insist on using regex:
preg_replace("/(\d{3})(\d{3})(\d{4})/", "(\\1) \\2-\\3", $arr);

--
Jimmy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Everything loses its value when overly used, including love.


--- End Message ---
--- Begin Message ---
Hello Erik,

> Hello everyone,
>
> I am trying to learn how to use ereg_replace(), but I don't seem to be
> doing it correctly.
>
> "$phone" is a 10-digit string.
>
> I want to perform the following:
>
> $phone = ereg_replace(".{10}", "[part where I am confused]", $phone);
>
> I would like the output to be
>
> $phone = "(555) 555-5555";

I would use preg_replace to do this.

<?

$phone = "5555555555";

$phone = preg_replace("/([0-9]{3,3})([0-9]{3,3})([0-9]+)/", "($1) $2-$3",
$phone);

echo $phone;

?>

The parentheses in the first part of the expression capture what you want.
The stuff between the [and] is a characterclass (in this instance 0 through
9).
The stuff between the curly braces is min,max.

So.....
([0-9]{3,3}) Match 0 through 9 a minimum (and max) of three times
([0-9]+) - match at least once.

Hence the number becomes:
($1) $2-$3
($1) = stuff in first parentheses (three digits) - this case, (555)
followed by a space
followed by the next three digits
followed by a dash
followed by whatever's left.
Note that in the second part of the expression, parentheses lose their
"special meaning", and can be used as regular characters (as can the other
metacharacters).

You will want to make sure that the numbers when inputted are in the format
you want them when you bring them back out of the file / db whatever -

if (!preg_match("/^[0-9]{10,10}/", $input)) {
// We need 10 numbers!
}

Hope that helps.

James



--- End Message ---
--- Begin Message ---
liljim,

Thanks for the advice (and especially the explanation!) -- I note that 
you chose the Perl regexp engine rather than the "e" regexp engine 
(POSIX?).  Quite a few people recommended O'Reilly's "Mastering Regular 
Expressions" over the weekend.  Does anyone know if it covers the Perl 
syntax*?  This seems like a good book to learn more.

Erik
* I don't know Perl


On Monday, January 14, 2002, at 11:11  AM, liljim wrote:

> I would use preg_replace to do this.

--- End Message ---
--- Begin Message ---
Hi Erik,

> Thanks for the advice (and especially the explanation!) -- I note that
> you chose the Perl regexp engine rather than the "e" regexp engine
> (POSIX?).  Quite a few people recommended O'Reilly's "Mastering Regular
> Expressions" over the weekend.  Does anyone know if it covers the Perl
> syntax*?  This seems like a good book to learn more.

The book (though going into examples using perl mainly) gives you a general
grounding in regular expressions - I learned php before perl, and
javascript, though the book has equipped me equally well for all three.  I
love it, and would recommend it for anyyone who's even vaguely interested in
regexes.

James

--- End Message ---
--- Begin Message ---
I own and have read "Mastering Regular Expressions" (excellent book). I've
programmed perl for 3 years and have recently started migrating one of my
projects into php. I can't stand ereg, I prefer preg. While functions such
as substitute and match differ in syntax from perl to php, this book will
teach you quite a bit about how to effectively use preg, which i've found to
be easier, and faster than ereg.

For the record, I like perl's syntax better...   ;p

Hope this helps,

/bart

-----Original Message-----
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 14, 2002 11:26 AM
To: liljim
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: help using ereg_replace()


liljim,

Thanks for the advice (and especially the explanation!) -- I note that
you chose the Perl regexp engine rather than the "e" regexp engine
(POSIX?).  Quite a few people recommended O'Reilly's "Mastering Regular
Expressions" over the weekend.  Does anyone know if it covers the Perl
syntax*?  This seems like a good book to learn more.

Erik
* I don't know Perl


On Monday, January 14, 2002, at 11:11  AM, liljim wrote:

> I would use preg_replace to do this.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
Not sure if this is off topic for this list or not, but thought I would try...

I have a Linux server running Redhat 7.0, PHP 4.1.1, and freetds 0.53. My Linux
server connects to a Win2k server running MSSQL 2000.

Everything works wonderfully, except, I have an image field in one of my tables
and I can't seem to find a way to pull it out without having PHP completely
freak out. (i.e. I get no error message at all just "page cannot be displayed")

So I'm wondering, can you pull image fields out with PHP? 

If so, I'm guessing my limitation is freetds. If not, is there any way to pull
an image out of a database using php? (i.e. store it in a different type of
field not image.)

Any help is appreciated,

Thanks,

Zara
--- End Message ---
--- Begin Message ---
Here is my question.
I wrote a script, which gets parameters from db about document (location on
disc, hashed filename and original filename). Then script open this file a
send it to user.

I use this headers

Header("Content-Type: application/download\n");
Header("Content-Disposition: attachment;filename=\"name_of_file\"");
Header("Content-Transfer-Encoding: binary");

On Windows it works good, but on Mac it doesn't accept name_of_file and try
save this file with name of script.
What is wrong ? Do you have any idea ??

If I used:
Header("Content-Disposition: filename=\"jmeno_souboru\"");
then this script doesn't work also on Windows with Mozilla. Is there any
error in MSIE on Mac, isn't it ?

Thank you for any idea
Petr




--- End Message ---
--- Begin Message ---
It seems to be bug in IE/Netscape/Other www browser on Mac, that's all. 
Header wasn't correct interpreted. I had similar problem with NETSCAPE 6 
on Windows. I hope they will correct it shortly.

Krzysztof

Petr Rezek wrote:

> Here is my question.
> I wrote a script, which gets parameters from db about document (location on
> disc, hashed filename and original filename). Then script open this file a
> send it to user.
> 
> I use this headers
> 
> Header("Content-Type: application/download\n");
> Header("Content-Disposition: attachment;filename=\"name_of_file\"");
> Header("Content-Transfer-Encoding: binary");
> 
> On Windows it works good, but on Mac it doesn't accept name_of_file and try
> save this file with name of script.
> What is wrong ? Do you have any idea ??
> 
> If I used:
> Header("Content-Disposition: filename=\"jmeno_souboru\"");
> then this script doesn't work also on Windows with Mozilla. Is there any
> error in MSIE on Mac, isn't it ?
> 
> Thank you for any idea
> Petr
> 
> 
> 
> 
> 
> 



----------------------------------------------------------------------
Bojkot dokumentow w formacie Worda?
http://komputery.interia.pl/id/arch/www/wys&inf_id=218065

--- End Message ---
--- Begin Message ---
Hi,

I am using the Nusphere application server with apache user directories.
I have several protected user
directories that are of different realms. When a user logs into the
'secure area'  i would like to send them
to pages contained in a secure directory but pass the encoded user:pass
in the URL as to avoid the pop-up
apache authentication dialogue. Is this possible and how do i achieve
this?

TIA,

Aaron Lake
Programmer/Analyst
Kvaerner Chemetics
A Division of Kvaerner Canada Inc
(604) 730 4206


--- End Message ---
--- Begin Message ---
Your question is not very clear, not to me anyway.

Are you trying to write some PHP code that remembers a user name and
password over several requests?  If so, I can answer that.

According to me, it's hard.  The problem is that PHP (in fact Apache itself)
doesn't remember any information between requests - there is (almost) no
persistent storage.  In any case, an apache web server machine runs several
copies of Apache, and you would have to share the data between all the
copies.  Furthermore, there can be more than one physical server.

Your PHP could remember the credentials in a shared database, but that would
be slow.

Once you have some persistent storage, you need to be sure that the incoming
requests are really coming from where you think they are - some sort of
secure session management.  Without that, a hacker can break into somebody
else's logged-in session by sending suitable fake requests.

All this is easier in HTTPS.  I am working on some code that implements
persistent storage with HTTPS, but I haven't got the shared memory part
working yet.

Simon



> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 14 January 2002 17:41
> To: [EMAIL PROTECTED]
> Subject: [PHP] apache authentication
>
>
> Hi,
>
> I am using the Nusphere application server with apache user directories.
> I have several protected user
> directories that are of different realms. When a user logs into the
> 'secure area'  i would like to send them
> to pages contained in a secure directory but pass the encoded user:pass
> in the URL as to avoid the pop-up
> apache authentication dialogue. Is this possible and how do i achieve
> this?
>
> TIA,
>
> Aaron Lake
> Programmer/Analyst
> Kvaerner Chemetics
> A Division of Kvaerner Canada Inc
> (604) 730 4206
>
>
>
>

--- End Message ---
--- Begin Message ---
Apparently i have been unclear, allow me to rephrase:

I want to send user:pass to an apache authentication header for a apache
protected user directory.  Unfortunately, I have php installed as CGI so
native php authentication will not function.  I would like 
to either send the user:pass via GET in a url encoded sting (if possible
as CGI) OR send user:pass
directly to the header using a different method. Due to restrictions
imposed on me, i am not able
to make use of a single unified logon using LDAP or NTLM. In my case,
since there are several user
directories spanning severl realms, I must first authenticate users
against a mysql auth db and fetch
the the realm user:pass based on that users permissions.

Is it possible to send the user:pass in any of the methods described
above? If so, how can i implement
this?

Aaron Lake
Programmer/Analyst
Kvaerner Chemetics
A Division of Kvaerner Canada Inc
(604) 730 4206

--- End Message ---
--- Begin Message ---

Lets say I have a page that makes queries with multiple sorts, returning
plenty of rows and displaying part of the result set. Each time the
client accesses the page the query must be re-executed, spinning the CPU
and thus tieing up resources. In PHP, or any other language could the
result set be stored persistently until the client accesses the page
again, or the result expires and must be re-executed?

--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


* On 14-01-02 at 19:58 
* Nathan Cassano said....

> 
> Lets say I have a page that makes queries with multiple sorts, returning
> plenty of rows and displaying part of the result set. Each time the
> client accesses the page the query must be re-executed, spinning the CPU
> and thus tieing up resources. In PHP, or any other language could the
> result set be stored persistently until the client accesses the page
> again, or the result expires and must be re-executed?

Have a look at www.devshed.com I'm pretty sure there's a good article on
caching there that you'd find usefull. (if not there is *definately* one
on www.zend.com)
- -- 

Nick Wilson

Tel:    +45 3325 0688
Fax:    +45 3325 0677
Web:    www.explodingnet.com



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8QyrtHpvrrTa6L5oRAk2FAJ40NBy2f4nOWWQ2341qhu2FlcrXVwCffzmg
V9IXgNa9QnnCarHSHzjn+pw=
=24yn
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---

> 
> ahhh, if this is indeed the problem, then you (michael from the original
> message) need to enable sendmail in /etc/hostconfig by changing the line
> 
> MAILSERVER=-NO-
> 
> to
> 
> MAILSERVER=-YES-
> 
> (isn't everything different in macosx)
> 
> again, you need to do this from an administrator account. this will start
> sendmail each time you reboot. i'm not exactly sure how to start sendmail
> correctly from the command line, but one of the sites i mentioned earlier
> might have something.
> 
> mike
> 
> -- mike cullerton
> 
> 

I would like to thank you all for all the info you gave me and the php.ini
file! 
Your suggestions have been really useful and I made some progresses, but
I've still got problems :-(

I changed the MAILSERVER line to YES as you said, and now sendmail should
start every time I reboot, but I haven't yet resolved some configurations
problems.

As you all suggested I looked again in several websites and followed many
instructions I've finally found. However it still doesn't work :-(

The last and *most important* thing left to do is to start sendmail, but I
always get errors like:


A) "Failed to start sendmail : 451 4.0.0 /etc/mail/sendmail.cf: line 81:
fileclass: cannot open /etc/mail/local-host-names: Group writable directory"

B) "Failed to start sendmail : /etc/mail/sendmail.cf: WARNING: dangerous
write permissions 451 4.0.0 /etc/mail/sendmail.cf: line 81: fileclass:
cannot open /etc/mail/local-host-names: Group writable directory"


I've got this errors either trying to start sendmail using the terminal or
an interesting applications called "Webmin" I've found looking around for
more information. Webmin allows to manage from your browser various items
like Apache, sendmail and similar stuff, more easily than doing it through
the terminal (at least for a beginner like me).

I always get the same errors and I believe it is because of the file
"local-host-names" privileges. I tried changing them in any combination, but
it still doesn't work...

I will continue trying and hope to get it fixed , if not I will download
another mail server I found looking for info. It is called "post fix" and,
as I read, should be easier to configure and use than sendmail.

Do you think this could be a valid solution?

Thanks again for the patience and the kindness.

Bye,
Michael


--- End Message ---
--- Begin Message ---
On Tuesday 15 January 2002 03:06, Michael Sciascia wrote:

> I would like to thank you all for all the info you gave me and the php.ini
> file!
> Your suggestions have been really useful and I made some progresses, but
> I've still got problems :-(
>
> I changed the MAILSERVER line to YES as you said, and now sendmail should
> start every time I reboot, but I haven't yet resolved some configurations
> problems.
>
> As you all suggested I looked again in several websites and followed many
> instructions I've finally found. However it still doesn't work :-(
>
> The last and *most important* thing left to do is to start sendmail, but I
> always get errors like:


AFAIK you don't actually need to start the sendmail (smtpd?) daemon. You just 
need the /usr/bin/sendmail (or wherever it's located) program.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Life is like an onion: you peel off layer after layer and then you find
there is nothing in it.
                -- James Huneker
*/
--- End Message ---
--- Begin Message ---
Hi people !

I have a query regarding double-byte languages on PHP. 
I need to sort a index localized from English to Korean.

My idea is:
*       get the Korean strings from file;
*       convert them to UTF8;
*       insert them in a Oracle database set to work with UTF8;
*       set "NLS_LANG" with "Alter session" SQL command to this variable
match with Korean language;
*       get the strings sorted by Oracle with a "SELECT * FROM table SORT BY
field ASC" SQL command;

I've tried to convert the Korean string to UTF8 with utf8_encode function,
but this function converted each byte from double-byte string to its
relative in UTF8 chars.
Reverting this string encoded to UTF8 with utf8_decode function, the browser
can display successfully the Korean chars (because the individual bytes of
the double-byte string will be as them were before), but Oracle can't sort
the strings properly because that UTF8 chars converted by utf8_encode
function were not relative to a double-byte char, but relative to a 2 single
bytes chars!

How can I convert a double-byte string to UTF8 properly???


Really thanks !!!!
_________________________________
Ricardo J. A. Júnior, Software Engineer Trainee
Bowne Global Solutions

Phone   +55 21 2515 7713
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>

www.bowneglobal.com.br <http://www.bowneglobal.com.br/> 

--- End Message ---
--- Begin Message ---
Hi
I need someone who can write articles about PHP for my site for free.
In exchange i'll put in each article information about author and link to his site.

Valery Vlasyuk
http://www.cgi-network.net


--- End Message ---
--- Begin Message ---
Hi there,

I'm creating a PHP extension of my own, and I'd like my extension's
module_startup_function (i.e., PHP_MINIT_FUNC) to be the last one called
among all the extensions' MINIT funcs. I'd also like my extension's
request_startup_function (PHP_RINIT_FUNC) to be the first one called among
all extension's RINIT funcs.

Is there any way that allows me to control the calling order of the
module_startup/shutdown functions and request_startup/shutdown functions of
my own extension relative to other extensions? I'm using PHP-4.1.0 on Linux.

Thanks a lot for your help.

--Charmaine Tian


--- End Message ---
--- Begin Message ---
I can't figure this one out...
I boiled it down to a test case where I have a bunch of classes and a
demo program:
demo.php:
===========================
<?
require_once "L.php";
$l = new L();

?>
===========================

L.php
===========================
<?
require_once "P.php";
require_once "C2.php";

class L extends P{
var $class = "L class";
var $c;

  function L() {
    $this->c = new C2();
    echo "L init\n";
  }
}
?>
=========================

<?
class P {

var $class = "P class";

    function P() {
        echo "P init\n";
    }

}
?>
============================


C2.php
============================
<?
class C2 extends L{

var $class = "C2 class";

    function C2(){
        echo "C2 init\n";
    }
}
?>

so I'm instantiating L,  L is a subclass of P and C2 is a subclass of L.
The contructor for L creates an instance of C2.

I just want users to have to require_once the L class file (L.php) and
not have to think about P.php or C2.php so I include them in L.php


(incase it helps, in real life P is PEAR.php, L is LDAP.php, and C2 is
Connection.php)

When I run demo.php I get 
'Fatal error: Class c2: Cannot inherit from undefined class l in C2.php
on line 2'

if I move the 'require_once "C.php";' line from L.php to demo.php I
don't get the error.

can anyone explain what is going on?


      .~.
      /v\    L   I   N   U   X
     // \\  >Phear the Penguin<
    /(   )\
     ^`~'^
If it beeps, port Linux to it.
                         -Somebody.


--- End Message ---
--- Begin Message ---
When using the mail () function to send an email to a
linux server the header information shows two from
addresses. (1)e-mail address that was defined in $from
variable in the header.  (2) [EMAIL PROTECTED] 

Can someone explain this?  I only want the $from
variable to show up in the header.  Can I do this
with the simple mail () function?  Thanks

Header info is below:

>From [EMAIL PROTECTED]  Mon Jan 14 08:33:19 2002
Return-Path: <[EMAIL PROTECTED]>
Received: from localhost.localdomain
([EMAIL PROTECTED] [204.65.32.5])
        by [EMAIL PROTECTED] (8.9.3/8.9.3) with ESMTP
id IAA12868
        for <[EMAIL PROTECTED]>; Mon, 14 Jan 2002
08:33:19 -0600
Received: from [EMAIL PROTECTED]
(IDENT:root@[EMAIL PROTECTED] [204.65
.32.11])
        by localhost.localdomain (8.12.1/8.11.2) with
ESMTP id g0EEXpOn001442
        for <[EMAIL PROTECTED]>; Mon, 14 Jan 2002
08:33:51 -0600
Received: (from nobody@localhost)
        by [EMAIL PROTECTED] (8.9.3/8.9.3) id IAA09861;
        Mon, 14 Jan 2002 08:35:08 -0600
Date: Mon, 14 Jan 2002 08:35:08 -0600
Message-Id: <200201141435.IAA09861@[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: TESTING
From: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED] 

Mail () function below:

$to = "[EMAIL PROTECTED]";
      $subj = "TESTING";
      $body="Begin101Test" .
            "\n" . $N .
            "\n" . $C .
            "\n" . $r .
            "\nEnd101";
$header="From: " . $email .
             "\r\nReply-To: [EMAIL PROTECTED]";
mail ($to, $subj, $body, $header); 

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
--- End Message ---

Reply via email to