php-general Digest 23 Oct 2010 05:50:06 -0000 Issue 7002

Topics (messages 309015 through 309035):

Re: Reminder On Mailing List Rules
        309015 by: Jay Blanchard
        309016 by: Bastien Koert

Re: Entity 'reg' not defined
        309017 by: Adam Richardson
        309018 by: Ashley Sheridan
        309019 by: TR Shaw
        309020 by: Richard Quadling
        309021 by: Bastien Koert

Printing....
        309022 by: Steve Staples
        309023 by: Daniel P. Brown

php imap_search fails for subject strings which have apostrophe
        309024 by: nitesh nandy
        309025 by: Govinda
        309033 by: nitesh nandy

Is there a way to write to the php error log from a php script?
        309026 by: Tamara Temple
        309027 by: Daniel P. Brown
        309028 by: Tamara Temple
        309031 by: Tommy Pham
        309032 by: vikash.iitb.gmail.com

Re: Independent Contractor Suggestions
        309029 by: Kris Craig
        309030 by: musicdev.gmail.com

a loop constructing the URLs and  make PHP to fetch up to 10 thousand pages
        309034 by: jobst_m=C3=BCller

Re: Possible foreach bug; seeking advice to isolate the problem
        309035 by: Jonathan Sachs

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
[snip]
I read some place that the first one to mention Nazi's lose the
argument.
[/snip]

