'php' and 'responsive web design'. How do you make the 2 things work together?? - Page 2
Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26

Thread: 'php' and 'responsive web design'. How do you make the 2 things work together??

  1. #16
    Senior Member Paul help!'s Avatar
    Join Date
    Aug 2013
    Location
    Manchester, England.
    Posts
    251
    Thanks guys.

    I just wanted to ask something.

    I can't seem to edit my original post at the top of this thread.

    I just wanted to remove the link to my clients website.

    For some reason there is no option to edit it.
    Last edited by Paul help!; 06-19-2017 at 08:36 PM.

  2. #17
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    14,888
    There's a grace period of some length, after which you cannot edit it. (I do not know how long it is.)

    I'll go delete the link now.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #18
    Senior Member Paul help!'s Avatar
    Join Date
    Aug 2013
    Location
    Manchester, England.
    Posts
    251
    Thanks man.

    I was just wondering (because I am kind of nosey).

    There are some really familiar people on here, like yourself (NogDog) and others like 'weed packet' and 'laserlight'.

    I was just wondering. Do you guys work for phpbuilder (this website)?

  4. #19
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    14,888
    We're volunteer (i.e. unpaid) moderators here. If you see anyone with something about "admin" under their name, they probably work for the company that owns this site.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  5. #20
    Senior Member Paul help!'s Avatar
    Join Date
    Aug 2013
    Location
    Manchester, England.
    Posts
    251
    I just need to ask.

    Does:

    basename($_FILES['file']['tmp_name']);

    ... and:

    basename($_FILES['file']['name']);
    ... ultimately return the same thing?


    Also, it looks to me like the input (file type) element can only hold one file:

    PHP Code:
    <input type='file' name='userfile[]'>
    <
    input type='file' name='userfile[]'>
    <
    input type='file' name='userfile[]'
    .... judging by the illustration code you sent me earlier (extract above) in the post.

    Is there no way of only using one input element and selecting multiple files (images) when the browse window pops up (instead of having to use multiple 'input elements' for each individual image I want to upload)?
    Last edited by Paul help!; 06-20-2017 at 03:55 PM.

  6. #21
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    14,888
    Quote Originally Posted by Paul help! View Post
    I just need to ask.

    Does:




    ... and:



    ... ultimately return the same thing?
    Probably, but not 100% sure if there would ever be a discrepancy -- nor if it matters which you use.

    Also, it looks to me like the input (file type) element can only hold one file:

    PHP Code:
    <input type='file' name='userfile[]'>
    <
    input type='file' name='userfile[]'>
    <
    input type='file' name='userfile[]'
    .... judging by the illustration code you sent me earlier (extract above) in the post.

    Is there no way of only using one input element and selecting multiple files (images) when the browse window pops up (instead of having to use multiple 'input elements' for each individual image I want to upload)?
    Yes, I'm pretty sure there is a way -- but I'd have to Google it, too. And my first result is: http://php.net/manual/en/features.fi...d.multiple.php
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  7. #22
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Running Gear"
    Posts
    22,544
    Well, yes, there is a difference; as described in features.file-upload.post-method; name is the name the file the user had given it before uploading it. But the server saves all uploaded files in a temp directory until you (through your application) decide what to do with them, and if two people upload a file called "bike.png" at the same time then one would trash the other. Not good. So the server saves each file in the temp directory with a distinct temporary name that won't clash with any already in the temp directory. That name is provided to you in the tmp_name field.



    HTML5 does offer a "multiple" setting for its file input fields, but HTML 4 didn't, and I don't know if the developers have got around to updating PHP's handling (since the page dalecosp and NogDog link to don't mention anything about it, in the absence of anything else in the manual to the contrary, I'll surmise not).
    Last edited by Weedpacket; 06-20-2017 at 07:15 PM.
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  8. #23
    Senior Member
    Join Date
    Apr 2016
    Posts
    131
    Is there no way of only using one input element and selecting multiple files (images) when the browse window pops up (instead of having to use multiple 'input elements' for each individual image I want to upload)?
    Actually, yes. If you make the single upload field name an array, with the [] on the end of it, in the file browse dialog/selection box, you can select multiple files using either the control or shift key and clicking or by clicking and dragging. I don't recall if the 'multiple' keyword is needed in the form field tag. This may also be browser specific and I don't know off of the top of my head which current browsers support it. The form processing code is the same as for multiple upload fields using one array name.
    Last edited by pbismad; 06-20-2017 at 07:24 PM.
    Programming should not be a painful activity. If you are experiencing pain while programming, you are probably doing something wrong.

  9. #24
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    8,525
    Quote Originally Posted by pbismad View Post
    Actually, yes. If you make the single upload field name an array, with the [] on the end of it, in the file browse dialog/selection box, you can select multiple files using either the control or shift key and clicking or by clicking and dragging. I don't recall if the 'multiple' keyword is needed in the form field tag. This may also be browser specific and I don't know off of the top of my head which current browsers support it. The form processing code is the same as for multiple upload fields using one array name.
    Yes; the tag would be something like:

    Code:
    <input type='files' multiple name='foobar'>
    A quick test shows Ffox and Chrome support; no reason to suspect it's not present in other browsers as this was present in the HTML5 working specs six years ago.
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  10. #25
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Running Gear"
    Posts
    22,544
    And - just checking the HTML5 spec - I see that <input type='file' multiple name='foobar'> is equivalent (as far as the submission itself is concerned) to having multiple <input type='file' name='foobar'> fields (see step 7).
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  11. #26
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    8,525
    Quote Originally Posted by Weedpacket View Post
    And - just checking the HTML5 spec - I see that <input type='file' multiple name='foobar'> is equivalent (as far as the submission itself is concerned) to having multiple <input type='file' name='foobar'> fields (see step 7).
    Good catch! In my position I'd just code it and test it quickly to learn that. On the other hand, it's nice to have specs ... hey, you could write a browser from reading all that!
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •