OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
php-general Digest 11 Mar 2008 19:34:25 -0000 Issue 5342

php-general-digest-helplists.php.net
Date: Tue Mar 11 2008 - 14:34:25 CDT


php-general Digest 11 Mar 2008 19:34:25 -0000 Issue 5342

Topics (messages 271257 through 271312):

Re: /?feed=rss2
        271257 by: Per Jessen
        271260 by: Stut
        271261 by: Richard Heyes
        271262 by: Richard Heyes
        271271 by: Zoltán Németh
        271280 by: Philip Thompson
        271289 by: Richard Heyes
        271306 by: Daniel Brown
        271311 by: Richard Heyes

Re: SESSION Array problem - possibly different PHP versions?
        271258 by: Angelo Zanetti

Re: CSV speed
        271259 by: Arvids Godjuks
        271278 by: Ray Hauge

save image in database vs folder
        271263 by: jeffry s
        271265 by: dev.lenss.nl
        271266 by: Børge Holen
        271267 by: Aschwin Wesselius
        271268 by: Richard Heyes
        271269 by: jeffry s
        271270 by: dev.lenss.nl
        271279 by: Robert Cummings
        271282 by: Daniel Brown
        271284 by: David Giragosian
        271286 by: Daniel Brown
        271287 by: Warren Vail
        271290 by: Greg Donald
        271293 by: Børge Holen
        271308 by: Daniel Brown
        271310 by: Børge Holen

Re: difference in time
        271264 by: Aschwin Wesselius

Re: maintaining [user] state without a session ...
        271272 by: Stut
        271275 by: Thiago Pojda
        271276 by: Stut
        271281 by: Zoltán Németh
        271283 by: Stut

Re: Question about user management...
        271273 by: Eric Butera
        271285 by: Philip Thompson
        271288 by: Jason Pruim
        271294 by: Daniel Brown

Re: Session still open
        271274 by: Bill
        271277 by: Daniel Brown
        271298 by: Bill
        271307 by: Daniel Brown
        271309 by: Bill

Timezone management
        271291 by: Lamonte H

Storing values between multiple page forms
        271292 by: Matty Sarro
        271295 by: Thijs Lensselink
        271297 by: Shawn McKenzie
        271299 by: Daniel Brown
        271303 by: Matty Sarro

Error handling
        271296 by: It Maq
        271301 by: Shawn McKenzie

Re: Error handling (skip this message my mistake)
        271300 by: It Maq

How do I search the archives?
        271302 by: Lamonte H
        271304 by: Stut
        271305 by: Daniel Brown

link with database
        271312 by: Sofia Jacob \(CA\)

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


John Taylor-Johnston wrote:

> I do. CPanel too. How would I write that into an htaccess ?
>

The RewriteRule syntax is the same in .htaccess

/Per Jessen, ZĂĽrich

attached mail follows:


On 11 Mar 2008, at 07:09, John Taylor-Johnston wrote:
> Any other inspiration?

Assuming the index is a PHP script stick this at the top...

<?php
     if (!empty($_GET['feed']))
     {
         header('404 Not Found');
         echo 'Go away!';
         exit;
     }
?>

-Stut

--
http://stut.net/

> John Taylor-Johnston wrote:
>> It used to have a feed, by accident.
>> Now someone munches up too much bandwidth.
>> http://www.foo.com/?feed=rss2
>> How can I divert this to 127.0.0.1 or something to convince this
>> one to leave my bandwidth alone?
>> John
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


John Taylor-Johnston wrote:
> It used to have a feed, by accident.
> Now someone munches up too much bandwidth.
> http://www.foo.com//?feed=rss2
> How can I divert this to 127.0.0.1 or something to convince this one to
> leave my bandwidth alone?

You could make your PC think www.foo.com is local. Open up your hosts
file (typically /etch/hosts on *nix,
c:\windows\system32\drivers\etc\hosts on Windows) and add a line that reads:

127.0.0.1 www.foo.com

That way your PC (only your PC) will think that www.foo.com is local,
and not go over the Interweb for it.

--
Richard Heyes
Employ me:
http://www.phpguru.org/cv

attached mail follows:


> /etch/hosts

Typo. That should be:

/etch/hosts

--
Richard Heyes
Employ me:
http://www.phpguru.org/cv

attached mail follows:


2008. 03. 11, kedd keltezéssel 09.37-kor Richard Heyes ezt írta:
> > /etch/hosts
>
> Typo. That should be:
>
> /etch/hosts

I bet you mean /etc/hosts :)

greets,
Zoltán Németh

>
> --
> Richard Heyes
> Employ me:
> http://www.phpguru.org/cv
>

attached mail follows:


On Mar 11, 2008, at 7:29 AM, Zoltán Németh wrote:

> 2008. 03. 11, kedd keltezéssel 09.37-kor Richard Heyes ezt írta:
>>> /etch/hosts
>>
>> Typo. That should be:
>>
>> /etch/hosts
>
> I bet you mean /etc/hosts :)
>
> greets,
> Zoltán Németh
>
>>
>> --
>> Richard Heyes
>> Employ me:
>> http://www.phpguru.org/cv

...which is kinda funny b/c right here he says to "Employ me". Not
with double typos like that, Mr.!! =D

~Philip

attached mail follows:


> ...which is kinda funny b/c right here he says to "Employ me". Not with
> double typos like that, Mr.!! =D

Oopsy. Sight is a funny thing...

http://www.phpguru.org/article.php/102

--
Richard Heyes
Employ me:
http://www.phpguru.org/cv

attached mail follows:


On Tue, Mar 11, 2008 at 11:00 AM, Richard Heyes <richardhphpguru.org> wrote:
> > ...which is kinda funny b/c right here he says to "Employ me". Not with
> > double typos like that, Mr.!! =D
>
> Oopsy. Sight is a funny thing...
>
> http://www.phpguru.org/article.php/102

    I don't know how I missed that when it happened, but wow. A
stroke less than two weeks before your twenty-ninth birthday. Puts
things in perspective since you and I are close in age.

--
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

attached mail follows:


> A stroke less than two weeks before your twenty-ninth birthday.

Five months. Close though... :-)

--
Richard Heyes
Employ me:
http://www.phpguru.org/cv

attached mail follows:


