Re: [PHP] PHP4 vs PHP5 classes

2008-07-29 Thread Robert Cummings
On Wed, 2008-07-30 at 01:16 -0500, Larry Garfield wrote: > On Wednesday 30 July 2008 12:44:46 am Robert Cummings wrote: > > > It's unfortunate that PHP5 decided to throw a Strict Standards exception > > when you include both style constructors. For instance, I'm certain at > > one point the follow

Re: [PHP] PHP4 vs PHP5 classes

2008-07-29 Thread Larry Garfield
On Wednesday 30 July 2008 12:44:46 am Robert Cummings wrote: > It's unfortunate that PHP5 decided to throw a Strict Standards exception > when you include both style constructors. For instance, I'm certain at > one point the following was recommended: > > class Foo > { > function __construct(

Re: [PHP] limiting the amount of emails sent at a time in a batch send

2008-07-29 Thread Chris
>> I've done something very similar. I have a delivery timestamp column >> in the table that is initially NULL, and I set it to UTC_TIMESTAMP() >> for each row as I send the message. My query looks like this then: >> >> SELECT * FROM mail_queue WHERE delivery_timestamp IS NULL LIMIT 100. >> >> And

Re: [PHP] PHP4 vs PHP5 classes

2008-07-29 Thread Robert Cummings
On Tue, 2008-07-29 at 22:26 -0700, Jim Lucas wrote: > Chris wrote: > >> Don't forget that in PHP5, the constructor named has changed. In PHP4 > >> it called a method with the same name as the class. But, in PHP5, it > >> looks for __construct() instead. > > > > If __construct doesn't exist then

Re: [PHP] PHP4 vs PHP5 classes

2008-07-29 Thread Jim Lucas
Chris wrote: Don't forget that in PHP5, the constructor named has changed. In PHP4 it called a method with the same name as the class. But, in PHP5, it looks for __construct() instead. If __construct doesn't exist then it falls back to the php4 way - makes it backwards compatible :) But, i

Re: [PHP] PHP4 vs PHP5 classes

2008-07-29 Thread Chris
> Don't forget that in PHP5, the constructor named has changed. In PHP4 > it called a method with the same name as the class. But, in PHP5, it > looks for __construct() instead. If __construct doesn't exist then it falls back to the php4 way - makes it backwards compatible :) -- Postgresql &

Re: [PHP] Why PHP4?

2008-07-29 Thread VamVan
I agree but not everyone think in the sameway. I have seen several big websites that got hit because they haven't used super globals in the code and their hosting provided would just change the PHP.ini setting and nothing would work. GET, POST , SESSION, REQUEST everything was all dealt as just va

Re: [PHP] Why PHP4?

2008-07-29 Thread mike
I started using superglobals since 4.x; not even thinking about it from a security angle per se, but because it just makes sense to know the source of where your input data is coming from. I guess technically security is a byproduct of that thinking too. On Jul 29, 2008, at 7:31 PM, VamVa

Re: [PHP] Why PHP4?

2008-07-29 Thread VamVan
Its because PHP got really famous with version 4.0 and many people actually converted their CGI or other websites in to PHP 4 websites because it was easy and cheap. But 5.0 brought too many changes like serious OOPS and register global concepts for security, which is useful but made transition dif

Re: [PHP] limiting the amount of emails sent at a time in a batch send

2008-07-29 Thread Stephen
I would use a temporary table to hold all the email created in one job. Have a status field marked as sent, waiting or open. Have a cron job set 'x' number of open emails to waiting. Execute periodically. Have a cron job to send all waiting email and update status to sent. Execute periodically

Re: [PHP] limiting the amount of emails sent at a time in a batch send

2008-07-29 Thread Micah Gersten
Here's a PEAR package that handles this: http://pear.php.net/package/Mail_Queue/ Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Richard Kurth wrote: > I want to limit these script two send 100 email and then pause for a > few seconds and then send another 10

Re: [PHP] limiting the amount of emails sent at a time in a batch send

