php-general Digest 27 Jul 2011 21:01:54 -0000 Issue 7418
Topics (messages 314214 through 314218):
Re: pathinfo function
314214 by: Tim Streater
314216 by: Ford, Mike
314217 by: Tim Streater
Re: Tree menu list in php
314215 by: Alex Nikitin
Membership site
314218 by: wil prim
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On 26 Jul 2011 at 23:55, Micky Hulse <[email protected]> wrote:
> On Tue, Jul 26, 2011 at 3:47 PM, Tim Streater <[email protected]> wrote:
>> that I will get an error if I try to reference $info["extension"] ??
>
> From what I can tell via reading the docs:
>
> "The following associative array elements are returned: dirname,
> basename, extension (if any), and filename."
> <http://php.net/pathinfo>
>
> Makes me think that if the extension does not exist, then the
> "extension" key will not exist.
Seems to me that's the case. However the doc is ambiguous, especially as I
*asked* for that key to be returned. IMO it should exist and be empty. Not
existing is only OK if I didn't ask for it.
--
Cheers -- Tim
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Tim Streater [mailto:[email protected]]
> Sent: 27 July 2011 09:57
>
> On 26 Jul 2011 at 23:55, Micky Hulse <[email protected]> wrote:
>
> > On Tue, Jul 26, 2011 at 3:47 PM, Tim Streater
> <[email protected]> wrote:
> >> that I will get an error if I try to reference $info["extension"]
> ??
> >
> > From what I can tell via reading the docs:
> >
> > "The following associative array elements are returned: dirname,
> > basename, extension (if any), and filename."
> > <http://php.net/pathinfo>
> >
> > Makes me think that if the extension does not exist, then the
> > "extension" key will not exist.
>
> Seems to me that's the case. However the doc is ambiguous,
> especially as I *asked* for that key to be returned. IMO it should
> exist and be empty. Not existing is only OK if I didn't ask for it.
>
This is how you tell the difference between a basename with a null
extension ("/path/filename.") and no extension ("/path/filename").
In the former case you get $info["extension"]=>"", in the latter
there is no ["extension"] element in the returned array.
This does seem like the most logical way to make this distinction,
but the manual could use a bit of work to document this and other
edge cases more explicitly.
Cheers!
Mike
--
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,
Portland PD507, City Campus, Leeds Metropolitan University,
Portland Way, LEEDS, LS1 3HE, United Kingdom
E: [email protected] T: +44 113 812 4730
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
--- End Message ---
--- Begin Message ---
On 27 Jul 2011 at 11:09, Mike Ford <[email protected]> wrote:
>> -----Original Message-----
>> From: Tim Streater [mailto:[email protected]]
>> Seems to me that's the case. However the doc is ambiguous,
>> especially as I *asked* for that key to be returned. IMO it should
>> exist and be empty. Not existing is only OK if I didn't ask for it.
>
> This is how you tell the difference between a basename with a null
> extension ("/path/filename.") and no extension ("/path/filename").
> In the former case you get $info["extension"]=>"", in the latter
> there is no ["extension"] element in the returned array.
OK, this makes sense.
> This does seem like the most logical way to make this distinction,
> but the manual could use a bit of work to document this and other
> edge cases more explicitly.
I may have a go at this if I can find a round tuit.
--
Cheers -- Tim
--- End Message ---
--- Begin Message ---
That would be so extreemely inefficient both resources and bandwidth-wise,
however an interesting thought...
On Jul 27, 2011 4:02 AM, "Pete Ford" <[email protected]> wrote:
> On 26/07/11 18:20, alekto wrote:
>> Hi,
>> is there a way to create a tree menu list only by using php/html/css?
>> I found some, but they are all in JavaScript, do I have to make them by
using JavaScript or is there a way in php as well?
>>
>> This is how I imagine the tree menu should look like:
>>
>>
>> v First level
>> > Second level
>> > Second level
>> v Second level
>> > Third level
>> > Third level
>> > Third level
>> > Second level
>> > Second level
>>
>> (> = menu is closed, v = menu is open )
>>
>>
>> Cheers!
>
> Look, I know this is loopy and I haven't tried it (for the protection of
my
> sanity, mainly), but how about the tree being an image generated using
PHP, and
> then used as an image map to submit the page every time a click is made on
the
> image - you could then use the coordinates of the click to determine the
new
> state of the tree and render an appropriate image for it...
>
> I'll get my coat...
>
> Pete
>
> --
> Peter Ford, Developer phone: 01580 893333 fax: 01580 893399
> Justcroft International Ltd. www.justcroft.com
> Justcroft House, High Street, Staplehurst, Kent TN12 0AH United Kingdom
> Registered in England and Wales: 2297906
> Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17
1XS
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hello, I am just starting out with PHP and I have just created a database named
"Members" with a table named "Persons". There are 5 fields (id,firstname,
lastname, username, password) . The form I created is a sign up form and the
values entered into the form are inserted into the table "Persons", now my
question is how do I create a secure log in system with this new database?
Thanks in advance! :)
--- End Message ---