php-windows Digest 4 Jan 2006 20:26:21 -0000 Issue 2862
Topics (messages 26603 through 26613):
php called from cmd or browser? pros and cons?
26603 by: vauneen
26605 by: vauneen
26606 by: Sascha Meyer
phpinfo() acting strange
26604 by: olivier.maurice.skynet.be
26608 by: El Bekko
If code not working?
26607 by: Christopher Malton
26609 by: El Bekko
26610 by: Jay Blanchard
26611 by: Jay Blanchard
26612 by: Sean Rowe
26613 by: Paul Menard
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 ---
hi all,
i've recently discovered how you can call a php script from the cmd line on
a windows box and the system i'm building needs to do quite a bit of
'maintenance' stuff like watching a directory for activity, ftp-ing,
archiving etc. i was wondering if anyone has any opinions on what would be
better and why:
running a 'perpetual' php script via the cmd line or opening a browser
window and running the script through there?
any input appreciated,
vauneen
--- End Message ---
--- Begin Message ---
hi all,
i've recently discovered how you can call a php script from the cmd line on
a windows box and the system i'm building needs to do quite a bit of
'maintenance' stuff like watching a directory for activity, ftp-ing,
archiving etc. i was wondering if anyone has any opinions on what would be
better and why:
running a 'perpetual' php script via the cmd line or opening a browser
window and running the script through there?
any input appreciated,
vauneen
--- End Message ---
--- Begin Message ---
Good morning,
I use several php scripts run via console and these work like a charm! It's
comparable to running vbs scripts but with a lot more available functions
(like mailing, ftp-ing, ...); i'd definitely recommend the usage!
One of my favorites: get the contents of a ftp directory, log the files to a
database and copy them to another remote machine; afterwards send an email
with a list of files to a defined user list - that would've been pretty
complex in vbs!
HTH, Sascha
--
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner
--- End Message ---
--- Begin Message ---
Hi,
I just finished an Apache 2.0.55, MySQL 4.1.16 and PHP 5.1.1 on a Windows XP
SP 1 machine.
Diving into the first documentation on PHP one the first examples is the use of
the phpinfo() method.
So I create index.php with the following content and put it in the htdocs
directory.
<?php phpinfo(); ?>
This works, most of the time. When going to the page (Firefox in my case), most
of the time only a part of the page is shown, different each time. I can't find
anything unusual in the apache logs.
Anyone an idea?
Regards,
Olivier
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
Hi,
I just finished an Apache 2.0.55, MySQL 4.1.16 and PHP 5.1.1 on a Windows XP
SP 1 machine.
Diving into the first documentation on PHP one the first examples is the use of
the phpinfo() method.
So I create index.php with the following content and put it in the htdocs
directory.
<?php phpinfo(); ?>
This works, most of the time. When going to the page (Firefox in my case), most
of the time only a part of the page is shown, different each time. I can't find
anything unusual in the apache logs.
Anyone an idea?
Regards,
Olivier
Works fine for me... I have the same Apache, MySQL 5.0, PHP 5.0.1 and
WinXP SP2 installed... Try the other info functions ;)
--- End Message ---
--- Begin Message ---
To all,
I appear to have a problem with my If statement. No error is
presented to me, but does anyone see what is wrong. IP addresses masked
for safety & security.
Code as follows:
<?php
if(
($_SERVER["REMOTE_ADDR"]=="x.x.x.x")||
($_SERVER["REMOTE_ADDR"]=="y.y.y.y")||
0
){
header("Location: /access_disabled.php");
exit();
}
?>
Chris
--- End Message ---
--- Begin Message ---
Christopher Malton wrote:
To all,
I appear to have a problem with my If statement. No error is
presented to me, but does anyone see what is wrong. IP addresses masked
for safety & security.
Code as follows:
<?php
if(
($_SERVER["REMOTE_ADDR"]=="x.x.x.x")||
($_SERVER["REMOTE_ADDR"]=="y.y.y.y")||
0
){
header("Location: /access_disabled.php");
exit();
}
?>
Chris
Ehm... It should work. I've rewritten it a tad:
<?php
if($_SERVER["REMOTE_ADDR"]=="x.x.x.x" ||
$_SERVER["REMOTE_ADDR"]=="y.y.y.y" || 0)
{
header("Location: /access_disabled.php");
exit();
}
?>
--- End Message ---
--- Begin Message ---
[snip]
I appear to have a problem with my If statement. No error is
presented to me, but does anyone see what is wrong. IP addresses masked
for safety & security.
Code as follows:
<?php
if(($_SERVER["REMOTE_ADDR"]=="x.x.x.x")||($_SERVER["REMOTE_ADDR"]=="y.y.y.y"
)||0){
header("Location: /access_disabled.php");
exit();
}
?>
[/snip]
echo $_SERVER["REMOTE_ADDR"] and see what is there. I would also add
parentheses to the statement, surrounding only the IP tests;
if((($_SERVER["REMOTE_ADDR"]=="x.x.x.x")||($_SERVER["REMOTE_ADDR"]=="y.y.y.y
"))||0){
saying "if (remote address OR remore address) OR false
--- End Message ---
--- Begin Message ---
[snip]
if((($_SERVER["REMOTE_ADDR"]=="x.x.x.x")||($_SERVER["REMOTE_ADDR"]=="y.y.y.y
"))||0){
saying "if (remote address OR remore address) OR false
[/snip]
Now, having said that I think I see the problem.
if(FALSE){
do something;
}
What is being tested for?
--- End Message ---
--- Begin Message ---
Just curious as to why the 0 is at the end of the 'if' statement? 0 is
never true, so I guess I don't see the point?
-----Original Message-----
From: El Bekko [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 04, 2006 12:21 PM
To: [email protected]
Subject: [PHP-WIN] Re: If code not working?
Christopher Malton wrote:
> To all,
> I appear to have a problem with my If statement. No error is
> presented to me, but does anyone see what is wrong. IP addresses masked
> for safety & security.
>
>
> Code as follows:
> <?php
> if(
> ($_SERVER["REMOTE_ADDR"]=="x.x.x.x")||
> ($_SERVER["REMOTE_ADDR"]=="y.y.y.y")||
> 0
> ){
> header("Location: /access_disabled.php");
> exit();
> }
> ?>
>
> Chris
Ehm... It should work. I've rewritten it a tad:
<?php
if($_SERVER["REMOTE_ADDR"]=="x.x.x.x" ||
$_SERVER["REMOTE_ADDR"]=="y.y.y.y" || 0)
{
header("Location: /access_disabled.php");
exit();
}
?>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Um. What is the '0' for?
if(
($_SERVER["REMOTE_ADDR"]=="x.x.x.x")||
($_SERVER["REMOTE_ADDR"]=="y.y.y.y")||
0 <-- This should not be here.
)
----- Original Message ----
From: Christopher Malton <[EMAIL PROTECTED]>
To: [email protected]
Sent: Wednesday, January 04, 2006 13:00:24
Subject: [PHP-WIN] If code not working?
To all,
I appear to have a problem with my If statement. No error is
presented to me, but does anyone see what is wrong. IP addresses masked
for safety & security.
Code as follows:
<?php
if(
($_SERVER["REMOTE_ADDR"]=="x.x.x.x")||
($_SERVER["REMOTE_ADDR"]=="y.y.y.y")||
0
){
header("Location: /access_disabled.php");
exit();
}
?>
Chris
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---