2008-07-29 Thread Richard Kurth
Andrew Ballard wrote: On Tue, Jul 29, 2008 at 4:52 PM, Richard Kurth <[EMAIL PROTECTED]> wrote: I want to limit these script two send 100 email and then pause for a few seconds and then send another 100 emails and repeat this tell it has sent all the emails that are dated for today. This scri

Re: [PHP] limiting the amount of emails sent at a time in a batch send

2008-07-29 Thread Andrew Ballard
On Tue, Jul 29, 2008 at 4:52 PM, Richard Kurth <[EMAIL PROTECTED]> wrote: > I want to limit these script two send 100 email and then pause for a few > seconds and then send another 100 emails and repeat this tell it has sent > all the emails that are dated for today. This script is runs by cron so

[PHP] limiting the amount of emails sent at a time in a batch send

2008-07-29 Thread Richard Kurth
I want to limit these script two send 100 email and then pause for a few seconds and then send another 100 emails and repeat this tell it has sent all the emails that are dated for today. This script is runs by cron so it is running in the background. How would I do this and is it the best way

Re: [PHP] Programming With Revision History

2008-07-29 Thread VamVan
Hello, Think in this way: You would be needing two tables: first one: content table: contentID, contentType, revisionID --- contentID is the PK ( you can make the UI for adding and deleting these fields) content_revisions table revisionID, contentID, -- revisionID is the PK

Re: [PHP] XML Encoding - with examples

2008-07-29 Thread Thiago H. Pojda
On Tue, Jul 29, 2008 at 4:59 PM, Andrew Ballard <[EMAIL PROTECTED]> wrote: > On Tue, Jul 29, 2008 at 3:52 PM, Thiago H. Pojda <[EMAIL PROTECTED]> > wrote: > > That's weird. I just changed it to convert everything to UTF and things > > appear ok on IE and messy in Firefox. I guess firefox isn't bee

Re: [PHP] XML Encoding - with examples

2008-07-29 Thread Andrew Ballard
On Tue, Jul 29, 2008 at 3:52 PM, Thiago H. Pojda <[EMAIL PROTECTED]> wrote: > That's weird. I just changed it to convert everything to UTF and things > appear ok on IE and messy in Firefox. I guess firefox isn't been nice to my > headers after all. It keeps saying the content is in ISO. > > Thanks

Re: [PHP] foreach question

