php-windows Digest 13 Jan 2004 07:50:51 -0000 Issue 2078
Topics (messages 22553 through 22567):
PHP hangs in Windows XP
22553 by: d_rems.yahoo.com
Windows XP hang problem
22554 by: Damjan Rems
22555 by: Mike Brum
a for-loop syntax question
22556 by: Bobo Wieland
22557 by: Svensson, B.A.T. (HKG)
22558 by: Svensson, B.A.T. (HKG)
22559 by: Svensson, B.A.T. (HKG)
22560 by: Bobo Wieland
22562 by: Svensson, B.A.T. (HKG)
22563 by: Bobo Wieland
22565 by: Svensson, B.A.T. (HKG)
Global Variables and Form Variables
22561 by: Jim MacDiarmid
22564 by: Svensson, B.A.T. (HKG)
Re: Session Variables Problem (Missing)
22566 by: Brad Lawryk
22567 by: Svensson, B.A.T. (HKG)
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 ---
Can anybody confirm this hang scenario?
Windows XP-SP1, PHP 4.3.4 or 5.0.0b3,F-Secure Antivirus 5.41
When running the simpliest script from documentation in Windows COMMAND
prompt, window hangs. Ctrl+C doesn't help. Window has to be killed.
I also found this:
F-Secure Active, PHP run from local drive (C:\PHP) - Hangs
F-Secure Active, PHP run on network (F:\PHP) - Hangs
F-Secure Disabled, PHP run from local drive (C:\PHP) - Hangs
F-Secure Disabled, PHP run on network (F:\PHP) - OK
I have no problems running on Windows 2000, with F-Secure enabled.
This realy is a bad start with PHP for me.
By
TheR
--- End Message ---
--- Begin Message ---
Can anybody confirm this bug scenario?
Windows XP-SP1, PHP 4.3.4 or 5.0.0b3,F-Secure Antivirus 5.41
When running the simpliest script from documentation in Windows COMMAND
prompt, window hangs. Ctrl+C doesn't help. Window has to be killed.
I also found this:
F-Secure Active, PHP run from local drive (C:\PHP) - Hangs
F-Secure Active, PHP run on network (F:\PHP) - Hangs
F-Secure Disabled, PHP run from local drive (C:\PHP) - Hangs
F-Secure Disabled, PHP run on network (F:\PHP) - OK
I have no problems running on Windows 2000, with F-Secure enabled.
This realy is a bad start with PHP for me.
By
TheR
--- End Message ---
--- Begin Message ---
It seems to me like you did all the testing you need to and that the problem
is F-Secure.
Why not give them a call and ask support what's going on since it's
prohibiting the execution of one of your executables?
Beyond that, I work with anti-virus software - there has to be a way to
exclude directories from their (apparent) on-access scanner. Try excluding
the c:\php folder (or wherever you installed PHP). On various platforms, AV
on-access scanning can cause various programs to have problems where you
need to exclude them from that scanning.
If F-Secure doesn't allow you to add an exclude list, then you might be SOL
- which would also indicate the quality of the product.
Regards
-M
-----Original Message-----
From: Damjan Rems [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 8:35 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Windows XP hang problem
Can anybody confirm this bug scenario?
Windows XP-SP1, PHP 4.3.4 or 5.0.0b3,F-Secure Antivirus 5.41 When running
the simpliest script from documentation in Windows COMMAND prompt, window
hangs. Ctrl+C doesn't help. Window has to be killed.
I also found this:
F-Secure Active, PHP run from local drive (C:\PHP) - Hangs F-Secure Active,
PHP run on network (F:\PHP) - Hangs
F-Secure Disabled, PHP run from local drive (C:\PHP) - Hangs F-Secure
Disabled, PHP run on network (F:\PHP) - OK
I have no problems running on Windows 2000, with F-Secure enabled.
This realy is a bad start with PHP for me.
By
TheR
--
PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi...
Is there a way to set a for loop to exit when the FIRST of many expresions evaluate to
false?
the code: for ($i = 0, $j = 0; $i < 10, $j < 5; $i++, $j++) {} will execute 10 times,
but i was hoping it would exit when $j was set to 5... Is there some way of doing this?
.bobo
--- End Message ---
--- Begin Message ---
On Mon, 2004-01-12 at 15:07, Bobo Wieland wrote:
> Hi...
>
> Is there a way to set a for loop to exit when the FIRST of many
> expresions evaluate to false?
>
> the code: for ($i = 0, $j = 0; $i < 10, $j < 5; $i++, $j++) {} will
> execute 10 times, but i was hoping it would exit when $j was set to 5...
> Is there some way of doing this?
>
>
> .bobo
Does this do what you want:
for ($i = 0, $j = 0; $j = 5, $i < 10, $j < 5; $i++, $j++)
or are you looking for something like this:
for ($i = 0, $j = 0; (!($j = 5) || $i < 10 || $j < 5); $i++, $j++)
--- End Message ---
--- Begin Message ---
On Mon, 2004-01-12 at 15:11, Svensson, B.A.T. (HKG) wrote:
> On Mon, 2004-01-12 at 15:07, Bobo Wieland wrote:
> > Hi...
> >
> > Is there a way to set a for loop to exit when the FIRST of many
> > expresions evaluate to false?
> >
> > the code: for ($i = 0, $j = 0; $i < 10, $j < 5; $i++, $j++) {} will
> > execute 10 times, but i was hoping it would exit when $j was set to 5...
> > Is there some way of doing this?
> >
> >
> > .bobo
>
>
> Does this do what you want:
>
> for ($i = 0, $j = 0; $j = 5, $i < 10, $j < 5; $i++, $j++)
>
> or are you looking for something like this:
>
> for ($i = 0, $j = 0; (!($j = 5) || $i < 10 || $j < 5); $i++, $j++)
ERRATA:
for ($i = 0, $j = 0; (!($j = 5) && $i < 10 && $j < 5); $i++, $j++)
--- End Message ---
--- Begin Message ---
> ERRATA:
>
> for ($i = 0, $j = 0; (!($j = 5) && $i < 10 && $j < 5); $i++, $j++)
ERRATA 2:
for ($i = 0, $j = 0; (!($j == 5) && ...
--- End Message ---
--- Begin Message ---
thank you!
You learn something new everyday... Didn't think you could use expressions
like that in a for-loop...
.bobo
----- Original Message -----
From: "Svensson, B.A.T. (HKG)" <[EMAIL PROTECTED]>
To: "Bobo Wieland" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, January 12, 2004 3:16 PM
Subject: Re: [PHP-WIN] a for-loop syntax question
>
> > ERRATA:
> >
> > for ($i = 0, $j = 0; (!($j = 5) && $i < 10 && $j < 5); $i++, $j++)
>
> ERRATA 2:
>
> for ($i = 0, $j = 0; (!($j == 5) && ...
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--- End Message ---
--- Begin Message ---
In C/C++ you can so I just assumed it would also be possible in php .
Try on your own risk. :)
On Mon, 2004-01-12 at 15:26, Bobo Wieland wrote:
> thank you!
>
> You learn something new everyday... Didn't think you could use expressions
> like that in a for-loop...
>
--- End Message ---
--- Begin Message ---
worked like a charm! =)
don't think it'll tell you much, but this is the acctual code i'm using now:
for ($j = 1; $j < 10 && $num_rows > 0; $num_rows -= MAXSHOWN, $j++) {}
.bobo
----- Original Message -----
From: "Svensson, B.A.T. (HKG)" <[EMAIL PROTECTED]>
To: "Bobo Wieland" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, January 12, 2004 4:08 PM
Subject: Re: [PHP-WIN] a for-loop syntax question
> In C/C++ you can so I just assumed it would also be possible in php .
>
> Try on your own risk. :)
>
> On Mon, 2004-01-12 at 15:26, Bobo Wieland wrote:
> > thank you!
> >
> > You learn something new everyday... Didn't think you could use
expressions
> > like that in a for-loop...
> >
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--- End Message ---
--- Begin Message ---
On Mon, 2004-01-12 at 16:12, Bobo Wieland wrote:
> worked like a charm! =)
>
> don't think it'll tell you much, but this is the actual code i'm using now:
>
> for ($j = 1; $j < 10 && $num_rows > 0; $num_rows -= MAXSHOWN, $j++) {}
The syntax is quite clear to me, but what about this break condition
with $j == 5 then?
--- End Message ---
--- Begin Message ---
For some reason, the first time I attempt to access a form variable or
global variable PHP does not seem to think it's defined. For each one
that shows an "undefined" error, I've had to put the following code at
the beginning of the script. Should I have to do this?
<?php
if (!isset($somevar)) {
$somevar = "";
}
?>
I have the register_globals set to true in the php.ini. and I restarted
my server.
Any ideas?
Thanks much,
Jim
--- End Message ---
--- Begin Message ---
On Mon, 2004-01-12 at 15:43, Jim MacDiarmid wrote:
> For some reason, the first time I attempt to access a form variable or
> global variable PHP does not seem to think it's defined. For each one
> that shows an "undefined" error, I've had to put the following code at
> the beginning of the script. Should I have to do this?
As far as my knowledge go - which does not go that long at all - all I
did was installing php and (POST'ed) FORM variables worked just fine
with me.
How do you try to retrieve FORM variables? Do you do something like:
$MyPostedVar = $_POST['MyPostedVar'];
--- End Message ---
--- Begin Message ---
Thanks Hubo,
When I make a page with that code ... it always says 'New Session'. No
matter what I do the 'Session Variable Saved' never shows up.
Brad
"Hubo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> The code shown below is a complete php script for you. Save these lines
into
> a file, for example, 1.php, and try to visit it from a browser.
>
> "Brad Lawryk" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:[EMAIL PROTECTED]
> > Thanks Hubo,
> >
> > Where would I nsert that coding? The coding should be fine though as the
> > page works flawlessly on a Linux Server?
> >
> > Brad
> >
> >
> > "Hubo" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > To be sure that there is no coding error, just try this simple code:
> > > '============ Begin ==============
> > > <?
> > > session_start();
> > > if (isset($_SESSION["test"])){
> > > echo $_SESSION["test"];
> > > }
> > > else {
> > > echo "new session";
> > > $_SESSION["test"]="session variable saved";
> > > }
> > > ?>
> > > '============== End ==============
> > > I have got no problem about the session variables on my W2K system
with
> > both
> > > IIS and Apache installed.
> > >
> > > By the way, since the php.ini is the same both for IIS and Apache,
both
> > > servers share the same session (and the session variables).
> > >
> > > "Brad Lawryk" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > > news:[EMAIL PROTECTED]
> > > > I am new to PHP moving over from ASP and one of things I relied on
> > heavily
> > > > was session variables. It seems that everytime a new page is opened
it
> > > > starts a new session.
> > > >
> > > > I have set up a simple test site you can see whats happening -
easier
> > than
> > > > to explain.
> > > >
> > > > http://www.cflsquad.com/index.php
> > > >
> > > > Use
> > > > Username: testuser
> > > > Password: testpassword
> > > >
> > > > the next page after log in should read "You are logged in as:
> testuser".
> > > > What tells me is that the session variable is resetting to a new on
> each
> > > > page is that the 'testuder' text doesn't show becuase the session
var
> is
> > > > being read. These exact same pages work fine oon a Linux server so I
> > know
> > > > its a Windows Server issue. The odd thing is that the session ID is
> > passed
> > > > and saved but the session variable that is created on log in is not
> > > passed.
> > > > Again, it woks just fine on a Linux server - just not Windows.
> > > >
> > > > I have changed the path in the php.ini file as many have suggested
> fixes
> > > the
> > > > problem but it hasn't made a difference for me.
> > > >
> > > > Thanks
> > > >
> > > > --
> > > > Brad Lawryk
> > > > Williams Lake TimberWolves
> > > > www.wltimberwolves.com
> > > >
> > > > --
> > > > PHP Windows Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
--- End Message ---
--- Begin Message ---
That's becasue it always create a new session.
Try (in psedo code):
IF NOT SESSION CREATED THEN
CREATE NEW SESSION
ELSE
DONT BOTHER TO CREATE NEW SESSION
END_IF
[CONTINUE DO YOUR STUFF]
-----Original Message-----
From: Brad Lawryk
To: [EMAIL PROTECTED]
Sent: 2004-01-12 22:00
Subject: [PHP-WIN] Re: Session Variables Problem (Missing)
Thanks Hubo,
When I make a page with that code ... it always says 'New Session'. No
matter what I do the 'Session Variable Saved' never shows up.
Brad
"Hubo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> The code shown below is a complete php script for you. Save these
lines
into
> a file, for example, 1.php, and try to visit it from a browser.
>
> "Brad Lawryk" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:[EMAIL PROTECTED]
> > Thanks Hubo,
> >
> > Where would I nsert that coding? The coding should be fine though as
the
> > page works flawlessly on a Linux Server?
> >
> > Brad
> >
> >
> > "Hubo" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > To be sure that there is no coding error, just try this simple
code:
> > > '============ Begin ==============
> > > <?
> > > session_start();
> > > if (isset($_SESSION["test"])){
> > > echo $_SESSION["test"];
> > > }
> > > else {
> > > echo "new session";
> > > $_SESSION["test"]="session variable saved";
> > > }
> > > ?>
> > > '============== End ==============
> > > I have got no problem about the session variables on my W2K system
with
> > both
> > > IIS and Apache installed.
> > >
> > > By the way, since the php.ini is the same both for IIS and Apache,
both
> > > servers share the same session (and the session variables).
> > >
> > > "Brad Lawryk" <[EMAIL PROTECTED]> schrieb im
Newsbeitrag
> > > news:[EMAIL PROTECTED]
> > > > I am new to PHP moving over from ASP and one of things I relied
on
> > heavily
> > > > was session variables. It seems that everytime a new page is
opened
it
> > > > starts a new session.
> > > >
> > > > I have set up a simple test site you can see whats happening -
easier
> > than
> > > > to explain.
> > > >
> > > > http://www.cflsquad.com/index.php
> > > >
> > > > Use
> > > > Username: testuser
> > > > Password: testpassword
> > > >
> > > > the next page after log in should read "You are logged in as:
> testuser".
> > > > What tells me is that the session variable is resetting to a new
on
> each
> > > > page is that the 'testuder' text doesn't show becuase the
session
var
> is
> > > > being read. These exact same pages work fine oon a Linux server
so I
> > know
> > > > its a Windows Server issue. The odd thing is that the session ID
is
> > passed
> > > > and saved but the session variable that is created on log in is
not
> > > passed.
> > > > Again, it woks just fine on a Linux server - just not Windows.
> > > >
> > > > I have changed the path in the php.ini file as many have
suggested
> fixes
> > > the
> > > > problem but it hasn't made a difference for me.
> > > >
> > > > Thanks
> > > >
> > > > --
> > > > Brad Lawryk
> > > > Williams Lake TimberWolves
> > > > www.wltimberwolves.com
> > > >
> > > > --
> > > > PHP Windows Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---