php-general Digest 29 Jul 2006 00:25:28 -0000 Issue 4263

Topics (messages 239848 through 239866):

running commands sequentially in background with  exec($commands_in_background)
        239848 by: Dasdan

APC - problems with CLI & odd return values from apc_clear_cache()
        239849 by: Jochem Maas
        239854 by: Jon Anderson

Re: compare values in 2 array
        239850 by: John Wells
        239855 by: weetat
        239858 by: weetat

Re: APC - problems with CLI ... could it be down to an install of SElinux?
        239851 by: Jochem Maas

non blocking fsockopen
        239852 by: clive

More about fpdf
        239853 by: João Cândido de Souza Neto

Postcode proximity classes
        239856 by: Dave Goodchild

mb_substr()
        239857 by: tedd

POST on redirects?
        239859 by: Tony Di Croce
        239864 by: Brady Mitchell

fopen: space character in filename
        239860 by: Christian Calloway
        239861 by: João Cândido de Souza Neto
        239862 by: Robert Cummings
        239863 by: Robert Cummings
        239865 by: Stut

include defer from cli to apache
        239866 by: Martin Marques

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 --- I want to execute a couple of linux commands from a php script 'sequentially in background'.

I want to run them in background so the php script doesn't hang while the linux commands are running.

example:


first i create a lock file with php
   $lockfile_path :  /home/web/...blablabla.../test.tar.bz2_Lock.txt

the I execute the following command from my php script:

   exec("du -a ~/ 2>&1 > /home/web/...blablabla.../backupFSlog.txt ;
   sleep 10 >/dev/null 1>/dev/null 2>/dev/null ; rm -f $lockfile_path
   >/dev/null 1>/dev/null 2>/dev/null &);

problem:
the php script hangs for 10 seconds (sleep), what is not what I want

I've read a lot of sugestions but I can't get it to work.

When I execute the commands one by one, it works in background, but when I want to run them 'sequentially in background', the php script hangs

They need to run sequentially because the $lockfile_path may only be deleted when all the other commands are executed

Some advice please?

--
http://www.dasdan.be

--- End Message ---
--- Begin Message ---
hi people,

PHP version:    5.1.1   (last built: Dec 28 2005 16:03:22)
APC version:    3.8.10
Apache version: 2.0.54  (last built: Dec 29 2005 14:04:16)
OS:             debian

I have a script that runs via the cmdline, it's used to import/update data
in a database, after the script is run the APC cache needs to be cleared so that
that the new/updated data is visible on the website. to do this I call a static
method of my cache management class which effectively performs the following:

        apc_clear_cache();
        apc_clear_cache("user");

this used to work, but now it does not (atleast not on the cmdline; calling the
above mentioned method via a webrequest still works). I have not recently 
updated
php, apc or apache, neither have made any changes to the php.ini configuration.
someone else may have updated the OS/system (and I can't rule out that .

to test the problem I ran the following code at the cmdline:

        # php -r 'var_dump( ini_get("apc.enable_cli"),
                            apc_clear_cache(),
                            apc_clear_cache("user") );'

this is the output I get:

        string(1) "1"
        NULL
        bool(true)

so apc is enabled for the cli, cache clearance seems to work but when I 
checking the output
of the apc.php file (shipped with the apc package) I see that nothing has been 
cleared; performing
the same apc_clear_cache() calls (by way of pressing the buttons on the page 
output by apc.php) via
the webserver module *does* clear the cache.

it seems all of a sudden that the CLI and then apache SAPI are looking at 
different caches -
running apc_cache_info() && apc_sma_info() on the commandline show nothing in 
the cache whereas
viewing the stats produced by apc.php (via the webserver) shows plenty of stuff 
in the cache (both
before and after running apc_cache_info() && apc_sma_info() on the commandline)

can anyone offer some help/idea/etc?


Another Thing:
===========================================================================
although the manual states that apc_clear_cache() should always return a boolean
calling it calling the function without any args *always* returns NULL. can 
anyone say whether
this is a bug or a documentation problem?


My APC ini settings (as defined in a seperate apc.ini):
===========================================================================


; Enable APC  extension module
extension                               = apc.so