2008-07-29 Thread Jason Pruim
On Jul 29, 2008, at 3:33 PM, Daniel Brown wrote: On Tue, Jul 29, 2008 at 3:25 PM, Jason Pruim <[EMAIL PROTECTED]> wrote: function random($random){ $randomQuery = "SELECT * FROM `current` ORDER BY Rand() LIMIT 2"; $result = mysql_query($randomQuery); $row[] = $result; forea

Re: [PHP] foreach question

2008-07-29 Thread Micah Gersten
You cannot do this: $row[] = $result; You need to loop around this: $row = mysql_fetch_assoc($result); Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Jason Pruim wrote: > Hey Everyone... > > So I am attempting to pull 2 random records from a MySQL databa

Re: [PHP] foreach question

2008-07-29 Thread Daniel Brown
On Tue, Jul 29, 2008 at 3:25 PM, Jason Pruim <[EMAIL PROTECTED]> wrote: > > function random($random){ > >$randomQuery = "SELECT * FROM `current` ORDER BY Rand() LIMIT 2"; > >$result = mysql_query($randomQuery); > $row[] = $result; > > > foreach($row as $key => $value) { > $random[$k

Re: [PHP] XML Encoding - with examples

2008-07-29 Thread Thiago H. Pojda
On Tue, Jul 29, 2008 at 4:20 PM, Andrew Ballard <[EMAIL PROTECTED]> wrote: > On Tue, Jul 29, 2008 at 2:33 PM, Thiago H. Pojda <[EMAIL PROTECTED]> > wrote: > > > -- > > Thiago Henrique Pojda > > > > Are you sure the accented characters you are using are part of > ISO-8859-1 and not UTF-8? I don't

[PHP] foreach question

2008-07-29 Thread Jason Pruim
Hey Everyone... So I am attempting to pull 2 random records from a MySQL database, so I wrote a function which I'll paste below. I had it mostly working with a while() statement, but I wanted to try a foreach to see if I could get the formatting a little bit better. Basically... What it d

Re: [PHP] XML Encoding

2008-07-29 Thread mike
you should want it to be utf-8 anyway. On 7/29/08, Thiago H. Pojda <[EMAIL PROTECTED]> wrote: > Guys, > > I'm building a XML in a PHP Script. Everything works fine until I add > accented (ISO-8859-1) characters into it. > > As far as I can see, there's no way to change DOMDocument's encoding from

Re: [PHP] XML Encoding - with examples

2008-07-29 Thread Andrew Ballard
On Tue, Jul 29, 2008 at 2:33 PM, Thiago H. Pojda <[EMAIL PROTECTED]> wrote: > Okay, > > After much iconv, headers and "workarounds" I figured I can't use > DOMDocument for XMLs when under ISO-8859-1 encoding without messing accented > chars. > > The idea is simple: get a query result and turn into

Re: [PHP] Php CLI Parser not working

2008-07-29 Thread Jim Lucas
JJB wrote: We recently rebuilt a webserver and upgraded it to opensuse 10.3. Now, when our webdev people run command line php scripts all of the included files are being output to the terminal instead of parsed. Can anyone make a good suggestion for what might be going on here? My Linux admin is

Re: [PHP] Php CLI Parser not working

2008-07-29 Thread Daniel Brown
On Tue, Jul 29, 2008 at 2:19 PM, JJB <[EMAIL PROTECTED]> wrote: > We recently rebuilt a webserver and upgraded it to opensuse 10.3. > Now, when our webdev people run command line php scripts all of the > included files are being output to the terminal instead of parsed. How are the scripts bei

[PHP] XML Encoding - with examples

2008-07-29 Thread Thiago H. Pojda
Okay, After much iconv, headers and "workarounds" I figured I can't use DOMDocument for XMLs when under ISO-8859-1 encoding without messing accented chars. The idea is simple: get a query result and turn into a XML. Using mysql_fetch_object is the best way for this task. If I just do nothing: ge

[PHP] Php CLI Parser not working

2008-07-29 Thread JJB
We recently rebuilt a webserver and upgraded it to opensuse 10.3. Now, when our webdev people run command line php scripts all of the included files are being output to the terminal instead of parsed. Can anyone make a good suggestion for what might be going on here? My Linux admin is out today,

RE: [PHP] Please, I need help with curl and php

2008-07-29 Thread Wei, Alice J.
Thanks for your time As you can see, I´m trying to connect to a web site and: * I need to use a cert. This cert is pem type * I go out from my net throw a proxy with an user and pass * I need to collect cookies And the most important, I need to catch the answer from this script. The script that

[PHP] XML Encoding

2008-07-29 Thread Thiago H. Pojda
Guys, I'm building a XML in a PHP Script. Everything works fine until I add accented (ISO-8859-1) characters into it. As far as I can see, there's no way to change DOMDocument's encoding from UTF-8, right? Thanks, -- Thiago Henrique Pojda

Re: [PHP] PHP4 vs PHP5 classes

2008-07-29 Thread Jim Lucas
[EMAIL PROTECTED] wrote: Maybe setting $this->max should be done in fetchSelectData since that's what is causing/creating your loop. Thanks Chris, I copied the code into the fetchSelectData function and it seems to be working fine now! Just need to test removing the code from the constructor

RE: [PHP] Please, I need help with curl and php

2008-07-29 Thread Wei, Alice J.
Hi, I´m making a little application with php and curl, but I´m a newby with curl. Please help me with the next script. I used to use this in order to make a connection with an specific site on the console ms-dos (windows), how can i translate this into php code? curl -x proxy_url:proxy_port -U

[PHP] Please, I need help with curl and php

2008-07-29 Thread Marco Vallejo
Hi, I´m making a little application with php and curl, but I´m a newby with curl. Please help me with the next script. I used to use this in order to make a connection with an specific site on the console ms-dos (windows), how can i translate this into php code? curl -x proxy_url:proxy_port -U p

Re: [PHP] Thumbnail through PHP RSS parser

2008-07-29 Thread Philip Thompson
On Jul 29, 2008, at 6:33 AM, Lyubomir Tsvetanov wrote: Hello, folks! I'm trying to parse RSS feed and display it on my own page. MagpieRSS looks good enough for me, but I have a little problem. http://magpierss.sourceforge.net/ I want to display not only the title and description of each artic

[PHP] Re: Thumbnail through PHP RSS parser

2008-07-29 Thread Colin Guthrie
Lyubomir Tsvetanov wrote: Hello, folks! I'm trying to parse RSS feed and display it on my own page. MagpieRSS looks good enough for me, but I have a little problem. http://magpierss.sourceforge.net/ I want to display not only the title and description of each article, but the thumbnail as well.

[PHP] Thumbnail through PHP RSS parser

2008-07-29 Thread Lyubomir Tsvetanov
Hello, folks! I'm trying to parse RSS feed and display it on my own page. MagpieRSS looks good enough for me, but I have a little problem. http://magpierss.sourceforge.net/ I want to display not only the title and description of each article, but the thumbnail as well. For example, I tried to do

Re: [PHP] Double results??

2008-07-29 Thread Paul Gregg
In mail.php.general, Dan Shirah <[EMAIL PROTECTED]> wrote: > $name_result = ifx_query ($name_query, $connect_id); > while ($name = ifx_fetch_row($name_result)) { > $party_name = TRIM($name['caa44240004']); > print_r($name); > } > > print_r($name) will return: > John > John > Mary > Mary > C

Re: [PHP] Web2.0 style tags - where to start?

2008-07-29 Thread Paul Jinks
On Tue, July 29, 2008 9:22 am, Jason Norwood-Young wrote: > > On Mon, 2008-07-28 at 23:57 +0100, Paul Jinks wrote: >> Jason Norwood-Young wrote: >> > On Mon, 2008-07-28 at 14:48 +0100, Paul Jinks wrote: >> > >> >> I think my first post was ambiguous. What we're thinking of is to >> build a >> >> s

Re: [PHP] Web2.0 style tags - where to start?

2008-07-29 Thread Jason Norwood-Young
On Mon, 2008-07-28 at 23:57 +0100, Paul Jinks wrote: > Jason Norwood-Young wrote: > > On Mon, 2008-07-28 at 14:48 +0100, Paul Jinks wrote: > > > >> I think my first post was ambiguous. What we're thinking of is to build a > >> site on which people can view videos with the option to add metadata

Re: [PHP] Web2.0 style tags - where to start?

2008-07-29 Thread Børge Holen
On Tuesday 29 July 2008 00:57:22 Paul Jinks wrote: > Jason Norwood-Young wrote: > > On Mon, 2008-07-28 at 14:48 +0100, Paul Jinks wrote: > >> I think my first post was ambiguous. What we're thinking of is to build > >> a site on which people can view videos with the option to add metadata > >> to a

Re: [PHP] PHP4 vs PHP5 classes

2008-07-29 Thread Chris
[EMAIL PROTECTED] wrote: >>> The $players object is created before the loop: >>> $players = new Players($lid); >> >> >> Which means the code is only executed once since it's in the >> constructor. It's not changing per loop because you're not calling the >> code. >> >> Maybe setting $this->max sho

Re: [PHP] PHP4 vs PHP5 classes

2008-07-29 Thread jeff . mills
> Maybe setting $this->max should be done in > > fetchSelectData > > since that's what is causing/creating your loop. > Thanks Chris, I copied the code into the fetchSelectData function and it seems to be working fine now! Just need to test removing the code from the constructor to make sure its