SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Thread: Auto Form Fill

  1. #1
    SitePoint Member
    Join Date
    Apr 2002
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow Looking for: Auto Form Fill Script

    I'm looking for a script (js or php) that will take a users browser information and auto fill a submit form with their name, email,etc. by clicking an icon or text.

    Thanks!
    sidmel
    Last edited by sidmel; May 24, 2002 at 08:11.

  2. #2
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have done one before.

    It involves using Active X and is only reliable if you get it signed.

    It worked fine - but did prompt for confiming - and will, as i say, until you get it signed.

    I'm sorry to be a pain - you can ask anyone - i always give away free help ( just check all the help i've given in here ) - but this isn't the kind of thing i do for free - since not many people can / do do it.

    If you want to give it a go yourself, i can at least
    point you in the direction of Active X and WScript tutorials that you'll need.

    Hope this isn't disappointing information.

    You can't access the windows registry (and that's the only store which you can get that info from) without initializing an object on their client.

    Sorry, let me know if you want more info on what i could do for you, or if you want a pointer to some tutorials...

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  3. #3
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If users are likely to be filling the data in on a regular basis, then stored it in a persistent cookie and retrieve it each time you render the form (by using either server-side scripting or client-side JS)!


    M@rco

  4. #4
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Marco's idea is a good one...

    I am assuming this is NOT something you want someone to fill in, but rather just happen in the background, which is why i made the assumption you'd have to get
    their name and email without asking for it.

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  5. #5
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In that case I'd have serious concerns about privacy-type stuff!


    M@rco

  6. #6
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I should be used to you being like that by now

    I wrote a WSH / Active X script to read info from the
    registry in Js a long time ago after Mullie opened the door for me by showing me a vbs version he had.

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  7. #7
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Like what? Whaddyamean?

    You can use the IE-only WScript.Shell object to read the registry if you really have to, but IE won't let it access the registry unless it is in the Local or Trusted zones, AFAIK.

    Code from Windows Scripting CHM:
    Code:
    Dim WshShell, bKey
    Set WshShell = WScript.CreateObject("WScript.Shell")
    bKey = WshShell.RegRead("HKCU\Software\ACME\FortuneTeller\")

    M@rco

  8. #8
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's vbs The tool of the devil!

    Anyway - it will let you access it - but it will just
    prompt first.

    There is a way of getting around it - but it involves
    spawning off a trusted classid, to get the object initiated.

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  9. #9
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    BTW - presumably you're assuming that the user is using Outlook and so you can just pull the email address out of the corresponding registry key. I would have thought that a huge percentage of users do NOT use Outlook (i.e. they use a webmail service or Eudora, TheBat, etc) and so they won't have their email address stored anywhere in their registry.

    Even if they DO have Outlook installed (and are using it for emailing), aren't the registry keys different for different versions? What about Outlook Express?

    (Not to mention the fact that users will be granting access for a web site to directly access information in their registry - that's not going to be very popular)


    M@rco

  10. #10
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually no - i kept AWAY from being email client specific.

    I tried to pull it from the windows registry keys for system.

    I would have THOUGHT that the majority of people didn't keep their email address up to date in there,
    but it seems to be fairly accurate most of the time.

    Now that you mention it - i suppose i could use the
    key for the default email client to find out which they
    use and then look at the keys for that - but that
    would be labourious - and probably involve regexing
    that client's keys for @ - which would prboably even
    fail due to some clients using sub folders for their
    user's key.
    It would also raise the multi-profile problem that i
    encountered first time round.

    You've got to use logic gates anyway to work out what
    system they are using - since the keys are kept in
    different places depending on OS.

    It's not a very good solution - but without notifying them- it's the best solution i can think of for
    getting their personal info.

    I was actually using it for their full address, name,
    email and phone number.

    Difficult situation to try and reliably get through...
    we haven't even brought up the cross browser issues...
    let alone the cross OS notions (which would plainly fail).

    Your thoughts Marco?

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  11. #11
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Although perfectly valid, I suspect that you are barking up the wrong proverbial tree!!

    Sidmel hasn't replied to anything we've posted and his original question is quite ambiguous, but I suspect that he has a form (or many forms) which users will need to fill in frequently, and want to make it as easy as possible for them to do so. Hence previous values should be stored and retrieved when needed, so cookies (or a server-side DB for that matter) would do the job nicely. I don't think that he wants to sniff out personal info from users' computers.

    However, I may be wrong!!

    Sidmel, are you there? are you still alive?


    M@rco

  12. #12
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may well be right Marco.

    I interpretted the quesiton rather, though, to be about how to automatically store the user's browser version and email address for storage in the background... That would make sense to me - anyway.

    We'll just have to see

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---


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
  •