-----Original Message-----
From: Al [mailto:newsridersite.org]
Sent: 10 March 2008 18:23
To: php-generallists.php.net
Subject: [PHP] Re: SESSION Array problem - possibly different PHP versions?

Put a print_r($_SESSION) at the top and bottom of your page code so you can
see
what's happening.

Also check your code that updates the session assignment by the GET value.
It
appears your code maybe unset()ing the session assignments.

Are you using Cookies? If so, check this code carefully as it can cause non

obvious things depending on whether the client machine has cookies enabled
or
disabled.

---------------------

Thanks will do so going to check the unset() as well as the print_r at top
and bottom, also I am not using cookies hope to get this sucker working.

Will keep you posted.

Angelo

attached mail follows:


I should say that running 7 quueries against 200MB table with ~600 000 rows
for 4 seconds looks to me as if there was no indexes and very poor database
design (i mean that CVS file is dumped into database incorrectly). Or you'r
server is Pentium 100 :)

P.S. Having myself a 1.5GB database with some tables 300MB+, having 1070
queries/sec average for last month.

2008/3/11, Wolf <LoneWolfnc.rr.com>:
>
> Danny Brow wrote:
> > I have about 10 csv files I need to open to access data. It takes a lot
> > of time to search each file for the values I need. Would it be best to
> > just dump all the cvs files to an SQL db and then just grab what I need
> > from there? I'm starting to think it would make a lot of sense. What do
> > you guys think?
> >
> > Thanks,
> > Dan
>
>
>
> Dan,
>
> I can tell you that depending on the size of your files is going to
> dictate the route you want to go. I have a CSV with 568,000+ lines with
> 19 different pieces to each line. The files are around 180M apiece and
> it takes my server about 2 seconds to run a system grep against the
> files. I can run a recursive call 7 times against a MySQL database with
> the same information and it takes it about 4 seconds.
>
> IF you have system call ability, a grep wouldn't be bad, otherwise I'd
> suggest loading the csv files into MySQL tables and checking them for
> the information, then dropping the tables when you get the next files.
> You can backup the databases such as a cron job overnight even.
>
> HTH,
>
> Wolf
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Wolf wrote:
> Danny Brow wrote:
>> I have about 10 csv files I need to open to access data. It takes a lot
>> of time to search each file for the values I need. Would it be best to
>> just dump all the cvs files to an SQL db and then just grab what I need
>> from there? I'm starting to think it would make a lot of sense. What do
>> you guys think?
>>
>> Thanks,
>> Dan
>
>
> Dan,
>
> I can tell you that depending on the size of your files is going to
> dictate the route you want to go. I have a CSV with 568,000+ lines with
> 19 different pieces to each line. The files are around 180M apiece and
> it takes my server about 2 seconds to run a system grep against the
> files. I can run a recursive call 7 times against a MySQL database with
> the same information and it takes it about 4 seconds.
>
> IF you have system call ability, a grep wouldn't be bad, otherwise I'd
> suggest loading the csv files into MySQL tables and checking them for
> the information, then dropping the tables when you get the next files.
> You can backup the databases such as a cron job overnight even.
>
> HTH,
> Wolf
>
>

If you do go the MySQL route, MySQL can import CSV files natively, and
it'll be a lot faster than doing it through PHP. Just look up the
syntax for the LOAD DATA INFILE command... or look here.

http://dev.mysql.com/doc/refman/5.1/en/load-data.html

Here's an example:

LOAD DATA LOCAL INFILE '/importfile.csv'
INTO TABLE test_table
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(field1, filed2, field3);

I've had to do imports of a million or more records from CSV files, and
PHP is a lot slower than MySQL at importing them :)

--
Ray Hauge
www.primateapplications.com

attached mail follows:


some friend of mine ague about this matter, this morning. they say, saving
image in
database is more professional. I am not really agree with that,since i am
just a novice programmer. i am asking
senior php programmer what you opinion about this?

which one is better. save in database or in folder?

attached mail follows:


Quoting jeffry s <paragasugmail.com>:

> some friend of mine ague about this matter, this morning. they say, saving
> image in
> database is more professional. I am not really agree with that,since i am
> just a novice programmer. i am asking
> senior php programmer what you opinion about this?
>
> which one is better. save in database or in folder?
>

Not this thread again :) Search the archives for this one. There have
been numerous discussions about this topic. Personally i don't see
what would make this technique more professional. It's just a matter
of taste.

attached mail follows:


Topposting here...
dont dont dont... we beat the living crap outa this one. Dont ask, do whatever
you want and learn from it.
Fact is that the best one is the one that works best right then and there.
Dont you dare push this subject any further...

On Tuesday 11 March 2008 12:00:35 jeffry s wrote:
> some friend of mine ague about this matter, this morning. they say, saving
> image in
> database is more professional. I am not really agree with that,since i am
> just a novice programmer. i am asking
> senior php programmer what you opinion about this?
>
> which one is better. save in database or in folder?

--
---
Børge Holen
http://www.arivene.net

attached mail follows:


Børge Holen wrote:
> Topposting here...
> dont dont dont... we beat the living crap outa this one. Dont ask, do whatever
> you want and learn from it.
> Fact is that the best one is the one that works best right then and there.
> Dont you dare push this subject any further...
>
>
> On Tuesday 11 March 2008 12:00:35 jeffry s wrote:
>
>> some friend of mine ague about this matter, this morning. they say, saving
>> image in
>> database is more professional. I am not really agree with that,since i am
>> just a novice programmer. i am asking
>> senior php programmer what you opinion about this?
>>
>> which one is better. save in database or in folder?
>>

You guys seem to be a little sensitive about the subject.... ;-)

I think I'm gonna dive into the archives then. To see for myself what
left such a scars upon that subject.
--

Aschwin Wesselius

/'What you would like to be done to you, do that to the other....'/

attached mail follows:


> some friend of mine ague about this matter, this morning. they say, saving
> image in
> database is more professional. I am not really agree with that,since i am
> just a novice programmer.

Well, bearing in mind I only have experience of MySQL, the general
consensus is to save it to a file on you hard drive and store the file
name in the database. If for whatever reason you can't or don't want to
do that, then at least store it in a separate table that only gets
touched when the image is requested.

