php-general Digest 15 Aug 2009 22:48:14 -0000 Issue 6287

Topics (messages 296818 through 296821):

Re: File or directory?
        296818 by: Ashley Sheridan

Re: ini files as config - hidden
        296819 by: Sancar Saran

Another date exercise
        296820 by: tedd
        296821 by: Phpster

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message ---
On Sat, 2009-08-15 at 09:56 +0200, Ralph Deffke wrote:
> can u upload ur own files ?
> can u create a directory ?
> are u using a ftp client ?
> 
> try
> 
> ralph_def...@yahoo.de
> 
> "Clancy" <clanc...@cybec.com.au> wrote in message
> news:kjhc85hpub7drihgappifphcboolt9u...@4ax.com...
> > I have just got access to a new server, and am playing with
> upload/download procedures. I
> > looked in the root directory, and see several objects which I assume to be
> directories.
> > However I was surprised to find there does not appear to be any command to
> determine if an
> > object is a file or directory, either in PHP FTP or plain FTP.  I could
> try to change to
> > them, or download them, but this seems overkill.  Am I overlooking
> something obvious?
> 
> 
> 
That answer doesn't seem to quite come close even to answering the op
question.

Have you looked at ftp_rawlist which returns a detailed list of files,
along with their permissions and directory flags? Or you could use
ftp_size to determine the size of a file, which should be nothing for a
directory.

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


--- End Message ---
--- Begin Message ---
On Friday 14 August 2009 08:31:46 pm דניאל דנון wrote:
> I'm building a little framework for my self,
>
> The configuration of the framework is done in an ini file,
>
> How do you suggest to hide its contents?
>
> .htaccess wont be good (or atleast only htaccess) since if its turned
> off....
>
> The file contains mysql password and important data.
>
>
> How should I make sure the file stays hidden from someone who might tries
> to access it?

Hello there,

1-) You have to parse ini file in each execution. It was negative for 
performance. I suggest use plain php array

2-) To hide your config put it in out of html document root.

define('ROOTDIR', dirname(__FILE__).'/');
define("CONFDIR",ROOTDIR.'../config/');

require(CONFDIR.'config.php');

Regards

--- End Message ---
--- Begin Message ---
Hi gang:

Here's another exercise to consider.

This is a date entry problem where the user can enter a date in various forms, but the return will be in a consistent format.

For example, a user might enter a date in the form of:

August 5, 2009
Aug 05 2009
Aug 5, 9
08/05/09
8-5-9
8 05 2009
8,5,9

Or any combination thereof.

However, the resultant date will be standardized to: Aug 5, 2009.

Extra points for solving this for Euro as well as US date formats (i.e., 5 Aug, 2009 vs Aug 5, 2009). And, extra extra points for accommodating month brevity, such as "A" for August and "Mar" for March and so on.

Gentlemen, start your keyboards.  :-)

As always, should you or any of your IM Force be caught or killed, The Secretary will disavow any knowledge of your actions.

Cheers,

tedd

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

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

On Aug 15, 2009, at 3:57 PM, tedd <t...@sperling.com> wrote:

Hi gang:

Here's another exercise to consider.

This is a date entry problem where the user can enter a date in various forms, but the return will be in a consistent format.

For example, a user might enter a date in the form of:

August 5, 2009
Aug 05 2009
Aug 5, 9
08/05/09
8-5-9
8 05 2009
8,5,9

Or any combination thereof.

However, the resultant date will be standardized to: Aug 5, 2009.

Extra points for solving this for Euro as well as US date formats (i.e., 5 Aug, 2009 vs Aug 5, 2009). And, extra extra points for accommodating month brevity, such as "A" for August and "Mar" for March and so on.

Gentlemen, start your keyboards.  :-)

As always, should you or any of your IM Force be caught or killed, The Secretary will disavow any knowledge of your actions.

Cheers,

tedd

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

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


Use a js date picker and avoid the whole issue.

Bastien

Sent from my iPod

--- End Message ---

Reply via email to