[APC]
apc.enabled                             = 1
apc.shm_segments                        = 2
apc.shm_size                            = 128
apc.optimization                        = 0
apc.num_files_hint                      = 2000  ; ?
apc.ttl                                 = 180
apc.gc_ttl                              = 0
apc.slam_defense                        = 0
apc.file_update_protection              = 0     ; 1
apc.cache_by_default                    = 1
apc.enable_cli                          = 1
apc.filters                             = -.*\.class\.php

;       +\.tpl\.php,+.*\.interface\.php,+.*\.funcs\.php
;       +.*\.class\.php

;apc.max_file_size                      = 8M
apc.user_entries_hint                   = 0
apc.user_ttl                            = 0

; this fixes a bug that causes $_SERVER not to be defined on 2nd/subsequent 
requests
auto_globals_jit                        = Off

--- End Message ---
--- Begin Message --- Just replying to the list on this one 'cause I'm pretty sure you're on it. :-)

AFAIK, with many caches the web server cache and CLI caches are exclusive to each process. The APC manual seems to suggest that the CLI cache is not connected to the web server cache:

From: http://ca.php.net/manual/en/ref.apc.php

apc.enable_cli *integer* <http://ca.php.net/manual/en/language.types.integer.php>

   Mostly for testing and debugging. Setting this enables APC for the
   CLI version of PHP. Normally you wouldn't want to create, populate
   and tear down the APC cache on every CLI request, but for various
   test scenarios it is handy to be able to enable APC for the CLI
   version of APC easily.



jon

Jochem Maas wrote:
hi people,

PHP version:    5.1.1   (last built: Dec 28 2005 16:03:22)
APC version:    3.8.10
Apache version: 2.0.54  (last built: Dec 29 2005 14:04:16)
OS:             debian

I have a script that runs via the cmdline, it's used to import/update data
in a database, after the script is run the APC cache needs to be cleared so that
that the new/updated data is visible on the website. to do this I call a static
method of my cache management class which effectively performs the following:

        apc_clear_cache();
        apc_clear_cache("user");

this used to work, but now it does not (atleast not on the cmdline; calling the
above mentioned method via a webrequest still works). I have not recently 
updated
php, apc or apache, neither have made any changes to the php.ini configuration.
someone else may have updated the OS/system (and I can't rule out that .

to test the problem I ran the following code at the cmdline:

        # php -r 'var_dump( ini_get("apc.enable_cli"),
                            apc_clear_cache(),
                            apc_clear_cache("user") );'

this is the output I get:

        string(1) "1"
        NULL
        bool(true)

so apc is enabled for the cli, cache clearance seems to work but when I 
checking the output
of the apc.php file (shipped with the apc package) I see that nothing has been 
cleared; performing
the same apc_clear_cache() calls (by way of pressing the buttons on the page 
output by apc.php) via
the webserver module *does* clear the cache.

it seems all of a sudden that the CLI and then apache SAPI are looking at 
different caches -
running apc_cache_info() && apc_sma_info() on the commandline show nothing in 
the cache whereas
viewing the stats produced by apc.php (via the webserver) shows plenty of stuff 
in the cache (both
before and after running apc_cache_info() && apc_sma_info() on the commandline)

can anyone offer some help/idea/etc?


Another Thing:
===========================================================================
although the manual states that apc_clear_cache() should always return a boolean
calling it calling the function without any args *always* returns NULL. can 
anyone say whether
this is a bug or a documentation problem?


My APC ini settings (as defined in a seperate apc.ini):
===========================================================================


; Enable APC  extension module
extension                               = apc.so

[APC]
apc.enabled                             = 1
apc.shm_segments                        = 2
apc.shm_size                            = 128
apc.optimization                        = 0
apc.num_files_hint                      = 2000  ; ?
apc.ttl                                 = 180
apc.gc_ttl                              = 0
apc.slam_defense                        = 0
apc.file_update_protection              = 0     ; 1
apc.cache_by_default                    = 1
apc.enable_cli                          = 1
apc.filters                             = -.*\.class\.php

;       +\.tpl\.php,+.*\.interface\.php,+.*\.funcs\.php
;       +.*\.class\.php