--
Richard Heyes
Employ me:
http://www.phpguru.org/cv

attached mail follows:


thanks Richard ..
sorry dev.. i don't know this subject is quite sensitive here :(

> I think I'm gonna dive into the archives then. To see for myself what
> left such a scars upon that subject.

i guess, i have to prepare my oxygen tank to dive into the archives.
i am quite curious to find out what happen about this..

On Tue, Mar 11, 2008 at 7:18 PM, Richard Heyes <richardhphpguru.org> wrote:

> > some friend of mine ague about this matter, this morning. they say,
> saving
> > image in
> > database is more professional. I am not really agree with that,since i
> am
> > just a novice programmer.
>
> Well, bearing in mind I only have experience of MySQL, the general
> consensus is to save it to a file on you hard drive and store the file
> name in the database. If for whatever reason you can't or don't want to
> do that, then at least store it in a separate table that only gets
> touched when the image is requested.
>
> --
> Richard Heyes
> Employ me:
> http://www.phpguru.org/cv
>

attached mail follows:


Quoting jeffry s <paragasugmail.com>:

> thanks Richard ..
> sorry dev.. i don't know this subject is quite sensitive here :(

It's not so sensitive :) It's just one of those questions that pop''s
up a lot. And some of those discussions were pretty heated.

>
>> I think I'm gonna dive into the archives then. To see for myself what
>> left such a scars upon that subject.
>
> i guess, i have to prepare my oxygen tank to dive into the archives.
> i am quite curious to find out what happen about this..
>

Happy diving.

>
> On Tue, Mar 11, 2008 at 7:18 PM, Richard Heyes <richardhphpguru.org> wrote:
>
>> > some friend of mine ague about this matter, this morning. they say,
>> saving
>> > image in
>> > database is more professional. I am not really agree with that,since i
>> am
>> > just a novice programmer.
>>
>> Well, bearing in mind I only have experience of MySQL, the general
>> consensus is to save it to a file on you hard drive and store the file
>> name in the database. If for whatever reason you can't or don't want to
>> do that, then at least store it in a separate table that only gets
>> touched when the image is requested.
>>
>> --
>> Richard Heyes
>> Employ me:
>> http://www.phpguru.org/cv
>>
>

attached mail follows:


On Tue, 2008-03-11 at 11:18 +0000, Richard Heyes wrote:
> > some friend of mine ague about this matter, this morning. they say, saving
> > image in
> > database is more professional. I am not really agree with that,since i am
> > just a novice programmer.
>
> Well, bearing in mind I only have experience of MySQL, the general
> consensus is to save it to a file on you hard drive and store the file
> name in the database. If for whatever reason you can't or don't want to
> do that, then at least store it in a separate table that only gets
> touched when the image is requested.

Can you point me to a link where I can read about this so-called
"general consensus"? :)

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

attached mail follows:


On Tue, Mar 11, 2008 at 10:15 AM, Robert Cummings <robertinterjinn.com> wrote:
>
> On Tue, 2008-03-11 at 11:18 +0000, Richard Heyes wrote:
> > > some friend of mine ague about this matter, this morning. they say, saving
> > > image in
> > > database is more professional. I am not really agree with that,since i am
> > > just a novice programmer.
> >
> > Well, bearing in mind I only have experience of MySQL, the general
> > consensus is to save it to a file on you hard drive and store the file
> > name in the database. If for whatever reason you can't or don't want to
> > do that, then at least store it in a separate table that only gets
> > touched when the image is requested.
>
> Can you point me to a link where I can read about this so-called
> "general consensus"? :)

    http://www.gfy.com/ ;-P

--
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

attached mail follows:


On 3/11/08, Daniel Brown <parasanegmail.com> wrote:
> On Tue, Mar 11, 2008 at 10:15 AM, Robert Cummings <robertinterjinn.com> wrote:
> >
> > On Tue, 2008-03-11 at 11:18 +0000, Richard Heyes wrote:
> > > > some friend of mine ague about this matter, this morning. they say, saving
> > > > image in
> > > > database is more professional. I am not really agree with that,since i am
> > > > just a novice programmer.
> > >
> > > Well, bearing in mind I only have experience of MySQL, the general
> > > consensus is to save it to a file on you hard drive and store the file
> > > name in the database. If for whatever reason you can't or don't want to
> > > do that, then at least store it in a separate table that only gets
> > > touched when the image is requested.
> >
> > Can you point me to a link where I can read about this so-called
> > "general consensus"? :)
>
> http://www.gfy.com/ ;-P

Whoa! My institution blocked that URL for 'adult content'. I guess
there are some racy example pictures or something?? lol.

:=)

-David.

When the power of love
overcomes the love of power,
the world will know peace.

-Jimi Hendrix

attached mail follows:


On Tue, Mar 11, 2008 at 10:34 AM, David Giragosian
<dgiragosiangmail.com> wrote:
> On 3/11/08, Daniel Brown <parasanegmail.com> wrote:
> > http://www.gfy.com/ ;-P
>
> Whoa! My institution blocked that URL for 'adult content'. I guess
> there are some racy example pictures or something?? lol.

    It's a webmaster forum, but a little.... err, shall we say,
"liberal" in graphics and terminology. In fact, GFY isn't shorthand
for the greatest cartoon character of all time.... it stands for "Go
<?=str_rot13('Shpx');?> Yourself."

    Fun to check out at home, but I probably should've mentioned for
those unaware, it's not entirely recommended to check out at the
office. In short: NSFW.

    Sorry!

--
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

attached mail follows:


Probably has to do with what GFY means in texting short hand. Go F...
Yourself ;-).

Warren

> -----Original Message-----
> From: David Giragosian [mailto:dgiragosiangmail.com]
> Sent: Tuesday, March 11, 2008 7:34 AM
> To: php-generallists.php.net
> Subject: Re: [PHP] save image in database vs folder
>
> On 3/11/08, Daniel Brown <parasanegmail.com> wrote:
> > On Tue, Mar 11, 2008 at 10:15 AM, Robert Cummings
> <robertinterjinn.com> wrote:
> > >
> > > On Tue, 2008-03-11 at 11:18 +0000, Richard Heyes wrote:
> > > > > some friend of mine ague about this matter, this
> morning. they
> > > say, saving > > image in > > database is more
> professional. I am
> > > not really agree with that,since i am > > just a novice
> programmer.
> > > >
> > > > Well, bearing in mind I only have experience of MySQL, the
> > > general > consensus is to save it to a file on you hard
> drive and
> > > store the file > name in the database. If for whatever
> reason you
> > > can't or don't want to > do that, then at least store it in a
> > > separate table that only gets > touched when the image
> is requested.
> > >
> > > Can you point me to a link where I can read about this
> so-called
> > > "general consensus"? :)
> >
> > http://www.gfy.com/ ;-P
>
> Whoa! My institution blocked that URL for 'adult content'. I
> guess there are some racy example pictures or something?? lol.
>
> :=)
>
> -David.
>
> When the power of love
> overcomes the love of power,
> the world will know peace.
>
> -Jimi Hendrix
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


On 3/11/08, jeffry s <paragasugmail.com> wrote:
> which one is better. save in database or in folder?

The file system _is_ a database. No need to add more unnescessary layers.

Here is the defacto Zend benchmark on the topic:

http://www.zend.com/zend/trick/tricks-sept-2001.php

It doesn't work for me however, some header/include error.. maybe
there's a mirror or a cache of it some place. Or perhaps you can
persuade Zend to fix it back to a working state.

--
Greg Donald
http://destiney.com/

attached mail follows:


'n here we go againfff

--
---
Břrge Holen
http://www.arivene.net

attached mail follows:


On Tue, Mar 11, 2008 at 11:24 AM, Břrge Holen <borgearivene.net> wrote:
> 'n here we go againfff

    Břrge, the F's are silent. ;-P

--
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

attached mail follows:


On Tuesday 11 March 2008 18:30:13 you wrote:
> On Tue, Mar 11, 2008 at 11:24 AM, Břrge Holen <borgearivene.net> wrote:
> > 'n here we go againfff
>
> Břrge, the F's are silent. ;-P

=D

--
---
Břrge Holen
http://www.arivene.net

attached mail follows:


Lamp Lists wrote:
> hi to all!
> on one eZine site, I have to show when the article is posted but as difference from NOW. like "posted 32 minutes ago", or "posted 5 days ago".
>
> is there already sucha php/mysql function?
>
> thanks.

Hi,

I don't know about existing functions but you can use this:

    function time_to_units($time) {

        $years = floor($time / 60 / 60 / 24/ 365);
        $time -= $years * 60 * 60 * 24 * 365;
        $months = floor($time / 60 / 60 / 24 / 30);
        $time -= $months * 60 * 60 * 24 * 30;
        $weeks = floor($time / 60 / 60 / 24 / 7);
        $time -= $weeks * 60 * 60 * 24 * 7;
        $days = floor($time / 60 / 60 / 24);
        $time -= $days * 60 * 60 * 24;
        $hours = floor($time / 60 / 60);
        $time -= $hours * 60 * 60;
        $minutes = floor($time / 60);
        $time -= $minutes * 60;
        $seconds = $time;
        $amount = 0;
        $unit = '';

        if ($years > 0) {

            $amount = $years;
            $unit = ' year';

            if ($years > 1) {

                $unit.= 's ';
            }
        }
        elseif ($months > 0) {

            $amount = $months;
            $unit = ' month';

            if ($months > 1) {

                $unit.= 's ';
            }
        }
        elseif ($weeks > 0) {

            $amount = $weeks;
            $unit = ' week';

            if ($weeks > 1) {

                $unit.= 's ';
            }
        }
        elseif ($days > 0) {

            $amount = $days;
            $unit = ' day';

            if ($days > 1) {

                $unit.= 's ';
            }
        }
        elseif ($hours > 0) {

            $amount = $hours;
            $unit = ' hour';

            if ($hours > 1) {

                $unit.= 's ';
            }
        }
        elseif ($minutes > 0) {

            $amount = $minutes;
            $unit = ' minute';

            if ($minutes > 1) {

                $unit.= 's ';
            }
        }
        elseif ($seconds > 0) {

            $amount = $seconds;
            $unit = ' second';

            if ($seconds > 1) {

                $unit.= 's ';
            }
        }

        return $amount.$unit;
    }

$posted = ; // some timestamp in the past
$now = time(); // as current as possible
$diff = ($now - $posted);

echo "posted ".time_to_units($diff)." ago";

I hope this helps ;-)
--

Aschwin Wesselius

/'What you would like to be done to you, do that to the other....'/

attached mail follows:


On 4 Mar 2008, at 13:57, Jochem Maas wrote:
> Stut mentioned a little while back that he avoids using the built-in
> session

> mechanism if at all possible, but still manages to track user
> state ... now I
> can think of a way or two that he might do that but I was wondering if
> any one could give an idea about the write way to do it in terms of
> high performance :-)

Finally found time to finish the article, sorry for the delay...

http://stut.net/articles/sessionless_sessions.html

Constructive criticism welcome.

-Stut

--
http://stut.net/

attached mail follows:


-----Mensagem original-----
De: Stut [mailto:stuttlegmail.com]

On 4 Mar 2008, at 13:57, Jochem Maas wrote:
> Stut mentioned a little while back that he avoids using the built-in
> session

> mechanism if at all possible, but still manages to track user state
> ... now I can think of a way or two that he might do that but I was
> wondering if any one could give an idea about the write way to do it
> in terms of high performance :-)

Finally found time to finish the article, sorry for the delay...

http://stut.net/articles/sessionless_sessions.html

Constructive criticism welcome.

-Stut

<me>
        Good one, but how about CPU Load? Did it increase much?

</me>

attached mail follows:


On 11 Mar 2008, at 13:31, Thiago Pojda wrote:
> -----Mensagem original-----
> De: Stut [mailto:stuttlegmail.com]
>
>
> On 4 Mar 2008, at 13:57, Jochem Maas wrote:
>> Stut mentioned a little while back that he avoids using the built-in
>> session
>
>> mechanism if at all possible, but still manages to track user state
>> ... now I can think of a way or two that he might do that but I was
>> wondering if any one could give an idea about the write way to do it
>> in terms of high performance :-)
>
> Finally found time to finish the article, sorry for the delay...
>
> http://stut.net/articles/sessionless_sessions.html
>
> Constructive criticism welcome.
>
> <me>
> Good one, but how about CPU Load? Did it increase much?
>
> </me>

