php-general Digest 26 Oct 2007 14:12:38 -0000 Issue 5093

2007-10-26 Thread php-general-digest-help

php-general Digest 26 Oct 2007 14:12:38 - Issue 5093

Topics (messages 263681 through 263710):

Re: Slashes, include, AJAX?
263681 by: Nathan Nobbe
263686 by: Rodrigo Poblanno Balp
263706 by: Nathan Nobbe

Re: SMTP unable to relay
263682 by: Wolf

Re: SMTP
263683 by: Wolf

Re: Maximum function nesting level of '100' reached
263684 by: Larry Garfield
263698 by: Jochem Maas
263699 by: Paul Scott
263703 by: Jochem Maas
263708 by: T.Lensselink
263710 by: Jochem Maas

Re: show required row first and then other remaining rows
263685 by: Sanjeev N

returning an array from a function?
263687 by: info.phpyellow.com
263688 by: Simon Welsh

Pspell needed for Googiespell?
263689 by: Merlin
263690 by: Merlin

Fatal error when calling nested function
263691 by: Kefaleas Stavros
263692 by: Edward Kay
263693 by: Kefaleas Stavros
263694 by: Kefaleas Stavros
263695 by: Edward Kay

cant send mail
263696 by: Diana
263697 by: Stut

Question
263700 by: arash moosavi
263701 by: Dan Shirah
263702 by: Zoltán Németh

Re: Executing PHP
263704 by: Philip Thompson
263709 by: Stut

e-mail code
263705 by: arash moosavi
263707 by: Jochem Maas

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]


--
---BeginMessage---
On 10/25/07, Rodrigo Poblanno Balp [EMAIL PROTECTED] wrote:

  Nathan Nobbe wrote:

 On 10/25/07, Rodrigo Poblanno Balp [EMAIL PROTECTED] wrote:
 
  Hi everybody!
 
  I'm building a small ajax app which consists of only 3 php files.
 
  index.php which contains all the app and has a couple of links. When a
  link is clicked an Ajax request is sent to the server (using prototype)
  to the
  url central.php with only one parameter 'id'. Depending on that
  parameter, central.php should look for the appropiate content, in this
  case link1.php.
  Then I return a JSON object with the things that should be updated on
  index.php
 
  So this is the pseudo-code:
 
  index.php
  html...
  body
  a href= onclick=[send the Ajax request using prototype with the id =
  1]Link #1/a
  div id=theUpdatableDIV/div
  /body
 
 
  central.php
  html...
  body
  ?php
  [read the id parameter]
  switch(id){
  case 1: //which is the only case for now!!
 //build the JSON object
 $output = array(title = Link #1 Title!,
  content=file_get_contents(link1.php));//here I read the last file
  which has the content to be updated asynchronously
  return [the JSON object based on $output];
  break;
  }
  ?
  /body
 
  link1.php
  divWelcome to the content of link #1 which was updated using a
  href= ajax.orgajax/a/div
 
  the JSON object is formed ok, now, my problem is that link1.php outputs
  like this:
 
  divWelcome to the content of link #1 which was updated using a
  href=ajax.orgajax\/a\/div
 
  So at the moment I update the div id=theUpdatableDIV element on
  index.php, I get no real content, but a string with the
  strange slashes.
 
  I've tried:
  stripslashes, ereg_replace, str_replace and strtr to eliminate the
  wierd slashes.
 
  Can anybody tell how to do it right?


 how are you building the json object?

 i recommend
 json_encode(utf8_encode($dataToEncode));

 if youre using php5.  if youre using php4, try this:
 http://mike.teczno.com/JSON/JSON.phps

 also, you might want to check out firebug for firefox.  it will let you
 easily analyze the interaction between the client and server.

 also, to verify that the json object youre generating is infact ok;
 run it through here:
 http://www.jslint.com/

 -nathan

  Hi Nathan,

 I'm using php5, and I'm building the JSON object just like that, with the
 json_encode.
 The problem with using utf_encode apart from the original is that I get
 the \n\r for each line in the file read.
 Any suggestions?

 Thanx


are you running windows?
im guessing those are newline characters in windows format that arent
getting interpreted correctly on the
client side.  you might try stripping out the newline characters prior to
encoding the data.

$jsonOut = json_encode(utf8_encode(str_replace(\r\n, '',
$stringToEncode)));

also, what are you trying to encode?  if you are encoding arrays or objects
(php that is) you will have to
utf8_encode all the elements of those complex datums prior to handing them
to json_encode() for
the final output.

-nathan
---End Message---
---BeginMessage---

Nathan Nobbe wrote:
On 10/25/07, *Rodrigo Poblanno Balp* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


Nathan Nobbe wrote:

On 10/25/07, *Rodrigo Poblanno Balp* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:

Hi 

Re: [PHP] Slashes, include, AJAX?

2007-10-26 Thread Rodrigo Poblanno Balp

Nathan Nobbe wrote:
On 10/25/07, *Rodrigo Poblanno Balp* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


Nathan Nobbe wrote:

On 10/25/07, *Rodrigo Poblanno Balp* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:

Hi everybody!

I'm building a small ajax app which consists of only 3 php files.

index.php which contains all the app and has a couple of
links. When a
link is clicked an Ajax request is sent to the server (using
prototype)
to the
url central.php with only one parameter 'id'. Depending on that
parameter, central.php should look for the appropiate
content, in this
case link1.php.
Then I return a JSON object with the things that should be
updated on
index.php

So this is the pseudo-code:

index.php
html...
body
a href= onclick=[send the Ajax request using prototype
with the id =
1]Link #1/a
div id=theUpdatableDIV/div
/body


central.php
html...
body
?php
[read the id parameter]
switch(id){
case 1: //which is the only case for now!!
   //build the JSON object
   $output = array(title = Link #1 Title!,
content=file_get_contents(link1.php));//here I read the
last file
which has the content to be updated asynchronously
return [the JSON object based on $output];
break;
}
?
/body

link1.php
divWelcome to the content of link #1 which was updated using a
href= ajax.org http://ajax.orgajax/a/div

the JSON object is formed ok, now, my problem is that
link1.php outputs
like this:

divWelcome to the content of link #1 which was updated
using a
href=ajax.org http://ajax.orgajax\/a\/div

So at the moment I update the div id=theUpdatableDIV
element on
index.php, I get no real content, but a string with the
strange slashes.

I've tried:
stripslashes, ereg_replace, str_replace and strtr to
eliminate the
wierd slashes.

Can anybody tell how to do it right?


how are you building the json object?

i recommend
json_encode(utf8_encode($dataToEncode));

if youre using php5.  if youre using php4, try this:
http://mike.teczno.com/JSON/JSON.phps

also, you might want to check out firebug for firefox.  it will
let you
easily analyze the interaction between the client and server.

also, to verify that the json object youre generating is infact ok;
run it through here:
http://www.jslint.com/

-nathan


Hi Nathan,

I'm using php5, and I'm building the JSON object just like that,
with the json_encode.
The problem with using utf_encode apart from the original is that
I get the \n\r for each line in the file read.
Any suggestions?

Thanx


are you running windows?
im guessing those are newline characters in windows format that arent 
getting interpreted correctly on the
client side.  you might try stripping out the newline characters prior 
to encoding the data.


$jsonOut = json_encode(utf8_encode(str_replace(\r\n, '', 
$stringToEncode)));


also, what are you trying to encode?  if you are encoding arrays or 
objects (php that is) you will have to
utf8_encode all the elements of those complex datums prior to handing 
them to json_encode() for

the final output.

-nathan

Hi again Nathan,
well I actually did that before, using the str_replace to eliminate al 
the windows \r\n, but the big problem isn't that

the HTML code is being escaped too.

I get something like divthis is the content\/div
it seems like the '/' is being escaped, but I need it as HTML.

Balpo


[PHP] returning an array from a function?

2007-10-26 Thread info
Hello all,

function convert( $latitude, $longitude ) {

$mve_latitude = $latitude; // actually other processing within this function 
determines this
$mve_longitude = $longitude // actually other processing within this function 
determines this
$mve_both = $mve_latitude . ,  . $mve_longitude;
// prepare return values
$mve_array[0] = $mve_latitude;
$mve_array[1] = $mve_longitude;
$mve_array[2] = $mve_both;

return $mve_array;
} // function

$latitude = 23.263400;
$longitude = 80.110030
convert( $latitude, $longitude );

print_r( $mve_array );

.. the above does not return a value in the array. What do I have to change to 
receive an array with global scope from this function? I read several pages of 
docs on php.net but the light didn't go on...

Sincerely,
Rob.

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



Re: [PHP] returning an array from a function?

2007-10-26 Thread Simon Welsh

$mve_array = convert( $latitude, $longitude );

or, in convert(), before the first call to $mve_array:

global $mve_array;


On 26/10/2007, at 8:09, [EMAIL PROTECTED] wrote:


Hello all,

function convert( $latitude, $longitude ) {

$mve_latitude = $latitude; // actually other processing within this  
function determines this
$mve_longitude = $longitude // actually other processing within  
this function determines this

$mve_both = $mve_latitude . ,  . $mve_longitude;
// prepare return values
$mve_array[0] = $mve_latitude;
$mve_array[1] = $mve_longitude;
$mve_array[2] = $mve_both;

return $mve_array;
} // function

$latitude = 23.263400;
$longitude = 80.110030
convert( $latitude, $longitude );

print_r( $mve_array );

.. the above does not return a value in the array. What do I have  
to change to receive an array with global scope from this function?  
I read several pages of docs on php.net but the light didn't go on...


Sincerely,
Rob.

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





---
Simon Welsh
Admin of http://simon.geek.nz/

Windows is a joke operating system. Hell, it's not even an operating  
system. NT is Not Tough enough for me either. 95 is how may times it  
will crash an hour.


http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e

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