;apc.max_file_size                      = 8M
apc.user_entries_hint                   = 0
apc.user_ttl                            = 0

; this fixes a bug that causes $_SERVER not to be defined on 2nd/subsequent 
requests
auto_globals_jit                        = Off


--- End Message ---
--- Begin Message ---
On 7/28/06, weetat <[EMAIL PROTECTED]> wrote:
I need to compare values in array which populated by database , below is
the code :

Without mentioning how your code performs some unnecessary actions,
and is also full of errors, here's the idea of what you want
(untested):

[code]
// assume at first they are same
$compare = true;

// compare $array1 and $array2, assuming they have same structure
foreach($array1 as $key => $val)
{
   // value doesn't match, so set $compare to false and break out of for loop
   if($array2[$key] != $val) {
       $compare = false;
       break;
   }
}

if($compare === false) {
   echo 'arrays did not match.';
}
[/code]

HTH,
John W

--- End Message ---
--- Begin Message ---
Hi John & all,


  Thanks for your info.

  I have 2 array which populated from MYSQL as shown below :
My program will update status in the temporary table according to compare of 2 arrays, for example from 2 array below:

   in $temptablearr = there 3 elements
   in $currenttablearr = there 2 elements

If value different betweeen $temptablearr and $currenttablearr , the status is change to 'update'. If value are same between $temptablearr and $currenttablearr , no action taken. If there are new elements in $temptablearr and not found in $currenttablearr, the status is change to 'new' If there are elements found in $currenttablearr and not found in $temptablearr , the status is change to 'deleted'

Anyone have any ideas or suggestion how to do this ? Thanks for your help.


$temptablearr = array(0 =>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Malaysia",
                                                                   
"card_serial_no"=>"cd-12345",
                                                                   
"card_model"=>"ws8950"),
                      1 =>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Malaysia",
                                                                   
"card_serial_no"=>"cd-890",
                                                                   
"card_model"=>"ws1234"),
                                          2 =>
                             array("chassis_serial_no"=>"8888",
                                   "country"=>"Indonesia",
                                                                   
"card_serial_no"=>"cd-12345",
                                                                   
"card_model"=>"ws999"),
                                );


$currenttablearr = array( 0 =>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Malaysia",
                                                                   
"card_serial_no"=>"cd-12345",
                                                                   
"card_model"=>"ws8950"),
                          1=>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Singapore",
                                                                   
"card_serial_no"=>"cd-890",
                                                                   
"card_model"=>"ws1234"),
                                );




  Below is my test code .

  <?php


$temptablearr = array(0 =>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Malaysia",
                                                                   
"card_serial_no"=>"cd-12345",
                                                                   
"card_model"=>"ws8950"),
                      1 =>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Malaysia",
                                                                   
"card_serial_no"=>"cd-890",
                                                                   
"card_model"=>"ws1234"),
                                          2 =>
                             array("chassis_serial_no"=>"8888",
                                   "country"=>"Indonesia",
                                                                   
"card_serial_no"=>"cd-12345",
                                                                   
"card_model"=>"ws999"),
                                );


$currenttablearr = array( 0 =>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Malaysia",
                                                                   
"card_serial_no"=>"cd-12345",
                                                                   
"card_model"=>"ws8950"),
                          1=>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Singapore",
                                                                   
"card_serial_no"=>"cd-890",
                                                                   
"card_model"=>"ws1234"),
                                );


$compare = true;

foreach($temptablearr as $key => $val)
{
   if($currenttablearr[$key] != $val) {
       $compare = false;
   }
   if($compare === false) {
     echo 'update status in table to update<br><br>';
   }else
   if($compare === true){
    echo 'skip, do not shown in page.<br><br>';
   }

}



?>


John Wells wrote:
On 7/28/06, weetat <[EMAIL PROTECTED]> wrote:

I need to compare values in array which populated by database , below is
the code :


Without mentioning how your code performs some unnecessary actions,
and is also full of errors, here's the idea of what you want
(untested):

[code]
// assume at first they are same
$compare = true;

// compare $array1 and $array2, assuming they have same structure
foreach($array1 as $key => $val)
{
// value doesn't match, so set $compare to false and break out of for loop
   if($array2[$key] != $val) {
       $compare = false;
       break;
   }
}

