Jump to content

question relating to php


kamal213

Recommended Posts

Hi guys,

 

Is it possible for a text field on a website to be auto-filled based on what is held within a document locally?

 

For example if we had address.txt on the desktop of a computer is it possible to create a web form to capture what is contained within that file and auto-fill a field?

 

Thanks alot!

Link to comment
Share on other sites

If you are looking for a way for visitors to easily auto-fill a form on your site based on a local file, you can make a "step 1" or "first form field" be a file input field for the visitor to upload the file.  Have it post with ajax and then use server-side script to parse the file and send back the form field values and pop the form field values.  This will keep the visitor on the same form page with minimal effort on their end. 

 

That's really the best you can do, other than what nogray mentioned (which is not something you wanna do).  It is a security feature/limitation; servers shouldn't be allowed to grab arbitrary stuff off a client's computer.  The only client storage the server has access to are cookie files for reading/writing cookies.  And even then it's not direct access.  HTML5 does promise expanded client-side storage abilities, but a) considering peoples' paranoia about cookies, who knows if it will ever really happen b) it still wouldn't be access to arbitrary files on the clients.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.