[PHP] Pspell needed for Googiespell?

2007-10-26 Thread Merlin

Hello everybody,

I am trying to get googiespell running but it looks like I
do need PHP5 installed with pspell. Am I right?
The doc's on the site are not clear about this. I am currently running
php 4.x The doc page lists GSpellerServer, but it makes the impression 
that this is optional.

http://orangoo.com/labs/GoogieSpell/Documentation/

Has anybody tested this so far?

Best regards,

Merlin

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



[PHP] Re: Pspell needed for Googiespell?

2007-10-26 Thread Merlin

Merlin schrieb:

Hello everybody,

I am trying to get googiespell running but it looks like I
do need PHP5 installed with pspell. Am I right?
The doc's on the site are not clear about this. I am currently running
php 4.x The doc page lists GSpellerServer, but it makes the impression 
that this is optional.

http://orangoo.com/labs/GoogieSpell/Documentation/

Has anybody tested this so far?

Best regards,

Merlin

Hi,

just found the problem. PHP has to be compile with ssl. I am using a 
workaround with CURL and it works now.


Best regards, Merlin

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



[PHP] Fatal error when calling nested function

2007-10-26 Thread Kefaleas Stavros

Here's the list :

?php
function salestax($price,$tax) {
function convert_pound($dollars, $conversion=1.6) {
return $dollars * $conversion;
}
$total = $price + ($price * $tax);
echo Total cost in dollars: $total. Cost in British pounds: 
.convert_pound($total);
}
echo convert_pound(15);
?

I get the following error :

*Fatal error*: Call to undefined function convert_pound() in
...*Untitled-1.php* on line *18

*line 18 is this one : echo convert_pound(15);

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



RE: [PHP] Fatal error when calling nested function

2007-10-26 Thread Edward Kay

 Here's the list :

 ?php
 function salestax($price,$tax) {
 function convert_pound($dollars, $conversion=1.6) {
 return $dollars * $conversion;
 }
 $total = $price + ($price * $tax);
 echo Total cost in dollars: $total. Cost in British pounds: 
 .convert_pound($total);
 }
 echo convert_pound(15);
 ?

 I get the following error :

 *Fatal error*: Call to undefined function convert_pound() in
 ...*Untitled-1.php* on line *18

 *line 18 is this one : echo convert_pound(15);


From
http://www.daaq.net/old/php/index.php?page=php+adv+functionsparent=php+flow
+control:

When you define a function within another function it does not exist until
the parent function is executed. Once the parent function has been executed,
the nested function is defined and as with any function, accessible from
anywhere within the current document. If you have nested functions in your
code, you can only execute the outer function once. Repeated calls will try
to redeclare the inner functions, which will generate an error.

So, as you're not calling salestax() anywhere, the convert_pound function
isn't defined.

I wasn't aware of nested functions before your question, but reading the
above on how the declaring function can only be called once, I feel they are
best avoided. Does anyone have anyone have any examples where using them
would be beneficial?

E

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



Re: [PHP] cant send mail

2007-10-26 Thread Stut

Please include the list when replying.

[EMAIL PROTECTED] wrote:
The problem is I am the mail server administrator also.  This is a small 
company of 4 .


That may be so, but this is a PHP mailing list. I don't mean to sound 
harsh, but if you need help configuring a mail server this is not the 
place to find it.


-Stut

--
http://stut.net/


- Original Message - From: Stut [EMAIL PROTECTED]
To: Diana [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Friday, October 26, 2007 1:48 AM
Subject: Re: [PHP] cant send mail



Diana wrote:
Using windows XP, when I try to send mail using 4 parameters, I get 
this :


Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 
Unable to
relay for [EMAIL PROTECTED] in 
C:\Inetpub\wwwroot\intranet\test.php

on line 9


The SMTP server you are using is not configured to allow the machine 
you're running PHP on to send mail. This is not a PHP problem - speak 
to your mail server administrator.


-Stut

--
http://stut.net/ 




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



Re: [PHP] Maximum function nesting level of '100' reached

2007-10-26 Thread Jochem Maas
Larry Garfield wrote:
 If I had to venture a guess, you nested 100 functions (called 100 functions 
 in 
 a stack), and therefore reached the maximum limit in PHP.  That is, you 
 overflowed the stack.  You may have a recursion problem, especially if you're 
 using an XML parser that is not the PHP 5-native one.

since when is there an arbitrary maximum recursion limit???

 
 On Thursday 25 October 2007, Sascha Braun wrote:
 What is the cause for that error:

 Fatal error: Maximum function nesting level of '100' reached, aborting!
 in /home/Projekte/spectral/modules/xml_mm/classes/xml_mm.class.php on
 line 118

 Thank you!

 Sascha
 
 

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



Re: [PHP] Fatal error when calling nested function

2007-10-26 Thread Kefaleas Stavros

Edward Kay wrote:

Here's the list :

?php
function salestax($price,$tax) {
function convert_pound($dollars, $conversion=1.6) {
return $dollars * $conversion;
}
$total = $price + ($price * $tax);
echo Total cost in dollars: $total. Cost in British pounds: 
.convert_pound($total);
}
echo convert_pound(15);
?

I get the following error :

*Fatal error*: Call to undefined function convert_pound() in
...*Untitled-1.php* on line *18

*line 18 is this one : echo convert_pound(15);




From
http://www.daaq.net/old/php/index.php?page=php+adv+functionsparent=php+flow
+control:

When you define a function within another function it does not exist until
the parent function is executed. Once the parent function has been executed,
the nested function is defined and as with any function, accessible from
anywhere within the current document. If you have nested functions in your
code, you can only execute the outer function once. Repeated calls will try
to redeclare the inner functions, which will generate an error.

So, as you're not calling salestax() anywhere, the convert_pound function
isn't defined.

I wasn't aware of nested functions before your question, but reading the
above on how the declaring function can only be called once, I feel they are
best avoided. Does anyone have anyone have any examples where using them
would be beneficial?

E


  

Ok.If I use the code below :

?php
function salestax($price,$tax) {
function convert_pound($dollars, $conversion=1.6) {
return $dollars * $conversion;
}
$total = $price + ($price * $tax);
echo Total cost in dollars: $total. Cost in British pounds: 
.convert_pound($total);
}
salestax(15.00,.075);
echo convert_pound(15);
?

I get no errors but I still get only the 1st line executed.

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



Re: [PHP] Fatal error when calling nested function

2007-10-26 Thread Kefaleas Stavros

Edward Kay wrote:

Here's the list :

?php
function salestax($price,$tax) {
function convert_pound($dollars, $conversion=1.6) {
return $dollars * $conversion;
}
$total = $price + ($price * $tax);
echo Total cost in dollars: $total. Cost in British pounds: 
.convert_pound($total);
}
echo convert_pound(15);
?

I get the following error :

*Fatal error*: Call to undefined function convert_pound() in
...*Untitled-1.php* on line *18

*line 18 is this one : echo convert_pound(15);




From
http://www.daaq.net/old/php/index.php?page=php+adv+functionsparent=php+flow
+control:

When you define a function within another function it does not exist until
the parent function is executed. Once the parent function has been executed,
the nested function is defined and as with any function, accessible from
anywhere within the current document. If you have nested functions in your
code, you can only execute the outer function once. Repeated calls will try
to redeclare the inner functions, which will generate an error.

So, as you're not calling salestax() anywhere, the convert_pound function
isn't defined.

I wasn't aware of nested functions before your question, but reading the
above on how the declaring function can only be called once, I feel they are
best avoided. Does anyone have anyone have any examples where using them
would be beneficial?

E


  
Ok.It was simply an oversight from my side.If I put a br / I get the 
two results clearly.Here is the clearer code :


?php
function salestax($price,$tax) {
function convert_pound($dollars, $conversion=1.6) {
return $dollars * $conversion;
}
$total = $price + ($price * $tax);
echo Total cost in dollars: $total. Cost in British pounds: 
.convert_pound($total);
}
salestax(15.00,.075);
echo br / . convert_pound(15);
?

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



RE: [PHP] Fatal error when calling nested function

2007-10-26 Thread Edward Kay

 ?php
 function salestax($price,$tax) {
 function convert_pound($dollars, $conversion=1.6) {
 return $dollars * $conversion;
 }
 $total = $price + ($price * $tax);
 echo Total cost in dollars: $total. Cost in British pounds: 
 .convert_pound($total);
 }
 salestax(15.00,.075);
 echo br / . convert_pound(15);
 ?


That's still pretty nasty though:

?php

snip

salestax(15.00,.075);
salestax(15.00,.075);
?

gives:

Total cost in dollars: 16.125. Cost in British pounds: 25.8
24
Fatal error: Cannot redeclare convert_pound() ...


What's wrong with non-nested functions? i.e.:

function convert_pound($dollars, $conversion=1.6) {
return $dollars * $conversion;
}

function salestax($price,$tax) {
$total = $price + ($price * $tax);
echo Total cost in dollars: $total. Cost in British pounds: 
.convert_pound($total);
}

E

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



[PHP] cant send mail

2007-10-26 Thread Diana

The problem is I am the mail server administrator also.  This is a small
company of 4 .


-- 
Diana Castillo
Tsanalytics S.A.
Tel: 34 913 595 436
Fax: 34 913 595 439
Mov: 34 609 954 536
[EMAIL PROTECTED]
www.tsanalytics.com 

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



Re: [PHP] Maximum function nesting level of '100' reached

2007-10-26 Thread Paul Scott

On Fri, 2007-10-26 at 12:52 +0200, Jochem Maas wrote:

 since when is there an arbitrary maximum recursion limit???

Since forever... ;)

I thought that it was at 60 though...

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Question

2007-10-26 Thread Dan Shirah
This is a PHP users mailing list.  If you have a question, you can send it
to php-general@lists.php.net and whoever can help you with it will reply.

