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 6 Jan 2009 02:55:50 -0000 Issue 5885

php-general-digest-helplists.php.net
Date: Mon Jan 05 2009 - 20:55:50 CST


php-general Digest 6 Jan 2009 02:55:50 -0000 Issue 5885

Topics (messages 285453 through 285493):

Re: setting up FTP account names via PHP
        285453 by: Marc Steinert
        285454 by: Merlin Morgenstern
        285455 by: bruce
        285457 by: Merlin Morgenstern
        285458 by: Jason Pruim
        285460 by: Merlin Morgenstern
        285462 by: Phpster
        285464 by: bruce
        285468 by: Sancar Saran
        285487 by: Merlin Morgenstern
        285490 by: bruce

Re: A beginner“s question
        285456 by: Eduardo

(auto) session expire
        285459 by: Shiplu
        285461 by: Thiago H. Pojda

Re: A beginner“s question
        285463 by: Andrew Ballard

Re: How to count transfered kBytes in File-Download
        285465 by: ceo.l-i-e.com
        285467 by: ceo.l-i-e.com
        285470 by: Jim Lucas
        285471 by: ceo.l-i-e.com

RSS Feed on my PHP site
        285466 by: DanBarker85
        285469 by: Wolf
        285474 by: Richard Heyes

MySQL client version problem
        285472 by: Rene Fournier
        285473 by: ceo.l-i-e.com
        285475 by: Rene Fournier
        285476 by: ceo.l-i-e.com

Because you guys/gals/girls/women/insert pc term here are a smart lot
        285477 by: Frank Stanovcak
        285478 by: Stuart
        285479 by: Frank Stanovcak
        285480 by: Daniel Brown
        285481 by: Micah Gersten
        285482 by: Robert Cummings
        285483 by: Daniel Brown
        285484 by: Frank Stanovcak
        285485 by: Ross McKay
        285486 by: Micah Gersten
        285489 by: Ross McKay
        285492 by: Robert Cummings

Import files from directory
        285488 by: Merlin Morgenstern
        285491 by: Daevid Vincent

php beautify downloaded...great how does one run the program???
        285493 by: Fred Silsbee

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:


Merlin Morgenstern schrieb:
> Hello everybody,
>
> I am running a real estate site where I would like to enable bulk
> upload via real estate software that exports an xml file into an ftp
> account.
>
> In order to give every user unique access I would need to generate
> individual ftp name and passwords for each member. I can not see how
> this should work. My portal is written in PHP 4.x and there every
> members loges in with a unique ID. The FTP Server runns on the same
> linux machine. How could I generate users for this FTP server with
> php, for example on sign up?
>
> Thank you for any help on this.
>
> Best regards,
>
> Merlin
>
What ftp server are you using?

--
http://bithub.net/
Synchronize and share your files over the web for free

attached mail follows:


Marc Steinert wrote:
> Merlin Morgenstern schrieb:
>> Hello everybody,
>>
>> I am running a real estate site where I would like to enable bulk
>> upload via real estate software that exports an xml file into an ftp
>> account.
>>
>> In order to give every user unique access I would need to generate
>> individual ftp name and passwords for each member. I can not see how
>> this should work. My portal is written in PHP 4.x and there every
>> members loges in with a unique ID. The FTP Server runns on the same
>> linux machine. How could I generate users for this FTP server with
>> php, for example on sign up?
>>
>> Thank you for any help on this.
>>
>> Best regards,
>>
>> Merlin
>>
> What ftp server are you using?
>

I just installed pureftpd. One possible sollution as I figured is to
alter the virtual user table of the ftp server with php.

Is this the way to go, or does somebody have a better idea that saves
dev. time?

attached mail follows:


are you trying to allow a user who logs in, to use his same username when
interfacing with the FTP server?

obviously, the password for the FTP server will be different. Or are you
looking to dynamically create a one time user/passwd for the user so that it
changes each time they access the FTP server?

-----Original Message-----
From: Merlin Morgenstern [mailto:merlin_xfastmail.fm]
Sent: Monday, January 05, 2009 6:44 AM
To: php-generallists.php.net
Subject: Re: [PHP] setting up FTP account names via PHP

Marc Steinert wrote:
> Merlin Morgenstern schrieb:
>> Hello everybody,
>>
>> I am running a real estate site where I would like to enable bulk
>> upload via real estate software that exports an xml file into an ftp
>> account.
>>
>> In order to give every user unique access I would need to generate
>> individual ftp name and passwords for each member. I can not see how
>> this should work. My portal is written in PHP 4.x and there every
>> members loges in with a unique ID. The FTP Server runns on the same
>> linux machine. How could I generate users for this FTP server with
>> php, for example on sign up?
>>
>> Thank you for any help on this.
>>
>> Best regards,
>>
>> Merlin
>>
> What ftp server are you using?
>

I just installed pureftpd. One possible sollution as I figured is to
alter the virtual user table of the ftp server with php.

Is this the way to go, or does somebody have a better idea that saves
dev. time?

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

attached mail follows:


Yes, it would be great if he could use the already existing username and
password. It should not be a one time password.

I am just now looking into mysql support for pure ftpd. One solution I
have in mind is to write the password into the pureftp DB upon signup.
That would be the easiest. The other solution to write to a conf file
would be OK, too. What do you think?