Not really. The is far more more memory and network-bound than CPU-
bound.

It's not an excessively strong cipher so I doubt it has much effect at
all, especially when compared to the expense of fetching from a DB
server.

-Stut

--
http://stut.net/

attached mail follows:


2008. 03. 11, kedd keltezéssel 12.34-kor Stut ezt írta:
> On 4 Mar 2008, at 13:57, Jochem Maas wrote:
> > Stut mentioned a little while back that he avoids using the built-in
> > session
>
> > mechanism if at all possible, but still manages to track user
> > state ... now I
> > can think of a way or two that he might do that but I was wondering if
> > any one could give an idea about the write way to do it in terms of
> > high performance :-)
>
> Finally found time to finish the article, sorry for the delay...
>
> http://stut.net/articles/sessionless_sessions.html
>
> Constructive criticism welcome.

good article. I've also realized long ago that I only need user id in to
be stored in the session, and also considered storing that in some
encrypted cookie, so I might just take and use your solution if you
don't mind ;)

greets,
Zoltán Németh

>
> -Stut
>
> --
> http://stut.net/
>
>

attached mail follows:


On 11 Mar 2008, at 14:26, Zoltán Németh wrote:
> 2008. 03. 11, kedd keltezéssel 12.34-kor Stut ezt írta:
>> On 4 Mar 2008, at 13:57, Jochem Maas wrote:
>>> Stut mentioned a little while back that he avoids using the built-in
>>> session
>>
>>> mechanism if at all possible, but still manages to track user
>>> state ... now I
>>> can think of a way or two that he might do that but I was
>>> wondering if
>>> any one could give an idea about the write way to do it in terms of
>>> high performance :-)
>>
>> Finally found time to finish the article, sorry for the delay...
>>
>> http://stut.net/articles/sessionless_sessions.html
>>
>> Constructive criticism welcome.
>
> good article. I've also realized long ago that I only need user id
> in to
> be stored in the session, and also considered storing that in some
> encrypted cookie, so I might just take and use your solution if you
> don't mind ;)

Thanks, and be my guest - that's why I wrote it up!

-Stut

--
http://stut.net/

attached mail follows:


On Tue, Mar 11, 2008 at 3:21 AM, Per Jessen <percomputer.org> wrote:
> Eric Butera wrote:
>
> >
> > Read up on "ACL's."
> >
>
> Apart from Zend which you've mentiond below, is there anything in/for
> PHP that will help implement ACLs for a PHP application?
>
>
> > http://en.wikipedia.org/wiki/Access_control_list
> > http://framework.zend.com/manual/en/zend.acl.html
>
> Does anyone use the Zend ACL stuff?
>
>
> /Per Jessen, ZĂĽrich
>
>
> --
>
>
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Not really. It is just a high level concept that users get roles.
Then in your code you define what roles can do. If you're into books
on tape check this podcast [1] out.

A few years ago the PEAR people were pimping something called LiveUser
[2] which now seems to be dead. Kind of ironic too since I remember
at the time everyone was saying stop working on your own and use ours.

[1] http://devzone.zend.com/article/2452-PHP-Abstract-Podcast-Episode-15-The-Zend-Access-Control-List
[2] http://pear.php.net/package/liveuser

attached mail follows:


On Mar 11, 2008, at 12:20 AM, Mike wrote:

> Wait, what?
>
> You are defining user role ids as MD5 hashes of UUIDs created from
> random numbers that change on every request?
>
> Am I missing something or is this completely insane advice?

I'm probably wrong on this, but I think the point is that it doesn't
matter the actual value of the constants. As long as you're using that
constant (which has a unique value on each request)... well, wait.
Maybe I don't understand either. Ha!

I do understand the security aspect though. It's like a password that
changes quite frequently - it would be, for all intensive purposes,
impossible to guess.

Oh, I have an idea! Let's say your users are defined this way in the
database:

user_level: ADMIN, GENERAL_USER, LEVEL_ONE_USER, etc...

Then run your comparison, e.g.:

if (defined ($user['user_level'])) { ... }

Maybe Tedd or Dan need to slap some sense into me, but that's one way
I *think* you could implement it. =/

~Philip

> On Mar 10, 2008, at 1:07 PM, tedd wrote:
>
>> At 3:14 PM -0400 3/10/08, Daniel Brown wrote:
>>> On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim <japruimraoset.com>
>>> wrote:
>>>
>>>> What I was thinking about doing was a combination of the company
>>>> name
>>>> (Which I set right now) and then a access level such as "50" for
>>>> the
>>>> "Owner" of the program, "40" for the "Managers" and "30" for the
>>>> "user" of the program. also leaving me room to add other levels if
>>>> required..
>>>
>>> I generally do the same basic thing for permission levels, but a
>>> reverse of what you're attempting to do.
>>>
>>> The superuser (AKA root, administrator, God, whatever) has GID 0,
>>> just like on a *NIX system. This is because it's the highest level
>>> you can reach, and 0 is the lowest real number you can use. Thus,
>>> you
>>> can add a virtually-infinite number of lesser users, as opposed to
>>> being limited to 50, as in your case.
>>
>> Yeah, but then if you try to add a super-superuser you have to go
>> negative. :-)
>>
>> Why not just define the users with define CONSTANT statement and
>> use that? Then the different types of users can be anything you
>> want and you can change the value easily if there's a problem.
>>
>> Really, all the value really has to be is unique -- you could use
>> unique() for that, such as:
>>
>> define("ADMIN", md5(uniqid(rand(), true)););
>> define("GENERAL_USER", md5(uniqid(rand(), true)););
>> define("LEVEL_ONE__USER", md5(uniqid(rand(), true)););
>> define("LEVEL_TWO__USER", md5(uniqid(rand(), true)););
>> define("WHATEVER__USER", md5(uniqid(rand(), true)););
>>
>> and so on. That would work and you'll never have to be concerned
>> about it nor worry about someone guessing it, if that becomes a
>> problem.
>>
>> Am I right?
>>
>> Cheers,
>>
>> tedd
>>
>> PS: Oh, I just received the following email and thought I would
>> pass it on:
>>
>> HELLO,
>> MY NAME IS AGNES IN SEARCH OF A MAN WHO UNDERSTANDS THE MEANING OF
>> LOVE AS TRUST AND FAITH IN EACH OTHER RATHER THAN ONE WHO SEES LOVE
>> AS THE ONLY WAY OF FUN BUT A MATURED MAN WITH NICE VISION OF WHAT
>> THE WORLD IS ALL ABOUT SO PLEASE REPLY ME WITH THIS BOX IF YOU ARE
>> INTERESTED IN ME.
>>
>> Anyone want a woman who yells all the time?
>>
>> --
>> -------
>> 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
>>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