Nah, it is just proof of, as mentioned before, Godwin's Law
(http://en.wikipedia.org/wiki/Godwin%27s_law) 

--- End Message ---
--- Begin Message ---
On Fri, Oct 22, 2010 at 12:46 PM, Jay Blanchard <jblanch...@pocket.com> wrote:
> [snip]
> I read some place that the first one to mention Nazi's lose the
> argument.
> [/snip]
>
> Nah, it is just proof of, as mentioned before, Godwin's Law
> (http://en.wikipedia.org/wiki/Godwin%27s_law)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Watch our previous prime minister explain proof

http://www.youtube.com/watch?v=aX6XMIldkRU&feature=related

-- 

Bastien

Cat, the other other white meat

--- End Message ---
--- Begin Message ---
On Fri, Oct 22, 2010 at 1:19 PM, TR Shaw <ts...@oitc.com> wrote:

>
> On Oct 22, 2010, at 12:03 PM, Adam Richardson wrote:
>
> > On Fri, Oct 22, 2010 at 11:47 AM, TR Shaw <ts...@oitc.com> wrote:
> >
> >> Anyone have an idea how to work around this? I tried:
> >>
> >> define ('reg', '®');
> >> define ('&reg;', '®');
> >>
> >> can't figure how to override the entity table.  Errors follw:
> >>
> >> Warning: simplexml_load_string():
> >>
> o.cc/46/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&amp;sub_id=61862469&reg
> ;
> >> in checkifup.php on line 5119
> >>
> >> Warning: simplexml_load_string():
> >>                                     ^ in checkifup.php on line 5119
> >>
> >> Warning: simplexml_load_string(): Entity: line 220: parser error :
> Entity
> >> 'reg' not defined in checkifup.php on line 5119
> >>
> >> Warning: simplexml_load_string():
> >>
> /office/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&amp;sub_id=89877485&reg;
> >> in checkifup.php on line 5119
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> > Does doing a str_replace and changing it to the corresponding entity
> number
> > (&#174;) before parsing with simple_xml work?
> >
> > Here's a more robust function:
> >
> http://www.sourcerally.net/Scripts/39-Convert-HTML-Entities-to-XML-Entities
> >
>
> Thanks Adam I know I can read and deal with it befor passing to the parser
> but I thought that was klugie unless that's the only workaround I can find.
>
> Tom
>
>
>
XML only has 5 pre-defined entity references:
http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

Although you can entities via a DTD, SimpleXML is not DTD aware, so this
won't work.  That's why you'll have to use the numeric character reference.

Sorry,

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com

--- End Message ---
--- Begin Message ---
On Fri, 2010-10-22 at 12:03 -0400, Adam Richardson wrote:

> On Fri, Oct 22, 2010 at 11:47 AM, TR Shaw <ts...@oitc.com> wrote:
> 
> > Anyone have an idea how to work around this? I tried:
> >
> > define ('reg', '®');
> > define ('&reg;', '®');
> >
> > can't figure how to override the entity table.  Errors follw:
> >
> > Warning: simplexml_load_string():
> > o.cc/46/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&amp;sub_id=61862469&reg;
> > in checkifup.php on line 5119
> >
> > Warning: simplexml_load_string():
> >                                      ^ in checkifup.php on line 5119
> >
> > Warning: simplexml_load_string(): Entity: line 220: parser error : Entity
> > 'reg' not defined in checkifup.php on line 5119
> >
> > Warning: simplexml_load_string():
> > /office/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&amp;sub_id=89877485&reg;
> > in checkifup.php on line 5119
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> Does doing a str_replace and changing it to the corresponding entity number
> (&#174;) before parsing with simple_xml work?
> 
> Here's a more robust function:
> http://www.sourcerally.net/Scripts/39-Convert-HTML-Entities-to-XML-Entities
> 
> Adam
> 



This isn't a PHP error, it's an error with your XML. The regular HTML
entities which you're used to such as &reg; and &copy; are not
recognised in XML without first being declared as entities. The entities
exist in HTML because just outputting those characters won't always work
in a web browser (*Internet Explorer* *cough* *cough*) whereas XML was
never meant to be displayed in a browser, but transformed and then
output to a browser (among many other things) through XSLT. If you use
the characters directly in your XML you should be fine with the parser,
although you may have to make sure your document is saved in utf-8, as
most of the entity characters are above the ascii range.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On Oct 22, 2010, at 1:56 PM, Ashley Sheridan wrote:

> On Fri, 2010-10-22 at 12:03 -0400, Adam Richardson wrote:
> 
>> On Fri, Oct 22, 2010 at 11:47 AM, TR Shaw <ts...@oitc.com> wrote:
>> 
>>> Anyone have an idea how to work around this? I tried:
>>> 
>>> define ('reg', '®');
>>> define ('&reg;', '®');
>>> 
>>> can't figure how to override the entity table.  Errors follw:
>>> 
>>> Warning: simplexml_load_string():
>>> o.cc/46/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&amp;sub_id=61862469&reg;
>>> in checkifup.php on line 5119
>>> 
>>> Warning: simplexml_load_string():
>>>                                     ^ in checkifup.php on line 5119
>>> 
>>> Warning: simplexml_load_string(): Entity: line 220: parser error : Entity
>>> 'reg' not defined in checkifup.php on line 5119
>>> 
>>> Warning: simplexml_load_string():
>>> /office/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&amp;sub_id=89877485&reg;
>>> in checkifup.php on line 5119
>>> 
>>> 
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>> 
>>> 
>> Does doing a str_replace and changing it to the corresponding entity number
>> (&#174;) before parsing with simple_xml work?
>> 
>> Here's a more robust function:
>> http://www.sourcerally.net/Scripts/39-Convert-HTML-Entities-to-XML-Entities
>> 
>> Adam
>> 
> 
> 
> 
> This isn't a PHP error, it's an error with your XML. The regular HTML
> entities which you're used to such as &reg; and &copy; are not
> recognised in XML without first being declared as entities. The entities
> exist in HTML because just outputting those characters won't always work
> in a web browser (*Internet Explorer* *cough* *cough*) whereas XML was
> never meant to be displayed in a browser, but transformed and then
> output to a browser (among many other things) through XSLT. If you use
> the characters directly in your XML you should be fine with the parser,
> although you may have to make sure your document is saved in utf-8, as
> most of the entity characters are above the ascii range.
> 

Ash

Its not my XML (&reg; isn't a www standard anyway) but its the xml provided by 
the source I have to deal with and I can't change them so I guess I'll just 
read the xml and then run defensing string replacements.

Thanks for everyone's help.

Tom



--- End Message ---
--- Begin Message ---
On 22 October 2010 19:01, TR Shaw <ts...@oitc.com> wrote:
>
> On Oct 22, 2010, at 1:56 PM, Ashley Sheridan wrote:
>
>> On Fri, 2010-10-22 at 12:03 -0400, Adam Richardson wrote:
>>
>>> On Fri, Oct 22, 2010 at 11:47 AM, TR Shaw <ts...@oitc.com> wrote:
>>>
>>>> Anyone have an idea how to work around this? I tried:
>>>>
>>>> define ('reg', '®');
>>>> define ('&reg;', '®');
>>>>
>>>> can't figure how to override the entity table.  Errors follw:
>>>>
>>>> Warning: simplexml_load_string():
>>>> o.cc/46/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&amp;sub_id=61862469&reg;
>>>> in checkifup.php on line 5119
>>>>
>>>> Warning: simplexml_load_string():
>>>>                                     ^ in checkifup.php on line 5119
>>>>
>>>> Warning: simplexml_load_string(): Entity: line 220: parser error : Entity
>>>> 'reg' not defined in checkifup.php on line 5119
>>>>
>>>> Warning: simplexml_load_string():
>>>> /office/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&amp;sub_id=89877485&reg;
>>>> in checkifup.php on line 5119
>>>>
>>>>
>>>> --
>>>> PHP General Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>>> Does doing a str_replace and changing it to the corresponding entity number
>>> (&#174;) before parsing with simple_xml work?
>>>
>>> Here's a more robust function:
>>> http://www.sourcerally.net/Scripts/39-Convert-HTML-Entities-to-XML-Entities
>>>
>>> Adam
>>>
>>
>>
>>
>> This isn't a PHP error, it's an error with your XML. The regular HTML
>> entities which you're used to such as &reg; and &copy; are not
>> recognised in XML without first being declared as entities. The entities
>> exist in HTML because just outputting those characters won't always work
>> in a web browser (*Internet Explorer* *cough* *cough*) whereas XML was
>> never meant to be displayed in a browser, but transformed and then
>> output to a browser (among many other things) through XSLT. If you use
>> the characters directly in your XML you should be fine with the parser,
>> although you may have to make sure your document is saved in utf-8, as
>> most of the entity characters are above the ascii range.
>>
>
> Ash
>
> Its not my XML (&reg; isn't a www standard anyway) but its the xml provided 
> by the source I have to deal with and I can't change them so I guess I'll 
> just read the xml and then run defensing string replacements.
>
> Thanks for everyone's help.
>
> Tom
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

My xml file is ...

<?xml version="1.0"?>
<tag>&reg;</tag>

Using different tools the error is always along the lines of ...

"This page contains the following errors:

error on line 1 at column 11: Entity 'reg' not defined
Below is a rendering of the page up to the first error."


<?xml version="1.0"?>
<tag>&#ae;</tag>

"This page contains the following errors:

error on line 2 at column 8: CharRef: invalid decimal value
Below is a rendering of the page up to the first error."

The only thing I could do was ...

<?xml version="1.0"?>
<tag>&amp;reg;</tag>


-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--- End Message ---
--- Begin Message ---
On Fri, Oct 22, 2010 at 2:28 PM, Richard Quadling <rquadl...@gmail.com> wrote:
> On 22 October 2010 19:01, TR Shaw <ts...@oitc.com> wrote:
>>
>> On Oct 22, 2010, at 1:56 PM, Ashley Sheridan wrote:
>>
>>> On Fri, 2010-10-22 at 12:03 -0400, Adam Richardson wrote:
>>>
>>>> On Fri, Oct 22, 2010 at 11:47 AM, TR Shaw <ts...@oitc.com> wrote:
>>>>
>>>>> Anyone have an idea how to work around this? I tried:
>>>>>
>>>>> define ('reg', '®');
>>>>> define ('&reg;', '®');
>>>>>
>>>>> can't figure how to override the entity table.  Errors follw:
>>>>>
>>>>> Warning: simplexml_load_string():
>>>>> o.cc/46/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&amp;sub_id=61862469&reg;
>>>>> in checkifup.php on line 5119
>>>>>
>>>>> Warning: simplexml_load_string():
>>>>>                                     ^ in checkifup.php on line 5119
>>>>>
>>>>> Warning: simplexml_load_string(): Entity: line 220: parser error : Entity
>>>>> 'reg' not defined in checkifup.php on line 5119
>>>>>
>>>>> Warning: simplexml_load_string():
>>>>> /office/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&amp;sub_id=89877485&reg;
>>>>> in checkifup.php on line 5119
>>>>>
>>>>>
>>>>> --
>>>>> PHP General Mailing List (http://www.php.net/)
>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>
>>>>>
>>>> Does doing a str_replace and changing it to the corresponding entity number
>>>> (&#174;) before parsing with simple_xml work?
>>>>
>>>> Here's a more robust function:
>>>> http://www.sourcerally.net/Scripts/39-Convert-HTML-Entities-to-XML-Entities
>>>>
>>>> Adam
>>>>
>>>
>>>
>>>
>>> This isn't a PHP error, it's an error with your XML. The regular HTML
>>> entities which you're used to such as &reg; and &copy; are not
>>> recognised in XML without first being declared as entities. The entities
>>> exist in HTML because just outputting those characters won't always work
>>> in a web browser (*Internet Explorer* *cough* *cough*) whereas XML was
>>> never meant to be displayed in a browser, but transformed and then
>>> output to a browser (among many other things) through XSLT. If you use
>>> the characters directly in your XML you should be fine with the parser,
>>> although you may have to make sure your document is saved in utf-8, as
>>> most of the entity characters are above the ascii range.
>>>
>>
>> Ash
>>
>> Its not my XML (&reg; isn't a www standard anyway) but its the xml provided 
>> by the source I have to deal with and I can't change them so I guess I'll 
>> just read the xml and then run defensing string replacements.
>>
>> Thanks for everyone's help.
>>
>> Tom
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> My xml file is ...
>
> <?xml version="1.0"?>
> <tag>&reg;</tag>
>
> Using different tools the error is always along the lines of ...
>
> "This page contains the following errors:
>
> error on line 1 at column 11: Entity 'reg' not defined
> Below is a rendering of the page up to the first error."
>
>
> <?xml version="1.0"?>
> <tag>&#ae;</tag>
>
> "This page contains the following errors:
>
> error on line 2 at column 8: CharRef: invalid decimal value
> Below is a rendering of the page up to the first error."
>
> The only thing I could do was ...
>
> <?xml version="1.0"?>
> <tag>&amp;reg;</tag>
>
>
> --
> Richard Quadling
> Twitter : EE : Zend
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Couldn't you cdata wrap that value?

-- 

Bastien

Cat, the other other white meat

--- End Message ---
--- Begin Message ---
Ok, here is an interesting one...

I am building an application, that basically listens for input on 2 ip
addresses (not a problem there)... then it does a bunch of stuff, puts
info to a terminal window (again, i dont think this will be an issue)...
but then once the user says "yep... print" i need to be able to connect
to a networked printer, and print the label... 

the printer will be accessable to the server (the server will be linux
based), so I just need to connect, and send data to it... is this
possble??

or am I biting off more than i should chew here?


and YES... i do know it is friday afternoon... ;)

Steve


--- End Message ---
--- Begin Message ---
On Fri, Oct 22, 2010 at 16:43, Steve Staples <sstap...@mnsi.net> wrote:
> Ok, here is an interesting one...
>
> I am building an application, that basically listens for input on 2 ip
> addresses (not a problem there)... then it does a bunch of stuff, puts
> info to a terminal window (again, i dont think this will be an issue)...
> but then once the user says "yep... print" i need to be able to connect
> to a networked printer, and print the label...
>
> the printer will be accessable to the server (the server will be linux
> based), so I just need to connect, and send data to it... is this
> possble??

    Of course.  Check into CUPS.  Here, specifically, are some
command-line options:

        http://www.cups.org/documentation.php/options.html

    I've done this multiple times myself.  I may even still have some
PHP code lying around.  I'll try to take a look for it if you need it,
but I highly doubt you'll have any issues.

-- 
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

--- End Message ---
--- Begin Message ---
I've to search for messages from Gmail Inbox over IMAP using search by
SUBJECT . The php-imap imap_search()  works fine when the subject is pure
alphanumeric. If the subject string has an apostrophe or a dash then the
search fails.

imap_seach($mbox, 'ALL SUBJECT "<search string>"');

imap_seach($mbox, 'ALL SUBJECT "this is a string without quote"'); //Works
imap_seach($mbox, 'ALL SUBJECT "this is a string with quote's and da-sh"');
//Doesn't Work

I've tried using the Zend Framework IMAP library too, it fails too. I've
been talking to people over some forums, they say subject search via imap on
gmail works for them.

What can be the problem here? I've tried escaping them but it did not help.

Any help is appreciated.

-- 
Regards,

Nitesh Nandy

--- End Message ---
--- Begin Message ---
I've to search for messages from Gmail Inbox over IMAP using search by
SUBJECT . The php-imap imap_search() works fine when the subject is pure alphanumeric. If the subject string has an apostrophe or a dash then the
search fails.

imap_seach($mbox, 'ALL SUBJECT "<search string>"');

imap_seach($mbox, 'ALL SUBJECT "this is a string without quote"'); // Works imap_seach($mbox, 'ALL SUBJECT "this is a string with quote's and da- sh"');
//Doesn't Work

I've tried using the Zend Framework IMAP library too, it fails too. I've been talking to people over some forums, they say subject search via imap on
gmail works for them.

What can be the problem here? I've tried escaping them but it did not help.

Any help is appreciated.

--
Regards,

Nitesh Nandy


Hi Nitesh,

I am a newbie in PHP, but I would guess the way you are attempting to escape the non-alphanumeric chars is faulty.
Can you please show the code you are using to do the escaping?

------------
Govinda


--- End Message ---
--- Begin Message ---
Thanks for the reply. I had posted this on gmail forums and someone just
posted this is a server-side limitation actually.

http://www.google.com/support/forum/p/gmail/thread?fid=05fef86a09eb199d00049338b3282f61&hl=en

I guess I'll have to figure out other ways ways to make this happen

On Sat, Oct 23, 2010 at 4:16 AM, Govinda <govinda.webdnat...@gmail.com>wrote:

> I've to search for messages from Gmail Inbox over IMAP using search by
>> SUBJECT . The php-imap imap_search()  works fine when the subject is pure
>> alphanumeric. If the subject string has an apostrophe or a dash then the
>> search fails.
>>
>> imap_seach($mbox, 'ALL SUBJECT "<search string>"');
>>
>> imap_seach($mbox, 'ALL SUBJECT "this is a string without quote"'); //Works
>> imap_seach($mbox, 'ALL SUBJECT "this is a string with quote's and
>> da-sh"');
>> //Doesn't Work
>>
>> I've tried using the Zend Framework IMAP library too, it fails too. I've
>> been talking to people over some forums, they say subject search via imap
>> on
>> gmail works for them.
>>
>> What can be the problem here? I've tried escaping them but it did not
>> help.
>>
>> Any help is appreciated.
>>
>> --
>> Regards,
>>
>> Nitesh Nandy
>>
>
>
> Hi Nitesh,
>
> I am a newbie in PHP, but I would guess the way you are attempting to
> escape the non-alphanumeric chars is faulty.
> Can you please show the code you are using to do the escaping?
>
> ------------
> Govinda
>
>


-- 
Regards,

Nitesh Nandy

--- End Message ---
--- Begin Message --- I'm trying to log some data for debugging and don't have use of the standard output to do so. I'd like to write the info to the php error log. Can this be done from within PHP? I've searched the web site for logging functions, but cannot find any.


--- End Message ---
--- Begin Message ---
On Fri, Oct 22, 2010 at 20:24, Tamara Temple <tamouse.li...@gmail.com> wrote:
> I'm trying to log some data for debugging and don't have use of the standard
> output to do so. I'd like to write the info to the php error log. Can this
> be done from within PHP? I've searched the web site for logging functions,
> but cannot find any.

    Sure.  You can use trigger_error() and error_log() for that.

-- 
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

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

On Oct 22, 2010, at 7:31 PM, Daniel P. Brown wrote:

On Fri, Oct 22, 2010 at 20:24, Tamara Temple <tamouse.li...@gmail.com> wrote:
I'm trying to log some data for debugging and don't have use of the standard output to do so. I'd like to write the info to the php error log. Can this be done from within PHP? I've searched the web site for logging functions,
but cannot find any.

   Sure.  You can use trigger_error() and error_log() for that.

Ah, yes, error_log() is precisely what I'm looking for. Seaching for "log" gave me the log function, searching for "logging" gave me a bunch of references I couldn't follow (for some reason the feeds want to open in my Mail.app client and create RSS feeds -- less than useful).



--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Tamara Temple [mailto:tamouse.li...@gmail.com]
> Sent: Friday, October 22, 2010 5:45 PM
> To: Daniel P. Brown
> Cc: PHP General
> Subject: Re: [PHP] Is there a way to write to the php error log from a php
> script?
> 
> 
> On Oct 22, 2010, at 7:31 PM, Daniel P. Brown wrote:
> 
> > On Fri, Oct 22, 2010 at 20:24, Tamara Temple <tamouse.li...@gmail.com>
> > wrote:
> >> I'm trying to log some data for debugging and don't have use of the
> >> standard output to do so. I'd like to write the info to the php error
> >> log.
> >> Can this
> >> be done from within PHP? I've searched the web site for logging
> >> functions, but cannot find any.
> >
> >    Sure.  You can use trigger_error() and error_log() for that.
> 
> Ah, yes, error_log() is precisely what I'm looking for. Seaching for "log"
gave
> me the log function, searching for "logging" gave me a bunch of references
I
> couldn't follow (for some reason the feeds want to open in my Mail.app
> client and create RSS feeds -- less than useful).
> 

Or you could try this [1], it was ported from log4j.  I used the log4j for
my java projects and I loved it.

Regards,
Tommy

[1] http://logging.apache.org/log4php/index.html



--- End Message ---
--- Begin Message ---
+1 for log4php. (http://logging.apache.org/log4php/index.html)

I use it regularly and love it.


Thanks,
Vikash Kumar
--
http://vika.sh


On 23 October 2010 08:35, Tommy Pham <tommy...@gmail.com> wrote:

> > -----Original Message-----
> > From: Tamara Temple [mailto:tamouse.li...@gmail.com]
> > Sent: Friday, October 22, 2010 5:45 PM
> > To: Daniel P. Brown
> > Cc: PHP General
> > Subject: Re: [PHP] Is there a way to write to the php error log from a
> php
> > script?
> >
> >
> > On Oct 22, 2010, at 7:31 PM, Daniel P. Brown wrote:
> >
> > > On Fri, Oct 22, 2010 at 20:24, Tamara Temple <tamouse.li...@gmail.com>
> > > wrote:
> > >> I'm trying to log some data for debugging and don't have use of the
> > >> standard output to do so. I'd like to write the info to the php error
> > >> log.
> > >> Can this
> > >> be done from within PHP? I've searched the web site for logging
> > >> functions, but cannot find any.
> > >
> > >    Sure.  You can use trigger_error() and error_log() for that.
> >
> > Ah, yes, error_log() is precisely what I'm looking for. Seaching for
> "log"
> gave
> > me the log function, searching for "logging" gave me a bunch of
> references
> I
> > couldn't follow (for some reason the feeds want to open in my Mail.app
> > client and create RSS feeds -- less than useful).
> >
>
> Or you could try this [1], it was ported from log4j.  I used the log4j for
> my java projects and I loved it.
>
> Regards,
> Tommy
>
> [1] http://logging.apache.org/log4php/index.html
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Alrighty, thanks for waiting.  I've posted the files here:

http://freelancetools.sourceforge.net/


Currently, there are two documents there:  A general contract and a
statement of work (SOW) contract.  Typically, the general contract
would be signed first, essentially laying out the overall terms of the
business relationship.  Then, the SOW is signed, which outlines the
specifics of the project (work to be done, budget, payment schedule,
etc).

You'll want to read each document carefully.  At the top, you'll want
to replace the generic information with yours and your client's.
After the first paragraph of each document, both parties are referred
to as "Client" and "Provider," so you won't have to change names in a
whole bunch of places.  The SOW provided contains budget/work for a
hypothetical sample project; you will want to replace this with the
details of the actual project you're working on.

I may add more stuff later, like SEO scripts and whatnot I've created
over the years, but for now this should at least help you with your
current situation.  Everything uploaded to the project URL above is in
the public domain, which means you are free to do with it as you
please.  And, as always, use it at your own risk.


Please feel free to let me know if you have any
questions/feedback/etc.  I hope this helps.  =)


--Kris


On Thu, Oct 21, 2010 at 1:52 PM, Kris Craig <kris.cr...@gmail.com> wrote:
> I've had a few emails from people making the same request, so what I'm
> gonna do is stick them up someplace public like SourceForge or
> whatever in the public domain for anyone who wants them.
>
> Legal disclaimer:  Please note that, though these have been reviewed
> by the legal departments of my past clients, I myself am not a lawyer
> and can offer no warranty regarding these documents.  If you have any
> questions/concerns about any part of either of the documents, I would
> strongly advise you to consult an attorney who specializes in contract
> law.  There is no lifeguard on duty.  Batteries not included.  So
> there.
>
>
> Now that that's out of the way, I'll get those up either tomorrow or
> Monday then post a link here.  I hope this helps.  =)
>
> --Kris
>
>
> On Wed, Oct 20, 2010 at 6:47 PM, Jason Pruim <li...@pruimphotography.com> 
> wrote:
>>
>> On Oct 20, 2010, at 8:47 PM, Kris Craig wrote:
>>>
>>>
>>> I hope this helps.  If you like, I'd be happy to email you a sample
>>> copy of the SOW/contract I've used with past clients.
>>
>> Hey Kris,
>>
>> If you don't mind I would love a copy my self! I have started doing some
>> freelance work and I'm always looking for info that I can use :)
>>
>> Jason Pruim
>>
>>
>

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

Alrighty, thanks for waiting.  I've posted the files here:

http://freelancetools.sourceforge.net/


Currently, there are two documents there:  A general contract and a
statement of work (SOW) contract.  Typically, the general contract
would be signed first, essentially laying out the overall terms of the
business relationship.  Then, the SOW is signed, which outlines the
specifics of the project (work to be done, budget, payment schedule,
etc).

You'll want to read each document carefully.  At the top, you'll want
to replace the generic information with yours and your client's.
After the first paragraph of each document, both parties are referred
to as "Client" and "Provider," so you won't have to change names in a
whole bunch of places.  The SOW provided contains budget/work for a
hypothetical sample project; you will want to replace this with the
details of the actual project you're working on.

I may add more stuff later, like SEO scripts and whatnot I've created
over the years, but for now this should at least help you with your
current situation.  Everything uploaded to the project URL above is in
the public domain, which means you are free to do with it as you
please.  And, as always, use it at your own risk.


Please feel free to let me know if you have any
questions/feedback/etc.  I hope this helps.  =)


--Kris

Kris, the documentation is excellent! Thank you very much for the resource. I think once this is provided to my client it will definitely reflect how serious the client is about the project, and give me some relief going forward.

Thank you sir.

Ervin
--- End Message ---
--- Begin Message ---
hello dear list - good morning!


I am trying to figure out a method how to retrieve on the same URLs [see  
below] with different query arguments, and i am wondering if this is doable 
with PHP!? 

on a sidenote:  Well - i guess that we can do this with  LWP::UserAgent -  
guess that this provides a way for us to loop through the query arguments: I am 
not sure that LWP::UserAgent has a method for us to do that. I tried to figure 
it out. And i digged deeper in the Manpages and Howtos. we can have a loop 
constructing the URLs and use 
LWP::UserAgent repeatedly:


see the Code:
 
for my $id (0 .. 100000)

{

 $ua->get($url."?id=21&extern_eid=".(0-$id))

 //rest of the code

} 



Well, alternatively we can add a request_prepare handler that  computes and add 
the query arguments before we send out the request. Do you think that this fits 
the needs? 

But wait - i want to do this with PHP! 

What is aimed: Here on this following site we find a list of many  schools: 
[see the page with the subsequent results - approx more than 1000 sites] 

see this site:  http://www-db.sn.schule.de/index.php?id=25

i want to fetch the sites that are listet on this page - and therefore i  want 
to use PHP for this [job] - and subesquently
 i want to parse them.

the sites can be reached directly - by constructing in other words the subsites 
of the overview can be reached via direct
 links... see the following. 


http://www-db.sn.schule.de/index.php?]id=21&extern_eid=1543

http://www-db.sn.schule.de/index.php?]id=21&extern_eid=709

http://www-db.sn.schule.de/index.php?]id=21&extern_eid=789

http://www-db.sn.schule.de/index.php?]id=21&extern_eid=1297



Well - i want to fetch all those.... And i try to do it with PHP and a 
mentioned loop. Does this work!?
___________________________________________________________
GRATIS! Movie-FLAT mit über 300 Videos. 
Jetzt freischalten unter http://movieflat.web.de

--- End Message ---
--- Begin Message ---
Gary wrote:

>Better. I can tell you how to solve it:
>    $a = array('a', 'b','c');
>    foreach($a as &$row){
>        //you don't have to do anything here
>    }
>    unset($row); // <----<<< THIS IS KEY!
>    print_r($a);
>    foreach($a as $row){
>        echo "<br />".$row;
>    }
>    print_r($a);

I see what you're doing now: unsetting the variable, not the array
element referenced by the variable. You're right, it does work.

It's not exactly better than knowing what's wrong, though... it's
different. I already had a workaround, although it was not quite as
elegant. My desire now is to find out whether the behavior I described
is due to something I don't understand about PHP, or to a bug. If it's
something I don't understand, I want to understand it. If it's a bug,
I want to report it.

--- End Message ---

Reply via email to