On 10/26/07, arash moosavi [EMAIL PROTECTED] wrote:

 I have Question In PHP Where Can I send it to Give my answer?



Re: [PHP] Question

2007-10-26 Thread Zoltán Németh
2007. 10. 26, péntek keltezéssel 15.26-kor arash moosavi ezt írta:
 I have Question In PHP Where Can I send it to Give my answer?

for example to this list ;)
(it's not sure you will get the exact answer you want, but the chances
are pretty good)

greets
Zoltán Németh

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



[PHP] Question

2007-10-26 Thread arash moosavi
I have Question In PHP Where Can I send it to Give my answer?


Re: [PHP] Maximum function nesting level of '100' reached

2007-10-26 Thread Jochem Maas
Paul Scott wrote:
 On Fri, 2007-10-26 at 12:52 +0200, Jochem Maas wrote:
 
 since when is there an arbitrary maximum recursion limit???
 
 Since forever... ;)

thats you think, personally I test this kind of thing when Im
not sure:

php -r 'function foo() { static $x = 1; echo foo , $x++, \n; foo(); } 
foo();'

which proves quite adequately that there is no function recursion limit as such,
and that the error message is simply 'Segmentation Fault' as opposed to some 
message
about recursion limit being reached.

therefore the recursion limit, whether in defined in php source or in user land 
code
is something specific to the XML extension/code the OP was using.

 
 I thought that it was at 60 though...
 
 --Paul
 
 
 
 
 
 All Email originating from UWC is covered by disclaimer 
 http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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



Re: [PHP] Maximum function nesting level of '100' reached

2007-10-26 Thread T . Lensselink


On Fri, 26 Oct 2007 14:32:42 +0200, Jochem Maas [EMAIL PROTECTED]
wrote:
 Paul Scott wrote:
 On Fri, 2007-10-26 at 12:52 +0200, Jochem Maas wrote:

 since when is there an arbitrary maximum recursion limit???

 Since forever... ;)
 
 thats you think, personally I test this kind of thing when Im
 not sure:
 
 php -r 'function foo() { static $x = 1; echo foo , $x++, \n; foo(); }
 foo();'
 
 which proves quite adequately that there is no function recursion limit
as
 such,
 and that the error message is simply 'Segmentation Fault' as opposed to
 some message
 about recursion limit being reached.
 
 therefore the recursion limit, whether in defined in php source or in
user
 land code
 is something specific to the XML extension/code the OP was using.
 

 I thought that it was at 60 though...

 --Paul



 

 All Email originating from UWC is covered by disclaimer
 http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

Running your code shows that there is a limit. Although it doesn't throw an
error.
It just stops after n recursive calls:

php4 recursive calls:   796
php5 recursive calls: 49841
php6 recursive calls:  6007

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



Re: [PHP] Executing PHP

2007-10-26 Thread Stut

Philip Thompson wrote:

On 10/25/07, Stut [EMAIL PROTECTED] wrote:

Philip Thompson wrote:

Hi. Feel free to tell me this is a duh question. I don't know which

PHP

executable (php.exe, php-cgi.exe, php-win.exe) is being run - how can I
tell?

I am on a Win2k3 server running PHP5 (manual install) and IIS6. I've

pointed

to the php5isapi.dll in IIS. I'm assuming b/c I do this that I am using

the

php.exe. Thoughts? I've searched the PHP manual, but have had no luck.

You're not running any exe file. IIS uses php5isapi.dll instead of an
exe file - they essentially do the same job but the dll is designed to
be loaded into another application.

-Stut


This is wonderful to know! Is this documented in the PHP manual (if so,
where), or are you just brilliant? =D


I don't know if this is detailed in the manual - I just know a bit about 
how Windows and PHP work.


As for my brilliance, I'm not qualified to comment.

-Stut

--
http://stut.net/

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



Re: [PHP] e-mail code

2007-10-26 Thread Jochem Maas
arash moosavi wrote:
 First: how can I write php code that alert me when I have new mail?
 such as Gmail

first you read lots about php and programming, whilst your doing that
you you try out lots of code to see what it does ... eventually your
understanding gets to a level where you are capable of writing some code
to do something you want.

easy really.

this mailing list is not here to turn whatever idea you happen
to have today into working code.

 
 Second:Where can I find libgmailer sample code?

google for libgmailer

 for example reading new mail or sending mail and more..
 
 Thank You
 

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



Re: [PHP] Executing PHP

2007-10-26 Thread Philip Thompson
On 10/25/07, Stut [EMAIL PROTECTED] wrote:

 Philip Thompson wrote:
  Hi. Feel free to tell me this is a duh question. I don't know which
 PHP
  executable (php.exe, php-cgi.exe, php-win.exe) is being run - how can I
  tell?
 
  I am on a Win2k3 server running PHP5 (manual install) and IIS6. I've
 pointed
  to the php5isapi.dll in IIS. I'm assuming b/c I do this that I am using
 the
  php.exe. Thoughts? I've searched the PHP manual, but have had no luck.

 You're not running any exe file. IIS uses php5isapi.dll instead of an
 exe file - they essentially do the same job but the dll is designed to
 be loaded into another application.

 -Stut



This is wonderful to know! Is this documented in the PHP manual (if so,
where), or are you just brilliant? =D

Thanks!
~Philip


Re: [PHP] Maximum function nesting level of '100' reached

2007-10-26 Thread Jochem Maas
T.Lensselink wrote:
 
 On Fri, 26 Oct 2007 14:32:42 +0200, Jochem Maas [EMAIL PROTECTED]
 wrote:
 Paul Scott wrote:
 On Fri, 2007-10-26 at 12:52 +0200, Jochem Maas wrote:

 since when is there an arbitrary maximum recursion limit???
 Since forever... ;)
 thats you think, personally I test this kind of thing when Im
 not sure:


php -r 'function foo() { static $x = 1; echo foo , $x++, \n; foo(); } 
foo();'

...

 
 Running your code shows that there is a limit. Although it doesn't throw an
 error.
 It just stops after n recursive calls:
 
 php4 recursive calls:   796
 php5 recursive calls: 49841
 php6 recursive calls:  6007

A. this is not the output of the script

B. do you think these numbers are the same for everyone?
heck they're not even garanteed to be the same between 2 runs
on the same machine with the same php binary.

C. it doesn't just stop, a segmentation fault occurs.

e.g.:

last 2 lines of output for 4.3.10-19:

foo 11137
foo Segmentatie fout

last 2 lines of output for 4.3.10-19:

foo 11147
foo Segmentatie fout

last 2 lines of output for 5.1.1:

foo 37435
foo Segmentation fault

last 2 lines of output for 5.1.1:

foo 37436
foo Segmentation fault

last 2 lines of output for 5.1.2:

foo 30795
foo Segmentatie fout

last 2 lines of output for 5.1.2:

foo 30787
foo Segmentatie fout


Therfore there is NO recursion limit in php (not withstanding a specific limit
in functions belonging to an XML extention). the percieved limit is php running
out of memory ... as long as there is memory php will continue to recurse.

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



[PHP] e-mail code

2007-10-26 Thread arash moosavi
First: how can I write php code that alert me when I have new mail?
such as Gmail

Second:Where can I find libgmailer sample code?
for example reading new mail or sending mail and more..

Thank You


Re: [PHP] Slashes, include, AJAX?

2007-10-26 Thread Nathan Nobbe
On 10/26/07, Rodrigo Poblanno Balp [EMAIL PROTECTED] wrote:

 I get something like divthis is the content\/div
 it seems like the '/' is being escaped, but I need it as HTML.


how are you using the json object on the client-side after its sent by the
server?

below is a json snippet from an application of mine, many of the tags look
the same
as what youve shown (because theyve been encoded the same way).
 ive have not encountered the problem you have, that is, the escape
characters do
not pass though when i splice them into the DOM.
im using the same encoding technique i recommended within PHP.  on the
client side
i instantiate the json object as follows:

var htmlUpdates = eval(( + transport.responseText + ));

if you use a string directly on the client side, the escape characters will
pass
through, however, if you run it through eval(), the escape characters will
be stipped
out by the javascript interpreter.  im not sure whats going on, but im
starting to think
its something on the client side..

-nathan

{prevUpperNavId:0:0,nextUpperNavId:1:1,breadcrumb:,leftContent:p\nPHP
is very interesting

.  One of it's greatest strengths is the gradient of
development\npossibilities.  A new PHP writer can

 easily publish their first dynamic page in a matter\nof minutes.
Using PHP's integrated templating

 system, PHP scripts can be escaped at any time.\nSo escaping them
simply outputs anything text directly

 as it appears in the script.  By adding\nscript tags into large pages
of code and dropping in PHP function

 calls, dynamic pages are easily\nobtained.br\/\nbr\/\nAlthough
handy, this isnt often the greatest

 technique for developing highly reusable or readable code.\nPHP
offers many options for templating HTML

.  This is just the beginning.  As a PHP developer, you will\nfind
yourself needing to know a lot of

 technologies.\n\/p,rightContent:div\np\n\tHere is a small
list of terms and acronyms one might

 encounter working with PHP;\n\thow many do you
recognize?\n\/p\n\tul\n\t\tli\n\t\t\tObject Oriented

 Programming\n\t\t\/li\n\t\tli\n\t\t\tDesign
Patterns\n\t\t\/li\n\t\tli\n\t\t\tMVC\n\t\t\/li

\n\t\tli\n\t\t\tORM\n\t\t\/li\n\t\tli\n\t\t\tZend\n\t\t\/li\n\t\tli\n\t\t\tCMS\n\t\t\/li

\n\t\tli\n\t\t\tShared
Nothing\n\t\t\/li\n\t\tli\n\t\t\tAJAX\n\t\t\/li\n\t\tli\n\t\t\tJSON

\n\t\t\/li\n\t\tli\n\t\t\tUnit
Test\n\t\t\/li\n\t\tli\n\t\t\tSOAP\n\t\t\/li\n\t\/ul\n\/div

}