if($compare === false) {
   echo 'arrays did not match.';
}
[/code]

HTH,
John W

--- End Message ---
--- Begin Message ---
Hi John & all,


  Thanks for your info.

  I have 2 array which populated from MYSQL as shown below :
My program will update status in the temporary table according to compare of 2 arrays, for example from 2 array below:

   in $temptablearr = there 3 elements
   in $currenttablearr = there 2 elements

If value different betweeen $temptablearr and $currenttablearr , the status is change to 'update'. If value are same between $temptablearr and $currenttablearr , no action taken. If there are new elements in $temptablearr and not found in $currenttablearr, the status is change to 'new' If there are elements found in $currenttablearr and not found in $temptablearr , the status is change to 'deleted'

Anyone have any ideas or suggestion how to do this ? Thanks for your help.


$temptablearr = array(0 =>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Malaysia",
                                                                   
"card_serial_no"=>"cd-12345",
                                                                   
"card_model"=>"ws8950"),
                      1 =>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Malaysia",
                                                                   
"card_serial_no"=>"cd-890",
                                                                   
"card_model"=>"ws1234"),
                                          2 =>
                             array("chassis_serial_no"=>"8888",
                                   "country"=>"Indonesia",
                                                                   
"card_serial_no"=>"cd-12345",
                                                                   
"card_model"=>"ws999"),
                                );


$currenttablearr = array( 0 =>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Malaysia",
                                                                   
"card_serial_no"=>"cd-12345",
                                                                   
"card_model"=>"ws8950"),
                          1=>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Singapore",
                                                                   
"card_serial_no"=>"cd-890",
                                                                   
"card_model"=>"ws1234"),
                                );




  Below is my test code .

  <?php


$temptablearr = array(0 =>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Malaysia",
                                                                   
"card_serial_no"=>"cd-12345",
                                                                   
"card_model"=>"ws8950"),
                      1 =>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Malaysia",
                                                                   
"card_serial_no"=>"cd-890",
                                                                   
"card_model"=>"ws1234"),
                                          2 =>
                             array("chassis_serial_no"=>"8888",
                                   "country"=>"Indonesia",
                                                                   
"card_serial_no"=>"cd-12345",
                                                                   
"card_model"=>"ws999"),
                                );


$currenttablearr = array( 0 =>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Malaysia",
                                                                   
"card_serial_no"=>"cd-12345",
                                                                   
"card_model"=>"ws8950"),
                          1=>
                             array("chassis_serial_no"=>"1235",
                                   "country"=>"Singapore",
                                                                   
"card_serial_no"=>"cd-890",
                                                                   
"card_model"=>"ws1234"),
                                );


$compare = true;

foreach($temptablearr as $key => $val)
{
   if($currenttablearr[$key] != $val) {
       $compare = false;
   }
   if($compare === false) {
     echo 'update status in table to update<br><br>';
   }else
   if($compare === true){
    echo 'skip, do not shown in page.<br><br>';
   }

}



?>


John Wells wrote:
On 7/28/06, weetat <[EMAIL PROTECTED]> wrote:

I need to compare values in array which populated by database , below is
the code :


Without mentioning how your code performs some unnecessary actions,
and is also full of errors, here's the idea of what you want
(untested):

[code]
// assume at first they are same
$compare = true;

// compare $array1 and $array2, assuming they have same structure
foreach($array1 as $key => $val)
{
// value doesn't match, so set $compare to false and break out of for loop
   if($array2[$key] != $val) {
       $compare = false;
       break;
   }
}

if($compare === false) {
   echo 'arrays did not match.';
}
[/code]

HTH,
John W

--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
> hi people,
> 
> PHP version:  5.1.1   (last built: Dec 28 2005 16:03:22)
> APC version:  3.8.10
> Apache version:       2.0.54  (last built: Dec 29 2005 14:04:16)
> OS:           debian

        freudian slip; I wish it was debian, it's actually a red hat machine,
dmesg gives this about the OS:

Linux version 2.6.14-1.1653_FC4smp
([EMAIL PROTECTED])
(gcc version 4.0.2 20051125 (Red Hat 4.0.2-8))
#1 SMP Tue Dec 13 21:46:01 EST 2005

