Page 3 of 3 FirstFirst 123
Results 21 to 30 of 30

Thread: Select All checkbox

  1. #21
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by ApacheTech View Post
    I've been playing around with $_SERVER( "APPDATA") . "/Mozilla/Firefox/Profiles/########.default/signons.sqlite. If I was going to make a "virus", it'd email that file to an undisclosed address along with a few other files in that directory. Then compile the php script as an exe file and stick it onto a U3 Sandisk USB Drive... homemade USB Switchblade ftw!
    I am no longer opening any attachments by you apache

  2. #22
    Join Date
    Apr 2012
    Location
    Chester, Cheshire
    Posts
    329
    Thanks
    7
    Thanked 35 Times in 35 Posts

    Default

    Haha, don't worry, PHP doesn't work like that. I play around with the grey hat stuff because part of my degree is about ethical hacking. Nothing to worry about on here though. But, really, you shouldn't open any .exe file that a relative stranger sends you online, so you're right to be cautious.

  3. #23
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by ApacheTech View Post
    Haha, don't worry, PHP doesn't work like that. I play around with the grey hat stuff because part of my degree is about ethical hacking. Nothing to worry about on here though. But, really, you shouldn't open any .exe file that a relative stranger sends you online, so you're right to be cautious.
    Point taken, but ethical hacking? As in defining the difference between a white hat and a grey hat hacker? It sounds like ethics just got more fun

  4. #24
    Join Date
    Mar 2011
    Posts
    2,145
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    Without crossing the line... what's $_SERVER( "APPDATA") . "/Mozilla/Firefox/Profiles/########.default/signons.sqlite even do???

  5. #25
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by keyboard1333 View Post
    Without crossing the line... what's $_SERVER( "APPDATA") . "/Mozilla/Firefox/Profiles/########.default/signons.sqlite even do???
    And that keyboard, is where a mystical force called google comes into play.

  6. #26
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I've been busy for a couple days, so I didn't have time to check the forum. Getting back to the original question, there actually IS a way to do this using just PHP. But it won't be pretty.

    The Select All checkbox can trigger PHP to assume all other checkboxes were checked. If (select all), then (assume all checkboxes=files are checked).

    That's fine and not even very hard (assuming you can figure out which list of files was generated on the page). But it won't be nice for the user--

    Only Javascript can actually display it as checking the other checkboxes. So you can "silently"* select all with another checkbox and PHP only. But you can't display this to the user. (Aside from reloading the page/submitting the form, as others pointed out.)

    (*silent as in "silent alarm"-- nothing changes visibly, but then something has been changed on the server.)


    Javascript is the answer here. And with a PHP backup (a "silent Select All") if you want.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #27
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    oh yeah, original question.
    I definitely think that javascript is the way to go here, it's definitely the quickest and easiest way to do this.

  8. #28
    Join Date
    Mar 2011
    Posts
    2,145
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    Just curious dcr33, is there any reason you can't use javascript (assignment, troublesome customer), or do you just not want to? This would definetely be a lot easier with javascript, but not impossible without...

  9. #29
    Join Date
    Apr 2012
    Location
    Chester, Cheshire
    Posts
    329
    Thanks
    7
    Thanked 35 Times in 35 Posts

    Default

    @bernie1227:

    I'll carry this conversation on in PM if you wish, save clogging the forum with tangents. To conclude for the lurkers though, rather than stop mid conversation; ethical hacking is white hat, cracking is black hat and hacking usually is grey or black. It's vague though. Ethical hacking is all about information security, computer forensics and penetration testing.

    @djr33:

    Would this be like a hidden input tag with values of all the checkboxes, which is sent with the form regardless of which are selected. When the form is being processed by the php in the following form, if chkAllFiles is checked, you use the data from the hidden input rather than the checked files list?

    You could make this slightly more "pretty" by adding a button/link saying "or, select all files and continue." This way, at least the user knows they'll be redirected. Although, this may mean using a "checkout" style form if otherr information is needed.

  10. #30
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Right, the Select All value would override all other values in your PHP (or ASP, whatever) while processing it.

    Javascript can change a page while the user looks at it. Nothing else can (unless you want to use Flash, etc.). So the best metaphor I have is the following: send a paper letter to someone asking for information. If you can do it in that, then you can later process the response in PHP.
    So imagine a wedding invitation that asks for food choices:
    []chicken []fish []steak []Select All

    If "Select All" is checked, then assume they want chicken, fish and steak. Ignore the values of those first three checkboxes. That could be done by the wedding planner, or by PHP.


    You could make this slightly more "pretty" by adding a button/link saying "or, select all files and continue." This way, at least the user knows they'll be redirected. Although, this may mean using a "checkout" style form if otherr information is needed.
    My method doesn't involve redirecting. It involves an overriding option. Imagine they checkbox says "Select All below and skip past this section".

    Sure, you could that, and it would be fine. But that would require that there is nothing else to submit on the page-- something John has addressed several times here and is a big problem if there is other data on the page. You can't submit half of a form easily, at least not without redesigning the form.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  11. The Following User Says Thank You to djr33 For This Useful Post:

    ApacheTech (06-20-2012)

Bookmarks

Posting Permissions

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