Re: [PHP] Maximum function nesting level of '100' reached

2007-10-26 Thread Eric Butera
On 10/25/07, Sascha Braun [EMAIL PROTECTED] wrote:
 What is the cause for that error:

 Fatal error: Maximum function nesting level of '100' reached, aborting!
 in /home/Projekte/spectral/modules/xml_mm/classes/xml_mm.class.php on
 line 118

 Thank you!

 Sascha

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



http://www.xdebug.org/docs/all_settings

xdebug.max_nesting_level
Type: integer, Default value: 100
Controls the protection mechanism for infinite recursion protection.
The value of this setting is the maximum level of nested functions
that are allowed before the script will be aborted.

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



Re: [PHP] Maximum function nesting level of '100' reached

2007-10-26 Thread T . Lensselink


On Fri, 26 Oct 2007 16:12:25 +0200, Jochem Maas [EMAIL PROTECTED]
wrote:
 T.Lensselink wrote:

 On Fri, 26 Oct 2007 14:32:42 +0200, Jochem Maas [EMAIL PROTECTED]
 wrote:
 Paul Scott wrote:
 On Fri, 2007-10-26 at 12:52 +0200, Jochem Maas wrote:

 since when is there an arbitrary maximum recursion limit???
 Since forever... ;)
 thats you think, personally I test this kind of thing when Im
 not sure:

 
 php -r 'function foo() { static $x = 1; echo foo , $x++, \n; foo(); }
 foo();'
 
 ...
 

 Running your code shows that there is a limit. Although it doesn't throw
 an
 error.
 It just stops after n recursive calls:

 php4 recursive calls:   796
 php5 recursive calls: 49841
 php6 recursive calls:  6007
 
 A. this is not the output of the script

That's true. i never said it was... or did i?

 
 B. do you think these numbers are the same for everyone?
 heck they're not even garanteed to be the same between 2 runs
 on the same machine with the same php binary.

No i don't think it will be the same on all systems. I also didn't say
that.
You make to much assumptions.

 
 C. it doesn't just stop, a segmentation fault occurs.

No it doesn't segfault. Well atleast it doesn't here. 
error_reporting on. Xdebug enabled... No segfaults.. It just stops after
(n) recursions.

 
 e.g.:
 
 last 2 lines of output for 4.3.10-19:
 
   foo 11137
   foo Segmentatie fout
 
 last 2 lines of output for 4.3.10-19:
 
   foo 11147
   foo Segmentatie fout
 
 last 2 lines of output for 5.1.1:
 
   foo 37435
   foo Segmentation fault
 
 last 2 lines of output for 5.1.1:
 
   foo 37436
   foo Segmentation fault
 
 last 2 lines of output for 5.1.2:
 
   foo 30795
   foo Segmentatie fout
 
 last 2 lines of output for 5.1.2:
 
   foo 30787
   foo Segmentatie fout
 
 
 Therfore there is NO recursion limit in php (not withstanding a specific
 limit
 in functions belonging to an XML extention). the percieved limit is php
 running
 out of memory ... as long as there is memory php will continue to
recurse.

I didn't say there is a recursion limit. I just confirmed the output of
running your test script.

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

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



Re: [PHP] Maximum function nesting level of '100' reached

2007-10-26 Thread Jochem Maas
T.Lensselink wrote:
 

...

 php -r 'function foo() { static $x = 1; echo foo , $x++, \n; foo(); }
 foo();'

 ...

 Running your code shows that there is a limit. Although it doesn't throw
 an
 error.
 It just stops after n recursive calls:

 php4 recursive calls:   796
 php5 recursive calls: 49841
 php6 recursive calls:  6007
 A. this is not the output of the script
 
 That's true. i never said it was... or did i?
 
 B. do you think these numbers are the same for everyone?
 heck they're not even garanteed to be the same between 2 runs
 on the same machine with the same php binary.
 
 No i don't think it will be the same on all systems. I also didn't say
 that.
 You make to much assumptions.

that should be You make too many assumptions and no that is not the case,
I was trying to point out that the number you showed us were arbitrary and
completely nonindicative (of anything).

 
 C. it doesn't just stop, a segmentation fault occurs.
 
 No it doesn't segfault. Well atleast it doesn't here. 

then you have a php binary built with customized source code I
presume.

 error_reporting on. Xdebug enabled... No segfaults.. It just stops after
 (n) recursions.

yes and display_errors is OFF - look in your php error log.

 Therfore there is NO recursion limit in php (not withstanding a specific
 limit
 in functions belonging to an XML extention). the percieved limit is php
 running
 out of memory ... as long as there is memory php will continue to
 recurse.
 
 I didn't say there is a recursion limit. I just confirmed the output of
 running your test script.

you implied that there was a limit when you said 'it just stops',
'it just stops' is not the same thing as a segmentation fault occuring.
or did you mean something like 'it just stops when you concentrate really hard
on your computer', or maybe you're implying that php has just aquired
self-awareness and is arbitrarily deciding when to put a stop to your recursion?

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

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



Re: [PHP] returning an array from a function?

2007-10-26 Thread tedd

At 12:09 AM -0700 10/26/07, [EMAIL PROTECTED] wrote:

Hello all,

function convert( $latitude, $longitude ) {

$mve_latitude = $latitude; // actually other processing within this 
function determines this
$mve_longitude = $longitude // actually other processing within this 
function determines this

$mve_both = $mve_latitude . ,  . $mve_longitude;
// prepare return values
$mve_array[0] = $mve_latitude;
$mve_array[1] = $mve_longitude;
$mve_array[2] = $mve_both;

return $mve_array;
} // function

$latitude = 23.263400;
$longitude = 80.110030
convert( $latitude, $longitude );

print_r( $mve_array );

.. the above does not return a value in the array. What do I have to 
change to receive an array with global scope from this function? I 
read several pages of docs on php.net but the light didn't go on...


Sincerely,
Rob.


Rob:

Why use a global?

Plus, your function is returning an array, but you're not catching it.

$mve_array = convert( $latitude, $longitude );

Example:

http://www.webbytedd.com/bbb/array-function/

Cheers,

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

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



Re: [PHP] Question

2007-10-26 Thread Daniel Brown
On 10/26/07, Zoltán Németh [EMAIL PROTECTED] wrote:
 2007. 10. 26, péntek keltezéssel 15.26-kor arash moosavi ezt írta:
  I have Question In PHP Where Can I send it to Give my answer?
[snip!]

http://web.ics.purdue.edu/~ssanty/cgi-bin/eightball.cgi

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Give a man a fish, he'll eat for a day.  Then you'll find out he was
allergic and is hospitalized.  See?  No good deed goes unpunished

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



Re: [PHP] Maximum function nesting level of '100' reached

2007-10-26 Thread Daniel Brown
On 10/26/07, T. Lensselink [EMAIL PROTECTED] wrote:


 On Fri, 26 Oct 2007 14:32:42 +0200, Jochem Maas [EMAIL PROTECTED]
 wrote:
  Paul Scott wrote:
  On Fri, 2007-10-26 at 12:52 +0200, Jochem Maas wrote:
 
  since when is there an arbitrary maximum recursion limit???
 
  Since forever... ;)
 
  thats you think, personally I test this kind of thing when Im
  not sure:
 
  php -r 'function foo() { static $x = 1; echo foo , $x++, \n; foo(); }
  foo();'
 
  which proves quite adequately that there is no function recursion limit
 as
  such,
  and that the error message is simply 'Segmentation Fault' as opposed to
  some message
  about recursion limit being reached.
 
  therefore the recursion limit, whether in defined in php source or in
 user
  land code
  is something specific to the XML extension/code the OP was using.
 
 
  I thought that it was at 60 though...
 
  --Paul
 
 
 
  
 
  All Email originating from UWC is covered by disclaimer
  http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php

 Running your code shows that there is a limit. Although it doesn't throw an
 error.
 It just stops after n recursive calls:

 php4 recursive calls:   796
 php5 recursive calls: 49841
 php6 recursive calls:  6007

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



I tried to play it every-which-way possible, and found that I
didn't have an error message displayed on my server, either, even with
E_ALL on.  Instead, with no stdout from PHP through Apache on
high-load runs (~30,000 recursions), it would kick out an HTTP 500
(Internal Server Error), most likely due to a segfault like Jochem
mentioned from the CLI.  Check it out for yourself, complete with
source:
http://www.pilotpig.net/code-library/recursion.php

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Give a man a fish, he'll eat for a day.  Then you'll find out he was
allergic and is hospitalized.  See?  No good deed goes unpunished

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



Re: [PHP] CURL + Frames, fopen + remote sessions

2007-10-26 Thread Jochem Maas
jenix wrote:
 Hi,
 
 When using CURL to access a page with frames I get the Your browser does
 not appear to support frames error. How can get around this? Is there
 special header info that can be added? 

try spoofing the USer Agent string - i.e. tell the server your 'Firefox' rather 
than
Curl.

 Also, if I were using fopen can
 anyone offer sample code how to login to remote site and deal with remote
 session info? Thanks!

oh no. this is exactly the kind of thing Curl is made for. the archives of this
list contain plenty about using Curl with sites that require persistent cookies 
and
authentication.

 
 Jennifer

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



Re: [PHP] CURL + Frames, fopen + remote sessions

2007-10-26 Thread Eric Butera
On 10/24/07, jenix [EMAIL PROTECTED] wrote:

 Hi,

 When using CURL to access a page with frames I get the Your browser does
 not appear to support frames error. How can get around this? Is there
 special header info that can be added? Also, if I were using fopen can
 anyone offer sample code how to login to remote site and deal with remote
 session info? Thanks!

 Jennifer
 --
 View this message in context: 
 http://www.nabble.com/CURL-%2B-Frames%2C-fopen-%2B-remote-sessions-tf4683978.html#a13384539
 Sent from the PHP - General mailing list archive at Nabble.com.

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