it seems that someone installed selinux stuff on the machine recently -
does anyone know what (if any) effect this might have on the shared memory
usage/functionality [especially in relation to apc]?

--- End Message ---
--- Begin Message --- I know in PHP 5 you can use stream_socket_client() and set the flag to STREAM_CLIENT_ASYNC_CONNECT|STREAM_CLIENT_CONNECT which opens the socket in a non blocking mode.

in php 4 you can use fsockopen and then set the socket to non blocking. The problem with this is that the fsockopen blocks until it creates the socket or times out.

I want to know if there is a replacement for fsockopen that attempts to open a socket, but returns immediately instead of blocking or is there another way to open a socket in a non blocking mode in PHP 4

thanks

Clive.

--- End Message ---
--- Begin Message ---
Hi everyone.

Here i am again talking about fpdf.

In the last question Peter told me that i can set a folder to write a pdf 
file by fpdf class but, to do that i ought to set permission to web user to 
write in this folder and think it´s bad to security.

I thought a lot about it and then came back here to try to explain a little 
doubt.

Could i write the pdf file into a temporary folder of php and then put it 
into the right folder by ftp?

If yes, anyone could help me about that, something like; which folder can i 
write the file?

Thanks a lot. 

--- End Message ---
--- Begin Message ---
Hi all. I am about to start writing an events listing application
(nationwide) and want users to be able for example to specify events within
a 5, 10 and 15 mile radius of their postcode. Does anyone know of a set of
classes/library that can provide this, would rather not fork out on a
bespoke piece of kit. Any suggestions appreciated!

--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk

--- End Message ---
--- Begin Message ---
Hi gang:

From another list, a person posted:

"I want to use PHP's mb_substr() function to grab the first letter of a
UTF-8 encoded word (in Czech) being pulled out of MySQL. If I use the plain substr()
the data gets garbled and I get a ? symbol in the browser.

My host says
that in order to get multibyte string functions I'd have to compile my own
copy of PHP. That's getting a little deeper than I want to for one function
on one page. Does anyone know what I could do as a workaround?"

I've tried to help, but it appears beyond me.

Anyone have any advice I could pass on?

Thanks.

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
In a couple of my scripts, I do something like the following when I detect
an improperly submitted form:

**    if( !valid_string( $_POST['firstname'] ) )
   {
     $return_url =
"https://www.abc.com/checkout_phase1.php?error=FirstName Required";
     header( "location: $return_url" );
     exit(0);
   }

Recently I changed the code so that a big variable that was being passed via
GET (IE, as a param in the URL) is instead being POST'd... (typically, via a
hidden INPUT elem in a form)...

Unfortunatley, this broke my error handling logic... Is it possible to add
POST variables to a redirect? How?

--
Free Linux Technical Articles
http://www.linuxtecharticles.com

--- End Message ---
--- Begin Message ---
Use sessions.  Store the variables you need in the session, then
redirect.  After redirect get the values you need from the session.

http://us3.php.net/manual/en/ref.session.php

Brady