bruce wrote:
> are you trying to allow a user who logs in, to use his same username when
> interfacing with the FTP server?
>
> obviously, the password for the FTP server will be different. Or are you
> looking to dynamically create a one time user/passwd for the user so that it
> changes each time they access the FTP server?
>
>
> -----Original Message-----
> From: Merlin Morgenstern [mailto:merlin_xfastmail.fm]
> Sent: Monday, January 05, 2009 6:44 AM
> To: php-generallists.php.net
> Subject: Re: [PHP] setting up FTP account names via PHP
>
>
> Marc Steinert wrote:
>> Merlin Morgenstern schrieb:
>>> Hello everybody,
>>>
>>> I am running a real estate site where I would like to enable bulk
>>> upload via real estate software that exports an xml file into an ftp
>>> account.
>>>
>>> In order to give every user unique access I would need to generate
>>> individual ftp name and passwords for each member. I can not see how
>>> this should work. My portal is written in PHP 4.x and there every
>>> members loges in with a unique ID. The FTP Server runns on the same
>>> linux machine. How could I generate users for this FTP server with
>>> php, for example on sign up?
>>>
>>> Thank you for any help on this.
>>>
>>> Best regards,
>>>
>>> Merlin
>>>
>> What ftp server are you using?
>>
>
> I just installed pureftpd. One possible sollution as I figured is to
> alter the virtual user table of the ftp server with php.
>
> Is this the way to go, or does somebody have a better idea that saves
> dev. time?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


On Jan 5, 2009, at 9:55 AM, Merlin Morgenstern wrote:

> Yes, it would be great if he could use the already existing
> username and password. It should not be a one time password.
>
> I am just now looking into mysql support for pure ftpd. One
> solution I have in mind is to write the password into the pureftp
> DB upon signup.
> That would be the easiest. The other solution to write to a conf
> file would be OK, too. What do you think?

I would look real seriously at making sure both the FTP software, and
your website use the same authentication database. Even if it means
having to go with a different FTP server, or write your own. That
way, if they change their password on the web site, it will update it
for the FTP automatically as well.

Other then that, No real info to include to help... Sorry for that.

--
Jason Pruim
japruimraoset.com
616.399.2355

attached mail follows:


Is there a good FTP Daemon that can be recommended for this purpose?
pure-ftpd seams out of development since 2006.

Jason Pruim wrote:
>
> On Jan 5, 2009, at 9:55 AM, Merlin Morgenstern wrote:
>
>> Yes, it would be great if he could use the already existing username
>> and password. It should not be a one time password.
>>
>> I am just now looking into mysql support for pure ftpd. One solution I
>> have in mind is to write the password into the pureftp DB upon signup.
>> That would be the easiest. The other solution to write to a conf file
>> would be OK, too. What do you think?
>
> I would look real seriously at making sure both the FTP software, and
> your website use the same authentication database. Even if it means
> having to go with a different FTP server, or write your own. That way,
> if they change their password on the web site, it will update it for the
> FTP automatically as well.
>
> Other then that, No real info to include to help... Sorry for that.
>
> --
> Jason Pruim
> japruimraoset.com
> 616.399.2355
>
>
>
>

attached mail follows:


What about just using an http upload?

Bastien

Sent from my iPod

On Jan 5, 2009, at 9:55 AM, Merlin Morgenstern <merlin_xfastmail.fm>
wrote:

> Yes, it would be great if he could use the already existing username
> and password. It should not be a one time password.
>
> I am just now looking into mysql support for pure ftpd. One solution
> I have in mind is to write the password into the pureftp DB upon
> signup.
> That would be the easiest. The other solution to write to a conf
> file would be OK, too. What do you think?
>
> bruce wrote:
>> are you trying to allow a user who logs in, to use his same
>> username when
>> interfacing with the FTP server?
>> obviously, the password for the FTP server will be different. Or
>> are you
>> looking to dynamically create a one time user/passwd for the user
>> so that it
>> changes each time they access the FTP server?
>> -----Original Message-----
>> From: Merlin Morgenstern [mailto:merlin_xfastmail.fm]
>> Sent: Monday, January 05, 2009 6:44 AM
>> To: php-generallists.php.net
>> Subject: Re: [PHP] setting up FTP account names via PHP
>> Marc Steinert wrote:
>>> Merlin Morgenstern schrieb:
>>>> Hello everybody,
>>>>
>>>> I am running a real estate site where I would like to enable bulk
>>>> upload via real estate software that exports an xml file into an
>>>> ftp
>>>> account.
>>>>
>>>> In order to give every user unique access I would need to generate
>>>> individual ftp name and passwords for each member. I can not see
>>>> how
>>>> this should work. My portal is written in PHP 4.x and there every
>>>> members loges in with a unique ID. The FTP Server runns on the same
>>>> linux machine. How could I generate users for this FTP server with
>>>> php, for example on sign up?
>>>>
>>>> Thank you for any help on this.
>>>>
>>>> Best regards,
>>>>
>>>> Merlin
>>>>
>>> What ftp server are you using?
>>>
>> I just installed pureftpd. One possible sollution as I figured is to
>> alter the virtual user table of the ftp server with php.
>> Is this the way to go, or does somebody have a better idea that saves
>> dev. time?
>> --
>> 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
>

attached mail follows:


merlin..

if you're going to allow a user to use the same user/passwd for the site,
and the FTP server.. i would strongly argue that you should allow the user
only the minimal access on the FTP server. if someone hacks your site, no
need to have them running rampant over your FTP server.

i would actually argue that you can have the same username, but separate
passwds, but i don'w know exactly what you're going to have on the FTP
server, nor do I know your skill at securing servers/services...