"Personally, most of my web applications do not have to factor 13.7
billion years of space drift in to the calculations, so PHP's rand
function has been great for me..." ~S. Johnson

attached mail follows:


On Mar 11, 2008, at 10:42 AM, Philip Thompson wrote:

> On Mar 11, 2008, at 12:20 AM, Mike wrote:
>
>> Wait, what?
>>
>> You are defining user role ids as MD5 hashes of UUIDs created from
>> random numbers that change on every request?
>>
>> Am I missing something or is this completely insane advice?
>
> I'm probably wrong on this, but I think the point is that it doesn't
> matter the actual value of the constants. As long as you're using
> that constant (which has a unique value on each request)... well,
> wait. Maybe I don't understand either. Ha!
>
> I do understand the security aspect though. It's like a password
> that changes quite frequently - it would be, for all intensive
> purposes, impossible to guess.
>
> Oh, I have an idea! Let's say your users are defined this way in the
> database:
>
> user_level: ADMIN, GENERAL_USER, LEVEL_ONE_USER, etc...
>
> Then run your comparison, e.g.:
>
> if (defined ($user['user_level'])) { ... }
>
> Maybe Tedd or Dan need to slap some sense into me, but that's one
> way I *think* you could implement it. =/
>
> ~Philip

Here's what I understood it to mean :) The numbers that I was using
are unimportant.. It just needs to be consistent throughout the entire
application. Ie if 50,000 = Root 50,000 has to ALWAYS equal root. in
that same fashion if 0 = root 0 always has to be root. Both are just
as valid, and it's just a matter of design.

I could also use a "Level1", "Level2" etc type setup... All of it
works, and it's just semantics and programming styles. I don't believe
that either way is any more secure then any other way... At least of
what I have mentioned here...

If I'm wrong though, I'm open to suggestions! :)

--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
japruimraoset.com

attached mail follows:


On Tue, Mar 11, 2008 at 10:42 AM, Philip Thompson
<philthathrilgmail.com> wrote:
> I do understand the security aspect though. It's like a password that
> changes quite frequently - it would be, for all intensive purposes,
> impossible to guess.

    Very similar, yes. You've got the idea.

> Oh, I have an idea! Let's say your users are defined this way in the
> database:
>
> user_level: ADMIN, GENERAL_USER, LEVEL_ONE_USER, etc...
>
> Then run your comparison, e.g.:
>
> if (defined ($user['user_level'])) { ... }
>
> Maybe Tedd or Dan need to slap some sense into me, but that's one way
> I *think* you could implement it. =/

    You certainly can do that, but the problem is, if it doesn't come
down to numbers (lower-means-higher[1]), then you're defining a single
set of privileges per level. This means that each escalated privilege
level would either have to be associated with an array of either
permissible access codes, or (more overhead) would require an array of
all levels defined. Then, when you add a new level, it would have to
be explicitly defined or otherwise become a child of a parent level,
using inheritance.

    [1] Using the integer method, this can be avoided. If you're
number is 0, you're the equivalent of root on *NIX. You are God in
the eyes of the system. You can do anything at all. Now, say your
number is 10. You inherit the privilege set of users >=10, but NOT
root-level privileges. Your guest users may then have a code 99,
which may be your highest number. This means they have no privileged
access, only general browsing.

    Keep in mind, especially, that you don't have to limit yourself to
INT in the database. You could - and probably should - use a
FLOAT(2,2) field instead. This means you can have up to (100^2) - 1
specific levels that will inherit privileges from numbers higher than
the user level. Counting 0-99.99 gives 10,000 combinations, so root
could have up to 9,999 inherited levels below its own.

    If, however, you want to restrict each level to one privilege set,
and one set only, then you can use definitions or any other method.
You'd just need more data than a single number if you later decided to
expand and use inheritance.

    In any case, the idea is a lot simpler than it probably sounds by
now, but it's a fuller explanation for those interested.

--
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

attached mail follows:


Hi Daniel,

> on the site. If all you want to do is find out if they still have the
> socket open, then there are much smaller, simpler ways.

Like what ?

attached mail follows:


On Tue, Mar 11, 2008 at 9:01 AM, Bill <billlab51hotmail.com> wrote:
> Hi Daniel,
>
>
> > on the site. If all you want to do is find out if they still have the
> > socket open, then there are much smaller, simpler ways.
>
> Like what ?

    I meant as opposed to the session-handling method I sent in the
other thread. However, you may want to look into having JavaScript
handle the session-watching, and report to the server via AJAX calls
every 30 seconds or so. If JavaScript doesn't PING the server at
least once every thirty seconds, then you know either the user left
the page or closed the browser. If it does, on the other hand, then
the PHP side of the AJAX routine simply updates the
[database/file/session info] to show that the user is still active.

--
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

attached mail follows:


Hi

>> > socket open, then there are much smaller, simpler ways.
>>
>> Like what ?
>
> I meant as opposed to the session-handling method I sent in the
> other thread. However, you may want to look into having JavaScript
> handle the session-watching, and report to the server via AJAX calls
> every 30 seconds or so. If JavaScript doesn't PING the server at
> least once every thirty seconds, then you know either the user left
> the page or closed the browser. If it does, on the other hand, then
> the PHP side of the AJAX routine simply updates the
> [database/file/session info] to show that the user is still active.

Hum. Then we rely on JS to implement security with conections. And JS is
anything but secure AFAIK.

I want to prevent one from taking over a session from one who left the site
and left his desk for a moment.

What if that connection were two servers communicating together !?
Any crooked mind could then steal the latent session and start fire in the
system(s).

attached mail follows:


On Tue, Mar 11, 2008 at 11:48 AM, Bill <billlab51hotmail.com> wrote:
> Hum. Then we rely on JS to implement security with conections. And JS is
> anything but secure AFAIK.
>
> I want to prevent one from taking over a session from one who left the site
> and left his desk for a moment.
>
> What if that connection were two servers communicating together !?
> Any crooked mind could then steal the latent session and start fire in the
> system(s).

    All things that would've been good to know from your first
message, rather than the vague nature in which it was sent. ;-P

--
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

attached mail follows:


>>
>> I want to prevent one from taking over a session from one who left the
>> site
>> and left his desk for a moment.
>>
>> What if that connection were two servers communicating together !?
>> Any crooked mind could then steal the latent session and start fire in
>> the
>> system(s).
>
> All things that would've been good to know from your first
> message, rather than the vague nature in which it was sent. ;-P

The question remains the same and the initial problem is still the same.
My first concern is to avoid abandonned sessions from beeing stolen.
The extention of that problem is automation between two servers, like from
branches to the main office.

In that case, encryption is not a solution. It doesn't even block
cross-browser action.

Apache has mod_unique_id that could be usefull but it's not the final answer
IMO since it produces a unique ID based on a quadruple built on UTC, the
PID, the IP and a counter. That doesn't tell if the socket is still open but
only the last request the server satisfied.

For small applications maybe a cron like you gave could be a solution but
even so, will you set it to run eveny 30 seconds or so ?? I think it could
be somewhat heavy for the server. Just imagine 60 simultaneous visitors.

I would rely on JS to send an ID every 30 secs or so and wait for a new ID
based on the preceeding one. Something like mod_unique_id.

Do you know what's used in commerce ?

attached mail follows:


After a while of studying different softwares, I've still been getting
confused on how to make a timezone management script to display time in
different time zones. Like right now im in -0600 CST GMT, how would I
create a script that would work on any server that would allow me to display
my current time from -12 to 12 GMT in a select box so others could pick
their own time also.

attached mail follows:


Greets all!
I am working on a minor project for work for entering inventory information
for servers we ship out.