Hint: cookie jar

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



Re: [PHP] CURL + Frames, fopen + remote sessions

2007-10-26 Thread Robert Cummings
On Fri, 2007-10-26 at 17:43 +0200, Jochem Maas wrote:
 jenix wrote:
  Hi,
  
  When using CURL to access a page with frames I get the Your browser does
  not appear to support frames error. How can get around this? Is there
  special header info that can be added? 
 
 try spoofing the USer Agent string - i.e. tell the server your 'Firefox' 
 rather than
 Curl.
 
  Also, if I were using fopen can
  anyone offer sample code how to login to remote site and deal with remote
  session info? Thanks!
 
 oh no. this is exactly the kind of thing Curl is made for. the archives of 
 this
 list contain plenty about using Curl with sites that require persistent 
 cookies and
 authentication.

Curl sucks at groking JavaScript cookies :/ I know, I've had to parse
them out the hard way *cry*.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] unable to find running php script

2007-10-26 Thread Jochem Maas
ah yes ... Dan said it better :) but then he is a bigger nerd than me ...
he has a truck which is more dalek than pickup :-P

Daniel Brown wrote:
 On 10/26/07, Jean-Christophe Roux [EMAIL PROTECTED] wrote:
 Hello,
 I am runnign on a Centos 5.0 php 5.1.6 as Server API Apache 2.0 Handler
 I launched a script, which contains an infinite loop, from bash typing:
 php script.php

 I'd like to end that process. when typing ps -A, I don't see it. Is it
 inside the Apache server? How could I reach it? I am quite lost.
 More surprising to me is that after I rebooted the server, the script
 was still running.

 Any idea how I could kill that process?
 Thanks

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


 
 If you broke it (CTRL+C) from the command line, then it wasn't a
 process, and you successfully killed the loop.
 
 If you ran it like so:
 php script.php 
 
 Then it daemonized it, which means you should type:
 ps -ef|grep php
 
 That will give you the PID on the left, and you can then type:
 kill -9 [PID]
 
  where [PID] is the PID number you saw.
 
 Because you ran it via the CLI, at no time was Apache involved whatsoever.
 

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



Re: [PHP] unable to find running php script

2007-10-26 Thread Robert Cummings
On Fri, 2007-10-26 at 18:20 +0200, Jochem Maas wrote:
 ah yes ... Dan said it better :) but then he is a bigger nerd than me ...
 he has a truck which is more dalek than pickup :-P

*hehe* My favourite Dalek line...

Dalek: Cyrbermen are only good for one thing!

Cyberman: What is that?

Dalek: DYING!

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] Maximum function nesting level of '100' reached

2007-10-26 Thread Thijs Lensselink
Jochem Maas wrote:
 T.Lensselink wrote:
   

 ...

   
 php -r 'function foo() { static $x = 1; echo foo , $x++, \n; foo(); }
 foo();'

 ...

   
 Running your code shows that there is a limit. Although it doesn't throw
 
 an
   
 error.
 It just stops after n recursive calls:

 php4 recursive calls:   796
 php5 recursive calls: 49841
 php6 recursive calls:  6007
 
 A. this is not the output of the script
   
 That's true. i never said it was... or did i?

 
 B. do you think these numbers are the same for everyone?
 heck they're not even garanteed to be the same between 2 runs
 on the same machine with the same php binary.
   
 No i don't think it will be the same on all systems. I also didn't say
 that.
 You make to much assumptions.
 

 that should be You make too many assumptions and no that is not the case,
 I was trying to point out that the number you showed us were arbitrary and
 completely nonindicative (of anything).
   
Nonindicative? It indicates there is no segfault on my system. Or
doesn't it?
And it indicates there is some sort of a limit on the system i used.
   
 C. it doesn't just stop, a segmentation fault occurs.
   
 No it doesn't segfault. Well atleast it doesn't here. 
 

 then you have a php binary built with customized source code I
 presume.

   
I have no modified source code.
 error_reporting on. Xdebug enabled... No segfaults.. It just stops after
 (n) recursions.
 

 yes and display_errors is OFF - look in your php error log.
   
display_errors is ON what use would xdebug be without it?
Stop patronising.
   
 Therfore there is NO recursion limit in php (not withstanding a specific
 limit
 in functions belonging to an XML extention). the percieved limit is php
 running
 out of memory ... as long as there is memory php will continue to
   
 recurse.

 I didn't say there is a recursion limit. I just confirmed the output of
 running your test script.
 

 you implied that there was a limit when you said 'it just stops',
 'it just stops' is not the same thing as a segmentation fault occuring.
 or did you mean something like 'it just stops when you concentrate really hard
 on your computer', or maybe you're implying that php has just aquired
 self-awareness and is arbitrarily deciding when to put a stop to your 
 recursion?
   
You're right on this one. I wasn't very clear. I meant to say it seems
like there is a limit.
Because your script stops after (n) recursive calls. The rest of this
nonsence comment
i'm not even gonna reply to.
   
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
   


   
I thought we were here to help eachother? But the only thing that comes from
you are answers like in this thread e-mail code. Very helpfull.

It's friday. Have a beer and relax!

gr,
Thijs

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



[PHP] unable to find running php script

2007-10-26 Thread Jean-Christophe Roux

Hello,
I am runnign on a Centos 5.0 php 5.1.6 as Server API Apache 2.0 Handler
I launched a script, which contains an infinite loop, from bash typing:
php script.php

I'd like to end that process. when typing ps -A, I don't see it. Is it 
inside the Apache server? How could I reach it? I am quite lost.
More surprising to me is that after I rebooted the server, the script 
was still running.


Any idea how I could kill that process?
Thanks

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



Re: [PHP] unable to find running php script

2007-10-26 Thread Jochem Maas
Jean-Christophe Roux wrote:
 Hello,
 I am runnign on a Centos 5.0 php 5.1.6 as Server API Apache 2.0 Handler
 I launched a script, which contains an infinite loop, from bash typing:
 php script.php
 
 I'd like to end that process. when typing ps -A, 

try ps -e, or run top and look there (you can kill processes from
inside top).

 I don't see it. Is it
 inside the Apache server? 

no. it's a seperate binary in this case.

 How could I reach it? I am quite lost.
 More surprising to me is that after I rebooted the server, the script
 was still running.

unless there is a cronjob or something else that automatically runs the
script then this is not possible.

 
 Any idea how I could kill that process?

'killall php' will probably do it but I don't recommend it - it will
kill all processes running from a binary named 'php' (not your php apache
module)

 Thanks
 

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



Re: [PHP] unable to find running php script

2007-10-26 Thread Daniel Brown
On 10/26/07, Jean-Christophe Roux [EMAIL PROTECTED] wrote:
 Hello,
 I am runnign on a Centos 5.0 php 5.1.6 as Server API Apache 2.0 Handler
 I launched a script, which contains an infinite loop, from bash typing:
 php script.php

 I'd like to end that process. when typing ps -A, I don't see it. Is it
 inside the Apache server? How could I reach it? I am quite lost.
 More surprising to me is that after I rebooted the server, the script
 was still running.

 Any idea how I could kill that process?
 Thanks

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



If you broke it (CTRL+C) from the command line, then it wasn't a
process, and you successfully killed the loop.

If you ran it like so:
php script.php 

Then it daemonized it, which means you should type:
ps -ef|grep php

That will give you the PID on the left, and you can then type:
kill -9 [PID]

 where [PID] is the PID number you saw.

Because you ran it via the CLI, at no time was Apache involved whatsoever.

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Give a man a fish, he'll eat for a day.  Then you'll find out he was
allergic and is hospitalized.  See?  No good deed goes unpunished

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



Re: [PHP] unable to find running php script

2007-10-26 Thread Robert Cummings
On Fri, 2007-10-26 at 13:22 -0400, Daniel Brown wrote:
 On 10/26/07, Robert Cummings [EMAIL PROTECTED] wrote:
  On Fri, 2007-10-26 at 18:20 +0200, Jochem Maas wrote:
   ah yes ... Dan said it better :) but then he is a bigger nerd than me ...
   he has a truck which is more dalek than pickup :-P
 
  *hehe* My favourite Dalek line...
 
  Dalek: Cyrbermen are only good for one thing!
 
  Cyberman: What is that?
 
  Dalek: DYING!

What side of what pond doesn't know Doctor Who? Where have you been?
It's been on and off the telly since 1963.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] unable to find running php script

2007-10-26 Thread Daniel Brown
On 10/26/07, Robert Cummings [EMAIL PROTECTED] wrote:
 On Fri, 2007-10-26 at 18:20 +0200, Jochem Maas wrote:
  ah yes ... Dan said it better :) but then he is a bigger nerd than me ...
  he has a truck which is more dalek than pickup :-P

 *hehe* My favourite Dalek line...

 Dalek: Cyrbermen are only good for one thing!

 Cyberman: What is that?

 Dalek: DYING!

 Cheers,
 Rob.
 --
 ...
 SwarmBuy.com - http://www.swarmbuy.com

 Leveraging the buying power of the masses!
 ...


Being on this side of the pond, I had to look up a Dalek.  That
sounds like an apt description of my truck, Jo!  ;-)

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Give a man a fish, he'll eat for a day.  Then you'll find out he was
allergic and is hospitalized.  See?  No good deed goes unpunished

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



Re: [PHP] unable to find running php script

2007-10-26 Thread Daniel Brown
On 10/26/07, Robert Cummings [EMAIL PROTECTED] wrote:
 On Fri, 2007-10-26 at 13:22 -0400, Daniel Brown wrote:
  On 10/26/07, Robert Cummings [EMAIL PROTECTED] wrote:
   On Fri, 2007-10-26 at 18:20 +0200, Jochem Maas wrote:
ah yes ... Dan said it better :) but then he is a bigger nerd than me 
...
he has a truck which is more dalek than pickup :-P
  
   *hehe* My favourite Dalek line...
  
   Dalek: Cyrbermen are only good for one thing!
  
   Cyberman: What is that?
  
   Dalek: DYING!

 What side of what pond doesn't know Doctor Who? Where have you been?
 It's been on and off the telly since 1963.

 Cheers,
 Rob.
 --
 ...
 SwarmBuy.com - http://www.swarmbuy.com

 Leveraging the buying power of the masses!
 ...


I had heard of Dr. Who, but still didn't make the Dalek
connection until I looked it up.

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Give a man a fish, he'll eat for a day.  Then you'll find out he was
allergic and is hospitalized.  See?  No good deed goes unpunished

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



RE: [PHP] Executing PHP

2007-10-26 Thread Instruct ICC

Well on Mac/Unix/Linux you could type ps at the terminal to see the path to 
the running processes or which php to see which one you would invoke.

Maybe you can upgrade to a Mac?

Parallels running Windows XP didn't show me such info in the Task Manager; 
sorry.


 Date: Thu, 25 Oct 2007 15:34:20 -0500
 From: [EMAIL PROTECTED]
 To: php-general@lists.php.net
 Subject: [PHP] Executing PHP
 
 Hi. Feel free to tell me this is a duh question. I don't know which PHP
 executable (php.exe, php-cgi.exe, php-win.exe) is being run - how can I
 tell?
 
 I am on a Win2k3 server running PHP5 (manual install) and IIS6. I've pointed
 to the php5isapi.dll in IIS. I'm assuming b/c I do this that I am using the
 php.exe. Thoughts? I've searched the PHP manual, but have had no luck.
 
 Thanks in advance,
 ~Philip

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

RE: [PHP] system command