it doesn't really make a difference if you have separate dbs for the
user/passwd auth systems. if you secure the overall system, it's secure. if
you don't, well you're going to run into issues..

you might also look into existing web based mgmt apps for FTP servers to see
if any already exist.

-----Original Message-----
From: Merlin Morgenstern [mailto:merlin_xfastmail.fm]
Sent: Monday, January 05, 2009 6:56 AM
To: php-generallists.php.net
Subject: Re: [PHP] setting up FTP account names via PHP

Yes, it would be great if he could use the already existing username and
password. It should not be a one time password.

I am just now looking into mysql support for pure ftpd. One solution I
have in mind is to write the password into the pureftp DB upon signup.
That would be the easiest. The other solution to write to a conf file
would be OK, too. What do you think?

bruce wrote:
> are you trying to allow a user who logs in, to use his same username when
> interfacing with the FTP server?
>
> obviously, the password for the FTP server will be different. Or are you
> looking to dynamically create a one time user/passwd for the user so that
it
> changes each time they access the FTP server?
>
>
> -----Original Message-----
> From: Merlin Morgenstern [mailto:merlin_xfastmail.fm]
> Sent: Monday, January 05, 2009 6:44 AM
> To: php-generallists.php.net
> Subject: Re: [PHP] setting up FTP account names via PHP
>
>
> Marc Steinert wrote:
>> Merlin Morgenstern schrieb:
>>> Hello everybody,
>>>
>>> I am running a real estate site where I would like to enable bulk
>>> upload via real estate software that exports an xml file into an ftp
>>> account.
>>>
>>> In order to give every user unique access I would need to generate
>>> individual ftp name and passwords for each member. I can not see how
>>> this should work. My portal is written in PHP 4.x and there every
>>> members loges in with a unique ID. The FTP Server runns on the same
>>> linux machine. How could I generate users for this FTP server with
>>> php, for example on sign up?
>>>
>>> Thank you for any help on this.
>>>
>>> Best regards,
>>>
>>> Merlin
>>>
>> What ftp server are you using?
>>
>
> I just installed pureftpd. One possible sollution as I figured is to
> alter the virtual user table of the ftp server with php.
>
> Is this the way to go, or does somebody have a better idea that saves
> dev. time?
>
>
> --
> 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

attached mail follows:


On Monday 05 January 2009 16:29:09 Merlin Morgenstern wrote:
> Hello everybody,
>
> I am running a real estate site where I would like to enable bulk upload
> via real estate software that exports an xml file into an ftp account.
>
> In order to give every user unique access I would need to generate
> individual ftp name and passwords for each member. I can not see how
> this should work. My portal is written in PHP 4.x and there every
> members loges in with a unique ID. The FTP Server runns on the same
> linux machine. How could I generate users for this FTP server with php,
> for example on sign up?
>
> Thank you for any help on this.
>
> Best regards,
>
> Merlin

If those xml files not that big, you may consider uploading with php.

Or perhaps you may find an ftp server which can use mysql database for
authentication.

attached mail follows:


Hello everybody,

thank you all for your help. I got a solution running. In pure-ftpd you
can authenticate via mysql. Via a user table, exactly the thing I was
searching for.

However, there is a problem araising. Every user get's his own directory
for uploads. My next step would have been to create a php script which
will be run by cron every 5 minutes that scans one dir and if there is
content inside import it into the mysql db.
With the current setup I would need to scan all dirs to see if there are
changes inside.

Is there some kind of command where I could find out if there are new
files inside those folders? I don't see any other solution.

Any suggestions?

Thank you for any help,

merlin

bruce schrieb:
> merlin..
>
> if you're going to allow a user to use the same user/passwd for the site,
> and the FTP server.. i would strongly argue that you should allow the user
> only the minimal access on the FTP server. if someone hacks your site, no
> need to have them running rampant over your FTP server.
>
> i would actually argue that you can have the same username, but separate
> passwds, but i don'w know exactly what you're going to have on the FTP
> server, nor do I know your skill at securing servers/services...
>
> it doesn't really make a difference if you have separate dbs for the
> user/passwd auth systems. if you secure the overall system, it's secure. if
> you don't, well you're going to run into issues..
>
> you might also look into existing web based mgmt apps for FTP servers to see
> if any already exist.
>
>
>
> -----Original Message-----
> From: Merlin Morgenstern [mailto:merlin_xfastmail.fm]
> Sent: Monday, January 05, 2009 6:56 AM
> To: php-generallists.php.net
> Subject: Re: [PHP] setting up FTP account names via PHP
>
>
> Yes, it would be great if he could use the already existing username and
> password. It should not be a one time password.
>
> I am just now looking into mysql support for pure ftpd. One solution I
> have in mind is to write the password into the pureftp DB upon signup.
> That would be the easiest. The other solution to write to a conf file
> would be OK, too. What do you think?
>
> bruce wrote:
>> are you trying to allow a user who logs in, to use his same username when
>> interfacing with the FTP server?
>>
>> obviously, the password for the FTP server will be different. Or are you
>> looking to dynamically create a one time user/passwd for the user so that
> it
>> changes each time they access the FTP server?
>>
>>
>> -----Original Message-----
>> From: Merlin Morgenstern [mailto:merlin_xfastmail.fm]
>> Sent: Monday, January 05, 2009 6:44 AM
>> To: php-generallists.php.net
>> Subject: Re: [PHP] setting up FTP account names via PHP
>>
>>
>> Marc Steinert wrote:
>>> Merlin Morgenstern schrieb:
>>>> Hello everybody,
>>>>
>>>> I am running a real estate site where I would like to enable bulk
>>>> upload via real estate software that exports an xml file into an ftp
>>>> account.
>>>>
>>>> In order to give every user unique access I would need to generate
>>>> individual ftp name and passwords for each member. I can not see how
>>>> this should work. My portal is written in PHP 4.x and there every
>>>> members loges in with a unique ID. The FTP Server runns on the same
>>>> linux machine. How could I generate users for this FTP server with
>>>> php, for example on sign up?
>>>>
>>>> Thank you for any help on this.
>>>>
>>>> Best regards,
>>>>
>>>> Merlin
>>>>
>>> What ftp server are you using?
>>>
>> I just installed pureftpd. One possible sollution as I figured is to
>> alter the virtual user table of the ftp server with php.
>>
>> Is this the way to go, or does somebody have a better idea that saves
>> dev. time?
>>
>>
>> --
>> 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
>