> -----Original Message-----
> From: Tony Di Croce [mailto:[EMAIL PROTECTED] 
> Sent: Friday, July 28, 2006 2:56 PM
> To: [email protected]
> Subject: [PHP] POST on redirects?
> 
> In a couple of my scripts, I do something like the following 
> when I detect
> an improperly submitted form:
> 
> **    if( !valid_string( $_POST['firstname'] ) )
>     {
>       $return_url =
> "https://www.abc.com/checkout_phase1.php?error=FirstName Required";
>       header( "location: $return_url" );
>       exit(0);
>     }
> 
> Recently I changed the code so that a big variable that was 
> being passed via
> GET (IE, as a param in the URL) is instead being POST'd... 
> (typically, via a
> hidden INPUT elem in a form)...
> 
> Unfortunatley, this broke my error handling logic... Is it 
> possible to add
> POST variables to a redirect? How?
> 
> -- 
> Free Linux Technical Articles
> http://www.linuxtecharticles.com
> 

--- End Message ---
--- Begin Message ---
Hello all,

this seems like an easy question, but I could sure as hell couldn't find any 
responces to it through initial searched. I am running php on an XP system 
and I need to open a file contained with a set of directories which may or 
may not have a space character; so for example:

fopen ("X:\Dont Talk\About\My Momma\please.txt", "x");

I tried using \ characters, no luck (even attempted to cancel out the 
backspace characters ala \\ and http space code %20, and still nothing.) Any 
ideas? 

--- End Message ---
--- Begin Message ---
Did you read this?

http://br.php.net/manual/en/function.fopen.php

""Christian Calloway"" <[EMAIL PROTECTED]> escreveu na mensagem 
news:[EMAIL PROTECTED]
> Hello all,
>
> this seems like an easy question, but I could sure as hell couldn't find 
> any responces to it through initial searched. I am running php on an XP 
> system and I need to open a file contained with a set of directories which 
> may or may not have a space character; so for example:
>
> fopen ("X:\Dont Talk\About\My Momma\please.txt", "x");
>
> I tried using \ characters, no luck (even attempted to cancel out the 
> backspace characters ala \\ and http space code %20, and still nothing.) 
> Any ideas? 

--- End Message ---
--- Begin Message ---
On Fri, 2006-07-28 at 16:55, Christian Calloway wrote:
> Hello all,
> 
> this seems like an easy question, but I could sure as hell couldn't find any 
> responces to it through initial searched. I am running php on an XP system 
> and I need to open a file contained with a set of directories which may or 
> may not have a space character; so for example:
> 
> fopen ("X:\Dont Talk\About\My Momma\please.txt", "x");
> 
> I tried using \ characters, no luck (even attempted to cancel out the 
> backspace characters ala \\ and http space code %20, and still nothing.) Any 
> ideas? 

RTFM -- you need to double backslash when using double quotes. Otherwise
use single quotes.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
On Fri, 2006-07-28 at 17:27, Robert Cummings wrote:
> On Fri, 2006-07-28 at 16:55, Christian Calloway wrote:
> > Hello all,
> > 
> > this seems like an easy question, but I could sure as hell couldn't find 
> > any 
> > responces to it through initial searched. I am running php on an XP system 
> > and I need to open a file contained with a set of directories which may or 
> > may not have a space character; so for example:
> > 
> > fopen ("X:\Dont Talk\About\My Momma\please.txt", "x");
> > 
> > I tried using \ characters, no luck (even attempted to cancel out the 
> > backspace characters ala \\ and http space code %20, and still nothing.) 
> > Any 
> > ideas? 
> 
> RTFM -- you need to double backslash when using double quotes. Otherwise
> use single quotes.

And after writing that I re-read and realized you did *hah*. Make sure
the file exists on the hard drive where you think it does. Also make
sure you have read permissions. And hwile you're at it, make sure you
have error reporting enabled so you can see any "special" errors that
might be issued for various violations.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Christian Calloway wrote:
> this seems like an easy question, but I could sure as hell couldn't find any 
> responces to it through initial searched. I am running php on an XP system 
> and I need to open a file contained with a set of directories which may or 
> may not have a space character; so for example:
> 
> fopen ("X:\Dont Talk\About\My Momma\please.txt", "x");
> 
> I tried using \ characters, no luck (even attempted to cancel out the 
> backspace characters ala \\ and http space code %20, and still nothing.) Any 
> ideas? 

Spaces aren't your problem here, the \'s are. You need to escape them...

fopen ("X:\\Dont Talk\\About\\My Momma\\please.txt", "x");

-Stut

--- End Message ---
--- Begin Message ---
I' trying to include files from a script which will be executed from CLI via 
cron.

Now, if I execute the script from the command line it works OK, but when it's 
executed via cron I fails to include a file, which is being included via and 
include from the script. It looks like when including a file directories are 
changes, and so the new include doesn't work as it's referencing from a 
different directory.

Is there something I should be aware of?

--
---------------------------------------------------------
Lic. Martín Marqués         |   SELECT 'mmarques' || 
Centro de Telemática        |       '@' || 'unl.edu.ar';
Universidad Nacional        |   DBA, Programador, 
    del Litoral             |   Administrador
---------------------------------------------------------

--- End Message ---

Reply via email to