Here is my plan:
First page -
Get client name, number of servers, and find number of miscellaneous
equipment(s) being shipped (UPS's, monitors, etc)

From there, create a loop to run through each server based on number of
servers input on first page. Each server will come up as a new page.
Each server can have x hard drives, the number of which will be put in by
the user, and the form will be generated by a loop based on the number the
user puts in (ie: either generate the form based on submitted number of hard
drives, or have user put in a drop down and use some javascript for the
rest).

I'm still planning this out... my major concern is how would I maintain
values between pages? I'd like to have a summary printed before actually
storing values into the database. I'm going to start throwing together some
code, but I just wasn't sure how to maintain the values. The first version
is most likely just going to be one really large form, but obviously this is
going to be ugly and not so easy to work with considering the variances that
the different servers have.

Any suggestions would be welcome.

attached mail follows:


Quoting Matty Sarro <msarrogmail.com>:

> Greets all!
> I am working on a minor project for work for entering inventory information
> for servers we ship out.
>
> Here is my plan:
> First page -
> Get client name, number of servers, and find number of miscellaneous
> equipment(s) being shipped (UPS's, monitors, etc)
>
> From there, create a loop to run through each server based on number of
> servers input on first page. Each server will come up as a new page.
> Each server can have x hard drives, the number of which will be put in by
> the user, and the form will be generated by a loop based on the number the
> user puts in (ie: either generate the form based on submitted number of hard
> drives, or have user put in a drop down and use some javascript for the
> rest).
>
> I'm still planning this out... my major concern is how would I maintain
> values between pages? I'd like to have a summary printed before actually
> storing values into the database. I'm going to start throwing together some
> code, but I just wasn't sure how to maintain the values. The first version
> is most likely just going to be one really large form, but obviously this is
> going to be ugly and not so easy to work with considering the variances that
> the different servers have.
>
> Any suggestions would be welcome.
>

Maybe take a look at stut's article :)

http://stut.net/articles/sessionless_sessions.html

attached mail follows:


Matty Sarro wrote:
> Greets all!
> I am working on a minor project for work for entering inventory information
> for servers we ship out.
>
> Here is my plan:
> First page -
> Get client name, number of servers, and find number of miscellaneous
> equipment(s) being shipped (UPS's, monitors, etc)
>
> From there, create a loop to run through each server based on number of
> servers input on first page. Each server will come up as a new page.
> Each server can have x hard drives, the number of which will be put in by
> the user, and the form will be generated by a loop based on the number the
> user puts in (ie: either generate the form based on submitted number of hard
> drives, or have user put in a drop down and use some javascript for the
> rest).
>
> I'm still planning this out... my major concern is how would I maintain
> values between pages? I'd like to have a summary printed before actually
> storing values into the database. I'm going to start throwing together some
> code, but I just wasn't sure how to maintain the values. The first version
> is most likely just going to be one really large form, but obviously this is
> going to be ugly and not so easy to work with considering the variances that
> the different servers have.
>
> Any suggestions would be welcome.
>
Sessions

-Shawn

attached mail follows:


On Tue, Mar 11, 2008 at 11:11 AM, Matty Sarro <msarrogmail.com> wrote:
> Greets all!
> I am working on a minor project for work for entering inventory information
> for servers we ship out.
>
> Here is my plan:
> First page -
> Get client name, number of servers, and find number of miscellaneous
> equipment(s) being shipped (UPS's, monitors, etc)
[snip!]
> I'm still planning this out... my major concern is how would I maintain
> values between pages?

<?php
session_start();
$_SESSION['value'] = $your_sanitized_value_from_POST;
$_SESSION['value2'] = $your_second_sanitized_value;
echo "<pre />\n";
print_r($_SESSION);
echo "</pre>\n";
?>

    RTFM: http://php.net/session

    Keep in mind, it'll only work on the same server and same domain.
Otherwise, you may want to look into using wildcard cookies.

--
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

attached mail follows:


Yeah, I'm working on this with the hopes of it turning into a full module
for a larger project I'm working on... but I'm still a bit of a noob :)
Thanks for the assistance guys!

On Tue, Mar 11, 2008 at 11:48 AM, Daniel Brown <parasanegmail.com> wrote:

> On Tue, Mar 11, 2008 at 11:11 AM, Matty Sarro <msarrogmail.com> wrote:
> > Greets all!
> > I am working on a minor project for work for entering inventory
> information
> > for servers we ship out.
> >
> > Here is my plan:
> > First page -
> > Get client name, number of servers, and find number of miscellaneous
> > equipment(s) being shipped (UPS's, monitors, etc)
> [snip!]
> > I'm still planning this out... my major concern is how would I maintain
> > values between pages?
>
> <?php
> session_start();
> $_SESSION['value'] = $your_sanitized_value_from_POST;
> $_SESSION['value2'] = $your_second_sanitized_value;
> echo "<pre />\n";
> print_r($_SESSION);
> echo "</pre>\n";
> ?>
>
> RTFM: http://php.net/session
>
> Keep in mind, it'll only work on the same server and same domain.
> Otherwise, you may want to look into using wildcard cookies.
>
> --
> </Dan>
>
> Daniel P. Brown
> Senior Unix Geek
> <? while(1) { $me = $mind--; sleep(86400); } ?>
>

attached mail follows:


Hi,

I need help with a simple script that i made for handling errors. The problem is that the script displays the same message several times while i want it displayed just one time.
He is the code:

<?php
function error_handler($errno, $errstr, $filename, $lineno, &$context)
{
    if ($errno == E_STRICT) {
        echo "you are in the function error_handler<br>";
        echo $errno. "<br>";
    }
}
set_error_handler(error_handler, E_STRICT);
ini_set('error_reporting', 0);

$conn = mysql_connect(localhost, root, iolfsyd) or trigger_error("connection au serveur failed",WARNING);

?>

Thanks

      ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

attached mail follows:


It Maq wrote:
> Hi,
>
> I need help with a simple script that i made for handling errors. The problem is that the script displays the same message several times while i want it displayed just one time.
> He is the code:
>
> <?php
> function error_handler($errno, $errstr, $filename, $lineno, &$context)
> {
> if ($errno == E_STRICT) {
> echo "you are in the function error_handler<br>";
> echo $errno. "<br>";
> }
> }
> set_error_handler(error_handler, E_STRICT);
> ini_set('error_reporting', 0);
>
> $conn = mysql_connect(localhost, root, iolfsyd) or trigger_error("connection au serveur failed",WARNING);
>
> ?>
>
> Thanks
>
>
>
>
> ____________________________________________________________________________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
Do the erors have anything to do with string expected assuming constant
or similar? Maybe you have multiple errors because you don't quote your
strings?

-Shawn

attached mail follows:


Sorry,

i found the error. it was my mistake

----- Original Message ----
From: It Maq <itmaqurfeyahoo.com>
To: php-generallists.php.net
Sent: Tuesday, March 11, 2008 11:38:10 AM
Subject: [PHP] Error handling

Hi,

I need help with a simple script that i made for handling errors. The problem is that the script displays the same message several times while i want it displayed just one time.
He is the code:

<?php
function error_handler($errno, $errstr, $filename, $lineno, &$context)
{
    if ($errno == E_STRICT) {
        echo "you are in the function error_handler<br>";
        echo $errno. "<br>";
    }
}
set_error_handler(error_handler, E_STRICT);
ini_set('error_reporting', 0);

$conn = mysql_connect(localhost, root, iolfsyd) or trigger_error("connection au serveur failed",WARNING);

?>

Thanks

      ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

      ____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping

attached mail follows:


I went to the page, but I didn't find a search box and what not. Is there a
way to search the archives? Else when I get home I'll just create a script
to DL all the links to a page then create a simple search box.

attached mail follows:


On 11 Mar 2008, at 16:02, Lamonte H wrote:
> I went to the page, but I didn't find a search box and what not. Is
> there a
> way to search the archives? Else when I get home I'll just create a
> script
> to DL all the links to a page then create a simple search box.

You might want to think about what you're actually considering doing
with that script before you go that. A little thought will probably
put you off the idea quickly.

To answer your question... http://marc.info/?l=php-general&r=1&w=2

-Stut

--
http://stut.net/

attached mail follows:


On Tue, Mar 11, 2008 at 12:11 PM, Stut <stuttlegmail.com> wrote:
>
> On 11 Mar 2008, at 16:02, Lamonte H wrote:
> > I went to the page, but I didn't find a search box and what not. Is
> > there a
> > way to search the archives? Else when I get home I'll just create a
> > script
> > to DL all the links to a page then create a simple search box.
>
> You might want to think about what you're actually considering doing
> with that script before you go that. A little thought will probably
> put you off the idea quickly.
>
> To answer your question... http://marc.info/?l=php-general&r=1&w=2

    Also, in case MARC goes down for whatever reason, there are a
number of other sites.

    http://dir.gmane.org/gmane.comp.php.general
    http://www.nabble.com/PHP---General-f140.html
    .... and a ton of others which you can find on Google.

    My personal favorite is GMANE, but that's because of the fact that
I'm an old-school BBS/Newsgroup hack, and I like the added list
metrics.

--
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

attached mail follows:


Hi,

I want to create a link that get the name and the link from the database.

The problem is that I get the bullets created with <li> but not the link, here is my code and the result:

 

<?php
function do_html_URL($url, $name)
{
  // output URL as link and br
?>
  <a href="<?=$url?>"><?=$name?></a><br>
<?php
}

?>

function display_categories($cat_array)
{
  if (!is_array($cat_array))
  {
     echo "No hay categorías actualmente disponibles<br>";
     return;
  }
  echo "<ul>";
  foreach ($cat_array as $row)
  {
      $url = "show_cat.php?Categorie_ID=".($row["Categorie_ID"]);
       $title = $row["Catname"];
       echo "<li>";
       do_html_URL($url, $title);
  }
  echo "</ul>";
  echo "<hr>";
}

function get_categories()
{
   // Petición a la base de datos de una lista de categorías
   $conn = db_connect();
   $query = "SELECT Categorie_ID, Catname
           FROM categories";
   $result = mysql_query($query);
   if (!$result)
     return false;
   $num_cats = mysql_num_rows($result);
   if ($num_cats ==0)
      return false;
   $result = db_result_to_array($result); //db_fns.php
   return $result;
}

  $cat_array = get_categories();
  display_categories($cat_array);