attached mail follows:


are you moving the files from the ftpdir, to a separate dir?

if you are, you can run your cron process from the top level dir... get a
list of any underlying files, and then iterate through the list to copy the
files to whereever you need to copy them...

you'd use the 'ls -R...' or the 'find....' cmd for what you're looking to
do...

-----Original Message-----
From: Merlin Morgenstern [mailto:merlin_xfastmail.fm]
Sent: Monday, January 05, 2009 3:56 PM
To: php-generallists.php.net
Subject: Re: [PHP] setting up FTP account names via PHP

Hello everybody,

thank you all for your help. I got a solution running. In pure-ftpd you
can authenticate via mysql. Via a user table, exactly the thing I was
searching for.

However, there is a problem araising. Every user get's his own directory
for uploads. My next step would have been to create a php script which
will be run by cron every 5 minutes that scans one dir and if there is
content inside import it into the mysql db.
With the current setup I would need to scan all dirs to see if there are
changes inside.

Is there some kind of command where I could find out if there are new
files inside those folders? I don't see any other solution.

Any suggestions?

Thank you for any help,

merlin

bruce schrieb:
> merlin..
>
> if you're going to allow a user to use the same user/passwd for the site,
> and the FTP server.. i would strongly argue that you should allow the user
> only the minimal access on the FTP server. if someone hacks your site, no
> need to have them running rampant over your FTP server.
>
> i would actually argue that you can have the same username, but separate
> passwds, but i don'w know exactly what you're going to have on the FTP
> server, nor do I know your skill at securing servers/services...
>
> it doesn't really make a difference if you have separate dbs for the
> user/passwd auth systems. if you secure the overall system, it's secure.
if
> you don't, well you're going to run into issues..
>
> you might also look into existing web based mgmt apps for FTP servers to
see
> if any already exist.
>
>
>
> -----Original Message-----
> From: Merlin Morgenstern [mailto:merlin_xfastmail.fm]
> Sent: Monday, January 05, 2009 6:56 AM
> To: php-generallists.php.net
> Subject: Re: [PHP] setting up FTP account names via PHP
>
>
> Yes, it would be great if he could use the already existing username and
> password. It should not be a one time password.
>
> I am just now looking into mysql support for pure ftpd. One solution I
> have in mind is to write the password into the pureftp DB upon signup.
> That would be the easiest. The other solution to write to a conf file
> would be OK, too. What do you think?
>
> bruce wrote:
>> are you trying to allow a user who logs in, to use his same username when
>> interfacing with the FTP server?
>>
>> obviously, the password for the FTP server will be different. Or are you
>> looking to dynamically create a one time user/passwd for the user so that
> it
>> changes each time they access the FTP server?
>>
>>
>> -----Original Message-----
>> From: Merlin Morgenstern [mailto:merlin_xfastmail.fm]
>> Sent: Monday, January 05, 2009 6:44 AM
>> To: php-generallists.php.net
>> Subject: Re: [PHP] setting up FTP account names via PHP
>>
>>
>> Marc Steinert wrote:
>>> Merlin Morgenstern schrieb:
>>>> Hello everybody,
>>>>
>>>> I am running a real estate site where I would like to enable bulk
>>>> upload via real estate software that exports an xml file into an ftp
>>>> account.
>>>>
>>>> In order to give every user unique access I would need to generate
>>>> individual ftp name and passwords for each member. I can not see how
>>>> this should work. My portal is written in PHP 4.x and there every
>>>> members loges in with a unique ID. The FTP Server runns on the same
>>>> linux machine. How could I generate users for this FTP server with
>>>> php, for example on sign up?
>>>>
>>>> Thank you for any help on this.
>>>>
>>>> Best regards,
>>>>
>>>> Merlin
>>>>
>>> What ftp server are you using?
>>>
>> I just installed pureftpd. One possible sollution as I figured is to
>> alter the virtual user table of the ftp server with php.
>>
>> Is this the way to go, or does somebody have a better idea that saves
>> dev. time?
>>
>>
>> --
>> 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
>

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

attached mail follows:


Thanks, you all!
I tried near all suggestions, and Vicente's worked with
        IE6
        Windows98SE
        EasyPHP

Eduardo

On 5 Jan 2009 at 4:36, Vicente wrote:

> <textarea rows="5" name="tastes" cols="28"> <? echo $tastes;?> </textarea>

attached mail follows:


This is a very common issue. I searched and found many sites talking
about this. but no good solution.
Well the problem is I want to set my session will expire after 10
minutes of inactivity. Just like an banking site.
When user is inactive for 10 minutes the session will expire. In fact
the browser will delete the cookie.
The browser will delete the cookie because it was told by the server.
I used these lines

session_cache_expire(APP_SESSION_TIMEOUT);
session_set_cookie_params(APP_SESSION_TIMEOUT*60);
ini_set("session.gc_maxlifetime", APP_SESSION_TIMEOUT * 60);
session_start();

It runs at the very beginning of my application. APP_SESSION_TIMEOUT
has value 10 which is in minutes.

The problem is it works good in FF3. But not in IE.

Any Idea how to resolve it? or any standard way to fix it?

--
Blog: http://talk.cmyweb.net/
Follow me: http://twitter.com/shiplu

attached mail follows:


On Mon, Jan 5, 2009 at 12:05 PM, Shiplu <shiplu.netgmail.com> wrote:
> This is a very common issue. I searched and found many sites talking
> about this. but no good solution.
> Well the problem is I want to set my session will expire after 10
> minutes of inactivity. Just like an banking site.
> When user is inactive for 10 minutes the session will expire. In fact
> the browser will delete the cookie.
> The browser will delete the cookie because it was told by the server.
> I used these lines

Don't trust client-side actions.

Never.

> session_cache_expire(APP_SESSION_TIMEOUT);
> session_set_cookie_params(APP_SESSION_TIMEOUT*60);
> ini_set("session.gc_maxlifetime", APP_SESSION_TIMEOUT * 60);
> session_start();
>
> It runs at the very beginning of my application. APP_SESSION_TIMEOUT
> has value 10 which is in minutes.
>
> The problem is it works good in FF3. But not in IE.
>
> Any Idea how to resolve it? or any standard way to fix it?

I'm not sure if there is any "standard" way to fix it. What I do is
just compare current time with the last action time. If it's bigger
than my timeout, session_destroy().

If anyone has any other ideas, I'd like to hear it. :)

> --
> Blog: http://talk.cmyweb.net/
> Follow me: http://twitter.com/shiplu
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Thiago Henrique Pojda
http://nerdnaweb.blogspot DOT com

attached mail follows:


On Mon, Jan 5, 2009 at 10:50 AM, Eduardo <vareedugmail.com> wrote:
> Thanks, you all!
> I tried near all suggestions, and Vicente's worked with
> IE6
> Windows98SE
> EasyPHP
>
> Eduardo
>
>
> On 5 Jan 2009 at 4:36, Vicente wrote:
>
>> <textarea rows="5" name="tastes" cols="28"> <? echo $tastes;?> </textarea>
>
>
>

Unless you have taken steps to ensure that the value of $tastes does
not include any HTML markup, you want to escape the value:

<textarea rows="5" name="tastes" cols="28"> <? echo
htmlspecialchars($tastes);?> </textarea>

Andrew

attached mail follows:


> echo fread($HANDLER, $FSIZE);

This is your problem child right here...

Sucking in an entire OGG File to RAM, for a large OGG file, will be quite painful.

And, on a busy server, even moderate size files will be problematic.

You could probably relieve a lot of stress and keep full-size downloads just by doing:

define('CHUNK_SIZE', 2048);
define('DOWNLOAD_LIMIT', 10*1024);

while (!feof($HANDLER)){
  echo fread($HANDLER, CHUNK_SIZE);
}

To answer your original question, you would abort this loop partway though, using some kind of counter *= CHUNK_SIZE and compare it to DOWNLOAD_LIMIT.

attached mail follows:


> I'm still a little confused on this though. How would a browser send
> this to notify of a download that was only partially completed before?

As I understand it, it was more of a "partially cached" document issue.

If the browser has the first N bytes of a document in its cache, it will send this, I think...

attached mail follows:


ceol-i-e.com wrote:
>> echo fread($HANDLER, $FSIZE);
>
> This is your problem child right here...
>
> Sucking in an entire OGG File to RAM, for a large OGG file, will be quite painful.
>
> And, on a busy server, even moderate size files will be problematic.
>
> You could probably relieve a lot of stress and keep full-size downloads just by doing:
>
> define('CHUNK_SIZE', 2048);
> define('DOWNLOAD_LIMIT', 10*1024);
>
> while (!feof($HANDLER)){
> echo fread($HANDLER, CHUNK_SIZE);
> }
>
> To answer your original question, you would abort this loop partway though, using some kind of counter *= CHUNK_SIZE and compare it to DOWNLOAD_LIMIT.
>
>

ceo, you made me realize a problem with yours and my example also.

When mentioning the RAM usage problem, one might consider calling flush() after each echo,
just to make sure that they don't run over PHPs memory limit.

--
Jim Lucas

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

Twelfth Night, Act II, Scene V
    by William Shakespeare

attached mail follows:


> When mentioning the RAM usage problem, one might consider calling
> flush() after each echo, just to make sure that they don't run over
> PHPs memory limit.

Oh yeah.

Make sure you've run through and cleared all ob_buffers for any kind of non-HTML output, specifically for file downloads.

You really don't want your web server buffering up a potentially large streamable content just because you've got ob_auto_start or whatever in php.ini, or some kind of main controller calling ob_start() or whatever.

I know a lot of folks swear by ob_start and its benefits, but I mostly find it annoying as a general "solution"...

Didn't even think of that, as I only use ob_start() when I *really* want it, not as a general fix-up.

attached mail follows:


Hi