2007-10-26 Thread Instruct ICC

 Use double quotes to get the value of $a or else you get the literal string 
 $a.

 $aa=system(lynx -dump http://api.hostip.info/country.php?ip=$a,$location);
 or
 $aa=system('lynx -dump http://api.hostip.info/country.php?ip='.$a,$location);


 Thanks! 1st solution did not work for me, but the second one did.

 I still have a problem with it. It prints the info to the page. Can I
 suppress this somehow?

man lynx
?

I don't use lynx and I don't know what you mean by info to the page.
I tried
lynx -dump http://www.google.com
to try to see what you mean.

Maybe something to do with the last line (but I get several lines)
Return Values

Returns the last line of the command output on success, and FALSE on failure.

Sorry.

_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] RE: [Ticket #29] [PHP] Executing PHP

2007-10-26 Thread Instruct ICC

What the hell is this?
Is Charlie Schulz trying to get me to click on this link?

 Date: Fri, 26 Oct 2007 15:08:10 -0400
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [Ticket #29] [PHP] Executing PHP
 
 Your ticket has been submitted.  Please reply to this email (keeping the 
 subject intact) with any additional information or comments.
 
 Help Desk: 
 http://KHS2:/account/public_login/29?email=instructicc%40hotmail.com
 Ticket: # 29
 Submitted: Oct 26, 2007 at 03:08 PM
 Summary: [PHP] Executing PHP
 Status: open
 Priority: Medium
 
 Description:
 
 Well on Mac/Unix/Linux you could type ps at the terminal to see the path to 
 the running processes or which php to see which one you would invoke.
 
 Maybe you can upgrade to a Mac?
 
 Parallels running Windows XP didn't show me such info in the Task Manager; 
 sorry.
 
 
  Date: Thu, 25 Oct 2007 15:34:20 -0500
  From: [EMAIL PROTECTED]
  To: php-general@lists.php.net
  Subject: [PHP] Executing PHP
  
  Hi. Feel free to tell me this is a duh question. I don't know which PHP
  executable (php.exe, php-cgi.exe, php-win.exe) is being run - how can I
  tell?
  
  I am on a Win2k3 server running PHP5 (manual install) and IIS6. I've pointed
  to the php5isapi.dll in IIS. I'm assuming b/c I do this that I am using the
  php.exe. Thoughts? I've searched the PHP manual, but have had no luck.
  
  Thanks in advance,
  ~Philip
 
 _
 Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
 today.
 http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline
 
 This is an automated message sent from your Spiceworks Desktop.

_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct

Re: [PHP] Executing PHP

2007-10-26 Thread Philip Thompson
On 10/26/07, Instruct ICC [EMAIL PROTECTED] wrote:


 Well on Mac/Unix/Linux you could type ps at the terminal to see the path
 to the running processes or which php to see which one you would invoke.

 Maybe you can upgrade to a Mac?

 Parallels running Windows XP didn't show me such info in the Task Manager;
 sorry.



Oh I wish! I am a Mac user but my work is a Windoze shop so I don't have
much of an option. =/ Woe is me.

~Philip

PS... Anyone getting Leopard today? =D


 Date: Thu, 25 Oct 2007 15:34:20 -0500
  From: [EMAIL PROTECTED]
  To: php-general@lists.php.net
  Subject: [PHP] Executing PHP
 
  Hi. Feel free to tell me this is a duh question. I don't know which
 PHP
  executable (php.exe, php-cgi.exe, php-win.exe) is being run - how can I
  tell?
 
  I am on a Win2k3 server running PHP5 (manual install) and IIS6. I've
 pointed
  to the php5isapi.dll in IIS. I'm assuming b/c I do this that I am using
 the
  php.exe. Thoughts? I've searched the PHP manual, but have had no luck.
 
  Thanks in advance,
  ~Philip



RE: [PHP] Executing PHP

2007-10-26 Thread Instruct ICC

  Well on Mac/Unix/Linux you could type ps at the terminal to see the path
  to the running processes or which php to see which one you would invoke.
 
  Maybe you can upgrade to a Mac?
 
  Parallels running Windows XP didn't show me such info in the Task Manager;
  sorry.
 
 
 
 Oh I wish! I am a Mac user but my work is a Windoze shop so I don't have
 much of an option. =/ Woe is me.
 
 ~Philip
 
 PS... Anyone getting Leopard today? =D

Earlier this week, the upgrade was poo pd at the job, but now that the 
manager knows it is 64-bit, it's a go.

Personally, I'll wait and probably get a new mini as well.
Old mini is Core Duo and unless having it at work makes me really want to get 
it, I wasn't going to put it on my MacBook Pro yet.

_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct

Re: [PHP] RE: [Ticket #29] [PHP] Executing PHP

2007-10-26 Thread Daniel Brown
On 10/26/07, Instruct ICC [EMAIL PROTECTED] wrote:

 What the hell is this?
 Is Charlie Schulz trying to get me to click on this link?

  Date: Fri, 26 Oct 2007 15:08:10 -0400
  From: [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: [Ticket #29] [PHP] Executing PHP
 
  Your ticket has been submitted.  Please reply to this email (keeping the 
  subject intact) with any additional information or comments.
 
  Help Desk: 
  http://KHS2:/account/public_login/29?email=instructicc%40hotmail.com
  Ticket: # 29
  Submitted: Oct 26, 2007 at 03:08 PM
  Summary: [PHP] Executing PHP
  Status: open
  Priority: Medium
 
  Description:
  
  Well on Mac/Unix/Linux you could type ps at the terminal to see the path 
  to the running processes or which php to see which one you would invoke.
 
  Maybe you can upgrade to a Mac?
 
  Parallels running Windows XP didn't show me such info in the Task Manager; 
  sorry.
 
 
   Date: Thu, 25 Oct 2007 15:34:20 -0500
   From: [EMAIL PROTECTED]
   To: php-general@lists.php.net
   Subject: [PHP] Executing PHP
  
   Hi. Feel free to tell me this is a duh question. I don't know which PHP
   executable (php.exe, php-cgi.exe, php-win.exe) is being run - how can I
   tell?
  
   I am on a Win2k3 server running PHP5 (manual install) and IIS6. I've 
   pointed
   to the php5isapi.dll in IIS. I'm assuming b/c I do this that I am using 
   the
   php.exe. Thoughts? I've searched the PHP manual, but have had no luck.
  
   Thanks in advance,
   ~Philip
 
  _
  Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
  today.
  http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline
  
  This is an automated message sent from your Spiceworks Desktop.

 _
 Climb to the top of the charts! Play Star Shuffle: the word scramble 
 challenge with star power.
 http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct


I got the same thing this morning.

It's not an FQDN, so it's no real problem.  It's an internal
(intranet) site, I'm guessing, that his address pipes to the helpdesk
script, and once he notices it, he'll have a ton of bogus tickets to
clear because of the list replies.

Of course, on the flip side, tell me that wouldn't be an ideal way
of collecting email addresses for SPAM.  Simply have them go to an
email address subscribed to a high-traffic mailing list that keeps the
FROM headers intact, pipe to a script, and voila!

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Give a man a fish, he'll eat for a day.  Then you'll find out he was
allergic and is hospitalized.  See?  No good deed goes unpunished

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



Re: [PHP] Slashes, include, AJAX? {SOLVED}

2007-10-26 Thread Rodrigo Poblanno Balp

Nathan Nobbe wrote:
On 10/26/07, *Rodrigo Poblanno Balp* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


I get something like divthis is the content\/div
it seems like the '/' is being escaped, but I need it as HTML.


how are you using the json object on the client-side after its sent by 
the server?


below is a json snippet from an application of mine, many of the tags 
look the same

as what youve shown (because theyve been encoded the same way).
 ive have not encountered the problem you have, that is, the escape 
characters do

not pass though when i splice them into the DOM.
im using the same encoding technique i recommended within PHP.  on the 
client side

i instantiate the json object as follows:

var htmlUpdates = eval(( + transport.responseText + ));

if you use a string directly on the client side, the escape characters 
will pass
through, however, if you run it through eval(), the escape characters 
will be stipped
out by the javascript interpreter.  im not sure whats going on, but im 
starting to think

its something on the client side..

-nathan

{prevUpperNavId:0:0,nextUpperNavId:1:1,breadcrumb:,leftContent:p\nPHP
 is very interesting
  
.  One of it's greatest strengths is the gradient of development\npossibilities.  A new PHP writer can

 easily publish their first dynamic page in a matter\nof minutes.  Using PHP's 
integrated templating
  
 system, PHP scripts can be escaped at any time.\nSo escaping them simply outputs anything text directly

 as it appears in the script.  By adding\nscript tags into large pages of code 
and dropping in PHP function
  
 calls, dynamic pages are easily\nobtained.br\/\nbr\/\nAlthough handy, this isnt often the greatest

 technique for developing highly reusable or readable code.\nPHP offers many 
options for templating HTML
  
.  This is just the beginning.  As a PHP developer, you will\nfind yourself needing to know a lot of

 technologies.\n\/p,rightContent:div\np\n\tHere is a small list of 
terms and acronyms one might
  
 encounter working with PHP;\n\thow many do you recognize?\n\/p\n\tul\n\t\tli\n\t\t\tObject Oriented

 Programming\n\t\t\/li\n\t\tli\n\t\t\tDesign 
Patterns\n\t\t\/li\n\t\tli\n\t\t\tMVC\n\t\t\/li
  
\n\t\tli\n\t\t\tORM\n\t\t\/li\n\t\tli\n\t\t\tZend\n\t\t\/li\n\t\tli\n\t\t\tCMS\n\t\t\/li

\n\t\tli\n\t\t\tShared 
Nothing\n\t\t\/li\n\t\tli\n\t\t\tAJAX\n\t\t\/li\n\t\tli\n\t\t\tJSON
  
\n\t\t\/li\n\t\tli\n\t\t\tUnit Test\n\t\t\/li\n\t\tli\n\t\t\tSOAP\n\t\t\/li\n\t\/ul\n\/div

}

Ok Nathan,
that's correct.

Once the object is decoded the \/ pairs go away. But this is something 
to note, only after it is decoded.
I was testing only the creation of the JSON object and printing it, not 
the associative php array. So that's

why I got the annoying \/.

This is nothing to be afraid then, once the text is used, there's no 
need to think about the pairs. It is not
even necessary to eliminate the \r\n windows puts in, that way the html 
snippet will be formated.


Thank you very much for your help.

This is now solved.

Balpo.


Re: [PHP] RE: [Ticket #29] [PHP] Executing PHP

2007-10-26 Thread Jim Lucas

Daniel Brown wrote:

On 10/26/07, Instruct ICC [EMAIL PROTECTED] wrote:

What the hell is this?
Is Charlie Schulz trying to get me to click on this link?


Date: Fri, 26 Oct 2007 15:08:10 -0400
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [Ticket #29] [PHP] Executing PHP

Your ticket has been submitted.  Please reply to this email (keeping the 
subject intact) with any additional information or comments.

Help Desk: 
http://KHS2:/account/public_login/29?email=instructicc%40hotmail.com
Ticket: # 29
Submitted: Oct 26, 2007 at 03:08 PM
Summary: [PHP] Executing PHP
Status: open
Priority: Medium

Description:

Well on Mac/Unix/Linux you could type ps at the terminal to see the path to the running 
processes or which php to see which one you would invoke.

Maybe you can upgrade to a Mac?

Parallels running Windows XP didn't show me such info in the Task Manager; 
sorry.



Date: Thu, 25 Oct 2007 15:34:20 -0500
From: [EMAIL PROTECTED]
To: php-general@lists.php.net
Subject: [PHP] Executing PHP

Hi. Feel free to tell me this is a duh question. I don't know which PHP
executable (php.exe, php-cgi.exe, php-win.exe) is being run - how can I
tell?

I am on a Win2k3 server running PHP5 (manual install) and IIS6. I've pointed
to the php5isapi.dll in IIS. I'm assuming b/c I do this that I am using the
php.exe. Thoughts? I've searched the PHP manual, but have had no luck.

Thanks in advance,
~Philip

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

This is an automated message sent from your Spiceworks Desktop.

_
Climb to the top of the charts! Play Star Shuffle: the word scramble challenge 
with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct



I got the same thing this morning.

It's not an FQDN, so it's no real problem.  It's an internal
(intranet) site, I'm guessing, that his address pipes to the helpdesk
script, and once he notices it, he'll have a ton of bogus tickets to
clear because of the list replies.

Of course, on the flip side, tell me that wouldn't be an ideal way
of collecting email addresses for SPAM.  Simply have them go to an
email address subscribed to a high-traffic mailing list that keeps the
FROM headers intact, pipe to a script, and voila!


don't give out our alternate purpose of mailing lists :)

...
...

just kidding

--
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] How can I load this XML file into an array? (and. . . how do I reference the values?)

2007-10-26 Thread mike
On 10/26/07, John A DAVIS [EMAIL PROTECTED] wrote:


 I've found simple examples on the web that work a simple XML file (song,
 title, etc) but I need one that will parse an XML file into elements of an
 array. And then, I need to reference these elements to validate against a
 database. The data has to do with drinking water lab samples:

use simplexml (php.net/simplexml)

you may need to do string replacement though, replacing EN: with
EN_ or something; having : has proven to be complex for me in the
past.

$xml = file_get_contents('file.xml');
$xml = str_replace('EN:', 'EN_', $xml);
$sxml = simplexml_load_string($xml);
var_dump($sxml);

that should be enough to get you started... enjoy!

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



[PHP] How can I load this XML file into an array? (and. . . how do I reference the values?)

2007-10-26 Thread John A DAVIS


I've found simple examples on the web that work a simple XML file (song, title, etc) but I need one that will parse an XML file into elements of an array. And then, I need to reference these elements to validate against a database. The data has to do with drinking water lab samples:



- EN:Sample


- EN:SampleIdentification


 EN:StateSampleIdentifierCCHD/EN:StateSampleIdentifier 

 EN:LabSampleIdentifier01316-TC--ECZ/EN:LabSampleIdentifier 

 EN:PWSIdentifierOR0930054/EN:PWSIdentifier 

 EN:PWSFacilityIdentifierDISTRIBUTION/EN:PWSFacilityIdentifier 

 EN:SampleRuleCodeTC/EN:SampleRuleCode 

 EN:SampleMonitoringTypeCodeSP/EN:SampleMonitoringTypeCode 

 EN:SampleCollectionTypeCodeFSD/EN:SampleCollectionTypeCode 

 EN:ComplianceSampleIndicatorN/EN:ComplianceSampleIndicator 

 EN:AdditionalSampleIndicatorN/EN:AdditionalSampleIndicator 

- EN:SampleCollector


 ns1:IndividualFullNameJoe Smith/ns1:IndividualFullName 
 /EN:SampleCollector

 EN:SampleCollectionEndDate2006-02-06/EN:SampleCollectionEndDate 

 EN:SampleCollectionEndTime12:00:00/EN:SampleCollectionEndTime 

- EN:SampleVolume


 EN:MeasurementValue100/EN:MeasurementValue 

 EN:MeasurementSignificantDigit3/EN:MeasurementSignificantDigit 
 /EN:SampleVolume

- EN:SpecializedMeasurement


 EN:MeasurementValue0.2/EN:MeasurementValue 

 EN:MeasurementSignificantDigit1/EN:MeasurementSignificantDigit 

 EN:SpecializedMeasurementTypeCodeFreeChlorineResidual/EN:SpecializedMeasurementTypeCode 
 /EN:SpecializedMeasurement

- EN:SpecializedMeasurement


 EN:MeasurementValue0.2/EN:MeasurementValue 

 EN:MeasurementSignificantDigit1/EN:MeasurementSignificantDigit 

 EN:SpecializedMeasurementTypeCodeTotalChlorineResidual/EN:SpecializedMeasurementTypeCode 
 /EN:SpecializedMeasurement

- EN:SpecializedMeasurement


 EN:MeasurementValue72/EN:MeasurementValue 

 EN:MeasurementUnitF/EN:MeasurementUnit 

 EN:MeasurementSignificantDigit2/EN:MeasurementSignificantDigit 

 EN:SpecializedMeasurementTypeCodeWaterTemperature/EN:SpecializedMeasurementTypeCode 
 /EN:SpecializedMeasurement

- EN:SpecializedMeasurement


 EN:MeasurementValue2/EN:MeasurementValue 

 EN:MeasurementSignificantDigit1/EN:MeasurementSignificantDigit 

 EN:SpecializedMeasurementTypeCodeTurbidity/EN:SpecializedMeasurementTypeCode 
 /EN:SpecializedMeasurement

- EN:SpecializedMeasurement


 EN:MeasurementValue4/EN:MeasurementValue 

 EN:MeasurementSignificantDigit1/EN:MeasurementSignificantDigit 

 EN:SpecializedMeasurementTypeCodePH/EN:SpecializedMeasurementTypeCode 
 /EN:SpecializedMeasurement

- EN:SpecializedMeasurement


 EN:MeasurementValue200/EN:MeasurementValue 

 EN:MeasurementSignificantDigit3/EN:MeasurementSignificantDigit 

 EN:SpecializedMeasurementTypeCodeFlowRate/EN:SpecializedMeasurementTypeCode 
 /EN:SpecializedMeasurement

- EN:SampleComments


 EN:Comments2/9/2006/EN:Comments 
 /EN:SampleComments

 EN:StateClassificationCodeTC/EN:StateClassificationCode 
 /EN:SampleIdentification

- EN:SampleLocationIdentification


 EN:SampleLocationIdentifierRR SINK/EN:SampleLocationIdentifier 

 EN:SampleLocationNameDS/EN:SampleLocationName 
 /EN:SampleLocationIdentification
 /EN:Sample

John A. DavisProgrammerState of Oregon DHS OISCNE, MCSE

Re: [PHP] How can I load this XML file into an array? (and. . . how do I reference the values?)

2007-10-26 Thread John A DAVIS


this works:
$xml_data = file('xml_edwr2.xml');var_dump($xml_data);

I can get the var_dump to work for 1 sample, but I guess there are a many samples in one xml file which turns into something like this(so, there is no way for me to reference a "column"):

array(9780) { [0]= string(19) " " [1]= string(23) " " [2]= string(35) " " [3]= string(38) " " [4]= string(89) " 10943 " [5]= string(95) " STATE " [6]= string(39) " " [7]= string(36) " " [8]= string(24) " " [9]= string(42) " " [10]= string(78) " CCHD " [11]= string(82) " 01316-TC/ECZ " [12]= string(67) " NY0930054 " [13]= string(86) " DISTRIBUTION " [14]= string(62) " TC " [15]= string(82) " SP " [16]= string(83) " FSD " [17]= string(83) " N " [18]= string(83) " N " [19]= string(41) " " [20]= string(84) " MATT DOYLE " [21]= string(42) " " [22]= string(88) " 2006-02-06 " [23]= string(86) " 12:00:00 " [24]= string(38) " " [25]= string(71) " 100 " [26]= string(91) " 3 " [27]= string(39) " " [28]= string(48) " " [29]= string(71) " 0.2 " [30]= string(91) " 1 " [31]= string(116) " FreeChlorineResidual " [32]= string(49) " " [33]= string(48) " " [34]= string(71) " 0.2 " [35]= string(91) " 1 " [36]= string(117) " TotalChlorineResidual " [37]= string(49) " " [38]= string(48) " " [39]= string(70) " 72 " [40]= string(67) " F " [41]= string(91) " 2 " [42]= string(112) " WaterTemperature " [43]= string(49) " " [44]= string(48) " " [45]= string(69) " 2 " [46]= string(91) " 1 " [47]= string(105) " Turbidity " [48]= string(49) " " [49]= string(48) " " [50]= string(69) " 4 " [51]= string(91) " 1 " [52]= string(98) " PH " [53]= string(49) " " [54]= string(48) " " [55]= string(71) " 200 " [56]= string(91) " 3 " [57]= string(104) " FlowRate " [58]= string(49) " " [59]= string(40) " " [60]= string(60) " 2/9/2006 " [61]= string(41) " " [62]= string(80) " TC " [63]= string(43) " " [64]= string(50) " " [65]= string(87) " RR SINK " [66]= string(70) " DS " [67]= string(51) " " [68]= string(25) " " [69]= string(24) " " [70]= string(42) " " [71]= string(78) " CCHD " [72]= string(82) " 01370-TC/ECZ " [73]= string(67) " NY0930094 " [74]= string(86) " DISTRIBUTION " [75]= string(62) " TC " [76]= string(82) " SP " [77]= string(83) " N " [78]= string(83) " N " [79]= string(41) " " [80]= string(85) " LIZ TEDFORD " [81]= string(42) " " [82]= string(88) " 2006-02-07 " [83]= string(84) " BP " [84]= string(38) " " [85]= string(71) " 100 " [86]= string(91) " 3 " [87]= string(39) " " [88]= string(40) " " [89]= string(60) " 2/9/2006 " [90]= string(41) " " [91]= string(80) " TC " [92]= string(43) " " [93]= string(50) " " [94]= string(90) " COFFEE BAR " [95]= string(70) " DS " [96]= string(51) " " [97]= string(25) " " [98]= string(24) " " [99]= string(42) " " [100]= string(82) " 01596-TC/ECZ " [101]= string(67) " NY0922914 " [102]= string(77) " 137 " [103]= string(62) " TC " [104]= string(82) " RT " [105]= string(83) " Y " [106]= string(83) " N " [107]= string(41) " " [108]= string(76) " SB " [109]= string(42) " " [110]= string(88) " 2006-02-13 " [111]= string(38) " " [112]= string(71) " 100 " [113]= string(91) " 3 " [114]= string(39) " " [115]= string(40) " " [116]= string(61) " 2/21/2006 " [117]= string(41) " " [118]= string(80) " TC " [119]= string(43) " " [120]= string(50) " " [121]= string(89) " LOT 1 CWT " [122]= string(70) " DS " [123]= string(51) " " [124]= string(25) " " [125]= string(24) " " [126]= string(42) " " [127]= string(78) " CCHD " [128]= string(82) " 01604-TC/ECZ " [129]= string(67) " NY0900220 " [130]= string(77) " 140 " [131]= string(62) " TC " [132]= string(82) " SP " [133]= string(83) " N " [134]= string(83) " N " [135]= string(41) " " [136]= string(87) " TIM SIMONETTE " [137]= string(42) " " [138]= string(88) " 2006-02-13 " [139]= string(38) " " [140]= string(71) " 100 " [141]= string(91) " 3 " [142]= string(39) " " [143]= string(48) " " [144]= string(71) " 0.4 " [145]= string(91) " 1 " [146]= string(116) " FreeChlorineResidual " [147]= string(49) " " [148]= string(40) " " [149]= string(61) " 2/15/2006 " [150]= string(41) " " [151]= string(80) " TC " [152]= string(43) " " [153]= string(50) " " [154]= string(90) " 24 RAND HL " [155]= string(70) " DS " [156]= string(51) " " [157]= string(25) " " [158]= string(24) " " [159]= string(42) " " [160]= string(78) " CCHD " [161]= string(82) " 01664-TC/ECZ " [162]= string(67) " NY0922471 " [163]= string(79) " 52848 " [164]= string(62) " TC " [165]= string(82) " SP " [166]= string(83) " N " [167]= string(83) " N " [168]= string(41) " " [169]= string(84) " MATT DOYLE " [170]= string(42) " " [171]= string(88) " 2006-02-14 " [172]= string(38) " " [173]= string(71) " 100 " [174]= string(91) " 3 " [175]= string(39) " " [176]= string(48) " " [177]= string(71) " 0.4 " [178]= string(91) " 1 " [179]= string(116) " FreeChlorineResidual " [180]= string(49) " " [181]= string(40) " " [182]= string(61) " 2/16/2006 " [183]= string(41) " " [184]= string(80) " TC " [185]= string(43) " " [186]= string(50) " " [187]= string(85) " LOT 9 " [188]= 

Re: [PHP] How can I load this XML file into an array? (and. . . how do I reference the values?)

2007-10-26 Thread mike
On 10/26/07, John A DAVIS [EMAIL PROTECTED] wrote:


 this works:
 $xml_data = file('xml_edwr2.xml');
 var_dump($xml_data);

 I can get the var_dump to work for 1 sample, but I guess there are a many
 samples in one xml file which turns into something like this(so, there is no
 way for me to reference a column):


the code came out horribly in email, but you should be able to use
xpath-y type stuff to access it.

i.e.

foreach($sxml-node-childnode as $node) {
  now you are in a foreach loop on this level
}

simplexml is great for quick parsing of well-formed XML.

there's also DOM functions, PEAR libraries, and of course XSLT to try
to get the XML into an easier to use format... but I typically try to
use built in stuff when possible :)

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



Re: [PHP] How can I load this XML file into an array? (and. . . how do I reference the values?)

2007-10-26 Thread mike
On 10/26/07, John A DAVIS [EMAIL PROTECTED] wrote:


 simplexml won't work for our version of PHP. planning on upgrading once we
 get the new server

then i guess if you need it now, it's probably easiest to look for a
PEAR module.

however... gophp5.org! :)

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



Re: [PHP] How can I load this XML file into an array? (and. . . how do I reference the values?)

2007-10-26 Thread John A DAVIS


simplexml won't work for our version of PHP. planning on upgrading once we get the new server

 "mike" [EMAIL PROTECTED] 10/26/2007 4:42:09 PM 
On 10/26/07, John A DAVIS [EMAIL PROTECTED] wrote: this works: $xml_data = file('xml_edwr2.xml'); var_dump($xml_data); I can get the var_dump to work for 1 sample, but I guess there are a many samples in one xml file which turns into something like this(so, there is no way for me to reference a "column"):the code came out horribly in email, but you should be able to usexpath-y type stuff to access it.i.e.foreach($sxml-node-childnode as $node) { now you are in a foreach loop on this level}simplexml is great for quick parsing of well-formed XML.there's also DOM functions, PEAR libraries, and of course XSLT to tryto get the XML into an easier to use format... but I typically try touse built in stuff when possible :)

Re: [PHP] system command

2007-10-26 Thread Ronald Wiplinger

Instruct ICC wrote:

Use double quotes to get the value of $a or else you get the literal string 
$a.

$aa=system(lynx -dump http://api.hostip.info/country.php?ip=$a,$location);
or
$aa=system('lynx -dump http://api.hostip.info/country.php?ip='.$a,$location);


  

Thanks! 1st solution did not work for me, but the second one did.

I still have a problem with it. It prints the info to the page. Can I
suppress this somehow?



man lynx
?

I don't use lynx and I don't know what you mean by info to the page.
I tried
lynx -dump http://www.google.com
to try to see what you mean.

Maybe something to do with the last line (but I get several lines)
Return Values

Returns the last line of the command output on success, and FALSE on failure.

  


I have within a web page:
?php
$a=system('/usr/bin/lynx -dump http://api.hostip.info/country.php?ip='.$aa);
?
H1 .

later I pickup the variable $a again ...

The problem for me is that the line $a=system('/usr/bin/lynx -dump 
http://api.hostip.info/country.php?ip='.$aa);  prints (before H1) the 
result ($a). I need the variable within the program, but do not want to 
display it. It seems that 'system' includes an 'echo'


bye

Ronald

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