i'm new to RSS Feeds, but how would it be possible to have a BBC News Feed
added to my website?

I've searched for some kind of tutorial but haven't found anything.

Thanks for any help!

Dan
--
View this message in context: http://www.nabble.com/RSS-Feed-on-my-PHP-site-tp21293513p21293513.html
Sent from the PHP - General mailing list archive at Nabble.com.

attached mail follows:


---- DanBarker85 <DanBarker85hotmail.co.uk> wrote:
>
> Hi
>
> i'm new to RSS Feeds, but how would it be possible to have a BBC News Feed
> added to my website?
>
> I've searched for some kind of tutorial but haven't found anything.

You STFW but haven't found anything? Wow... Google sure had a number of responses...

http://www.google.com/search?q=adding+RSS+feeds+to+site&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

HTH,
Wolf

attached mail follows:


> i'm new to RSS Feeds, but how would it be possible to have a BBC News Feed
> added to my website?

You can read and parse an RSS feed just like any other webpage. Magpie
RSS will probably make life easier though.

--
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated January 4th)

attached mail follows:


After following some instructions on compiling PHP 5.2.8 from source ( http://osx.topicdesk.com/content/view/48/62/
  ), I notice now that phpinfo() reports that I am running the MySQL
client API version 4.1.22 (instead of 5.0.45). Is this something to
do with how you compile PHP, or does it depend on MySQL?

...Rene

attached mail follows:


PHP had a built-in MySQL for awhile as I recall.

You had to explicitly use --with-mysql=/usr/local (or wherever you put your mysql headers/libs) to make it choose the one you wanted.

Even if it's not using built-in, it may have found an "old" install of your MySQL rather than your shiny new 5.0.45 version.

config.log will tell you what happened.

config.nice will tell you what you typed for ./configure

You definitely will want to fix this before you do anything else.

hth

attached mail follows:


Thing is, I have MySQL 5.0.67 installed, and I've never had MySQL 4 on
this box (Xserve G5, Mac OS X Server 10.4.11). Here's my configure
command:

./configure --prefix=/usr/local/php5 --mandir=/usr/share/man --
infodir=/usr/share/info --with-apxs --with-ldap=/usr --with-kerberos=/
usr --enable-cli --with-zlib-dir=/usr --with-libxml-dir=/usr --enable-
exif --enable-ftp --enable-mbstring --enable-sockets --enable-fastcgi
--with-iodbc=/usr --with-curl=/usr --with-config-file-path=/private/
etc --with-mysql=/usr --with-mysql-sock=/var/mysql/mysql.sock

If I remove --mysql=/usr, MySQL doesn't work at all (not surprising I
guess). Is there something else I need to do to compile PHP with the
latest MySQL module? (Which I don't understand--is the module part of
the PHP source, or is it something external that gets linked to?)

...Rene

On 5-Jan-09, at 10:13 AM, ceol-i-e.com wrote:

>
> PHP had a built-in MySQL for awhile as I recall.
>
>
>
> You had to explicitly use --with-mysql=/usr/local (or wherever you
> put your mysql headers/libs) to make it choose the one you wanted.
>
>
>
> Even if it's not using built-in, it may have found an "old" install
> of your MySQL rather than your shiny new 5.0.45 version.
>
>
>
> config.log will tell you what happened.
>
>
>
> config.nice will tell you what you typed for ./configure
>
>
>
> You definitely will want to fix this before you do anything else.
>
>
>
> hth
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Historically, mysql has been both an external extension, and a built-in part of the source, depending on the version of PHP.

Your current experience would indicate that it's only external in 5.2.8, but I cannot confirm nor deny that.

How is MySQL installed?

If it's rpm, do you have mysql-devel or whatever also installed? You need this to get /usr/include/mysql* so PHP can link to your /usr/lib/mysql* files.
If you ask for MySQL, but don't provide the headers, ./configure MAY be trying to use an old internal built-in mysql source from php source tree.
This is just a theory.

less config.log
/mysql

will tell you more accurately than anything what happened where

attached mail follows:


It's been a while since I've programed (VB was on version 4) I was wondering
if any one could tell me what the diff is between char, varchar, and text in
mysql.
I know this isn't a mysql news group, but since I am using php for the
interaction it seemed like the place to ask. Thanks in advance, and have a
great day!

Frank

attached mail follows:


2009/1/5 Frank Stanovcak <blindspotprocomcast.net>:
> It's been a while since I've programed (VB was on version 4) I was wondering
> if any one could tell me what the diff is between char, varchar, and text in
> mysql.
> I know this isn't a mysql news group, but since I am using php for the
> interaction it seemed like the place to ask. Thanks in advance, and have a
> great day!

char: the space required for the length of the field is allocated for
each row no matter how much of it is used.

varchar: only the space required for the content of the field is
allocated per row but these fields are limited to 255 chars (IIRC) in
length.

text: for all intents and purposes these have unlimited length (4GBish IIRC).

There is a page in the MySQL manual that explains all of the data
formats. Google for mysql data formats and you'll likely get it.

-Stuart

--
http://stut.net/

attached mail follows:


Thank you. I have a stupid/nasty habit of realizing I can search after I
post a question. Problem was I was overwhelmed on google. I was hoping for
a simple this type is good for this use because, but bad for other things
because. type answer.

My mantra around this office is "I'm old not addled damnit!" :)
"Stuart" <stuttlegmail.com> wrote in message
news:a5f019de0901051115ree20159tbbcf5b3cb26337f8mail.gmail.com...
> 2009/1/5 Frank Stanovcak <blindspotprocomcast.net>:
>> It's been a while since I've programed (VB was on version 4) I was
>> wondering
>> if any one could tell me what the diff is between char, varchar, and text
>> in
>> mysql.
>> I know this isn't a mysql news group, but since I am using php for the
>> interaction it seemed like the place to ask. Thanks in advance, and have
>> a
>> great day!
>
> char: the space required for the length of the field is allocated for
> each row no matter how much of it is used.
>
> varchar: only the space required for the content of the field is
> allocated per row but these fields are limited to 255 chars (IIRC) in
> length.
>
> text: for all intents and purposes these have unlimited length (4GBish
> IIRC).
>
> There is a page in the MySQL manual that explains all of the data
> formats. Google for mysql data formats and you'll likely get it.
>
> -Stuart
>
> --
> http://stut.net/

attached mail follows:


On Mon, Jan 5, 2009 at 14:05, Frank Stanovcak <blindspotprocomcast.net> wrote:
> It's been a while since I've programed (VB was on version 4) I was wondering
> if any one could tell me what the diff is between char, varchar, and text in
> mysql.
> I know this isn't a mysql news group, but since I am using php for the
> interaction it seemed like the place to ask. Thanks in advance, and have a
> great day!

    This doesn't explain it all, of course, but the most basic explanation is:

        CHAR(n) Uses n bytes regardless of length of data
inserted[^1]
        VARCHAR(n) Uses strlen+1 bytes[^2]
        TEXT Uses the highest amount of minimum bytes,
even for empty[^3]

    1: Quick SELECT/INSERT/UPDATE; requires (n) length; maxlength is
255; wastes space.
    2: Slow SELECT/INSERT/UPDATE; requires (n) length; maxlength is
65535; doesn't waste space.[^4]
    3: Moderate SELECT/INSERT/UPDATE; doesn't require (n); maxlength
is 65535; wastes space.[^5][^6]
    4: VARCHAR is further limited to the maximum row size of 65535.
    5: TEXT maxlength per column is 65535, but can have multiple
>=65535 columns on same row.
    6: TEXT includes four subcategories: TINYTEXT, TEXT, MEDIUMTEXT,
and LONGTEXT.

--
</Daniel P. Brown>
daniel.brownparasane.net || danbrownphp.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

attached mail follows:


Frank Stanovcak wrote:
> It's been a while since I've programed (VB was on version 4) I was wondering
> if any one could tell me what the diff is between char, varchar, and text in
> mysql.
> I know this isn't a mysql news group, but since I am using php for the
> interaction it seemed like the place to ask. Thanks in advance, and have a
> great day!
>
> Frank
>
>
>
>
As nice as the guys on the list are, this will be most accurate:
http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com

attached mail follows:


On Mon, 2009-01-05 at 19:15 +0000, Stuart wrote:
> 2009/1/5 Frank Stanovcak <blindspotprocomcast.net>:
> > It's been a while since I've programed (VB was on version 4) I was wondering
> > if any one could tell me what the diff is between char, varchar, and text in
> > mysql.
> > I know this isn't a mysql news group, but since I am using php for the
> > interaction it seemed like the place to ask. Thanks in advance, and have a
> > great day!
>
> char: the space required for the length of the field is allocated for
> each row no matter how much of it is used.
>
> varchar: only the space required for the content of the field is
> allocated per row but these fields are limited to 255 chars (IIRC) in
> length.
>
> text: for all intents and purposes these have unlimited length (4GBish IIRC).
>
> There is a page in the MySQL manual that explains all of the data
> formats. Google for mysql data formats and you'll likely get it.

It's generally worth mentioning that you can usually index char or
varchar, but not text.

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

attached mail follows:


On Mon, Jan 5, 2009 at 14:54, Robert Cummings <robertinterjinn.com> wrote:
>
> It's generally worth mentioning that you can usually index char or
> varchar, but not text.

    Actually, you can with MyISAM tables using FULLTEXT.

--
</Daniel P. Brown>
daniel.brownparasane.net || danbrownphp.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

attached mail follows:


This would be the winning answer. I've been using text up till now. I'll
have to change that.

Thank you!

"Robert Cummings" <robertinterjinn.com> wrote in message
news:1231185251.22224.2.camellocalhost...
> On Mon, 2009-01-05 at 19:15 +0000, Stuart wrote:
>> 2009/1/5 Frank Stanovcak <blindspotprocomcast.net>:
>> > It's been a while since I've programed (VB was on version 4) I was
>> > wondering
>> > if any one could tell me what the diff is between char, varchar, and
>> > text in
>> > mysql.
>> > I know this isn't a mysql news group, but since I am using php for the
>> > interaction it seemed like the place to ask. Thanks in advance, and
>> > have a
>> > great day!
>>
>> char: the space required for the length of the field is allocated for
>> each row no matter how much of it is used.
>>
>> varchar: only the space required for the content of the field is
>> allocated per row but these fields are limited to 255 chars (IIRC) in
>> length.
>>
>> text: for all intents and purposes these have unlimited length (4GBish
>> IIRC).
>>
>> There is a page in the MySQL manual that explains all of the data
>> formats. Google for mysql data formats and you'll likely get it.
>
> It's generally worth mentioning that you can usually index char or
> varchar, but not text.
>
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
>

attached mail follows:


First, start here:

http://dev.mysql.com/doc/refman/5.1/en/string-types.html

Stuart wrote:

>> varchar: only the space required for the content of the field is
>> allocated per row but these fields are limited to 255 chars (IIRC) in
>> length.

In MySQL, varchar can hold "up to" 65,535 characters, but the actual
maximum size is limited by the maximum row length (65,535 bytes) and the
character set (e.g. utf8 uses between one and three bytes per
character).

Maybe you're thinking of char, which is limited to 255 characters.

Robert Cummings wrote:

>It's generally worth mentioning that you can usually index char or
>varchar, but not text.

No, you can index a text column, but it will only index part of the
column:

"Only the first max_sort_length bytes of the column are used when
sorting. The default value of max_sort_length is 1024." - TFM.

Also, you can create a FULLTEXT index on text columns stored in the
MyISAM engine. (which is a PITA, because if you want ACID transactions
and full-text searching, you need to create and maintain a MyISAM shadow
table of the data you want to full-text search on)
--
Ross McKay, Toronto, NSW Australia
"The lawn could stand another mowing; funny, I don't even care"
- Elvis Costello

attached mail follows:


Ross McKay wrote:
> First, start here:
>
> http://dev.mysql.com/doc/refman/5.1/en/string-types.html
>
> Stuart wrote:
>
>
>>> varchar: only the space required for the content of the field is
>>> allocated per row but these fields are limited to 255 chars (IIRC) in
>>> length.
>>>
>
> In MySQL, varchar can hold "up to" 65,535 characters, but the actual
> maximum size is limited by the maximum row length (65,535 bytes) and the
> character set (e.g. utf8 uses between one and three bytes per
> character).
>
> Maybe you're thinking of char, which is limited to 255 characters.
>

You're referencing the 5.1 manual. In the 5.0 manual it says that
VARCHAR was extended to 65535 in 5.0.3, so you're statement is not
entirely correct, nor was Stuart's. That's why I linked him to the 5.0
manual page on data types.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com

attached mail follows:


Micah Gersten wrote:

>You're referencing the 5.1 manual. In the 5.0 manual it says that
>VARCHAR was extended to 65535 in 5.0.3, so you're statement is not
>entirely correct, nor was Stuart's. That's why I linked him to the 5.0
>manual page on data types.

Good point, thanks! I usually read from the .chm manual but just jumped
to the website to grab a link. Should have been:

http://dev.mysql.com/doc/refman/5.0/en/string-types.html

I note that Stuart was most likely talking about MySQL <= 4 which had a
limit of 255 characters for varchar.
--
Ross McKay, Toronto, NSW Australia
"My old man told me one time, you never get wise, you only get older"
- Dandy Warhols

attached mail follows:


On Tue, 2009-01-06 at 11:01 +1100, Ross McKay wrote:
> Micah Gersten wrote:
>
> >You're referencing the 5.1 manual. In the 5.0 manual it says that
> >VARCHAR was extended to 65535 in 5.0.3, so you're statement is not
> >entirely correct, nor was Stuart's. That's why I linked him to the 5.0
> >manual page on data types.
>
> Good point, thanks! I usually read from the .chm manual but just jumped
> to the website to grab a link. Should have been:
>
> http://dev.mysql.com/doc/refman/5.0/en/string-types.html
>
> I note that Stuart was most likely talking about MySQL <= 4 which had a
> limit of 255 characters for varchar.

I guess it's time for me to re-read the complete up-to-date manual
too...

"You can have indexes on BLOB and TEXT columns only as of MySQL 3.23.2
for MyISAM tables or MySQL 4.0.14 for InnoDB tables. Previous versions
of MySQL did not support indexing these data types."

:)

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

attached mail follows:


Hi everybody,

I am running a real estate portal and would like to allow users to
upload their listing from their existing software. They do this with a
XML file which they will upload on a ftp server that places this xml
file into a seperate directory on the file system.

My basic idea was to run a php scipt triggered by cron every 5 minutes
that checks if there is a new upload and then reads the file and removes
it. Now here is where the problem starts. Imagine if there are 1000
users, I would need to go through 1000 folders to check for new content.
  There must be a better solution to identify the directory that has a
new finished upload.

Has anybody an idea on how to do this? Thank you for any hint.

Best regards,

Merlin

attached mail follows:


On Tue, 2009-01-06 at 01:01 +0100, Merlin Morgenstern wrote:

> Hi everybody,
>
> I am running a real estate portal and would like to allow users to
> upload their listing from their existing software. They do this with a
> XML file which they will upload on a ftp server that places this xml
> file into a seperate directory on the file system.
>
> My basic idea was to run a php scipt triggered by cron every 5 minutes
> that checks if there is a new upload and then reads the file and removes
> it. Now here is where the problem starts. Imagine if there are 1000
> users, I would need to go through 1000 folders to check for new content.
> There must be a better solution to identify the directory that has a
> new finished upload.
>
> Has anybody an idea on how to do this? Thank you for any hint.
>
> Best regards,
>
> Merlin

You might do well to ask the Oracle known as Google.
This be what I hit first try with "unix directory change notification":
http://aplawrence.com/Unixart/watchdir.html

The top of the dir tree will tell thee dates and times that contents
changed below/within it, so one could just scan the root 'customer' dirs
first to see which one has been modified, then traverse it and work
thine magic. Order them with this incantation "ls -lct" and pop off the
top ones for 'todays date' or 'hour' or something might also get you
more closer to what you want. rinse. repeat.

I'm out of wizard puns. ;-)

attached mail follows:


I looked at all the downloaded docs