Need user's form entries to auto-fill subsequent forms...

  • antiskeptic
  • Born
  • Born
  • antiskeptic
  • Posts: 1
  • Loc: Houston

Post 3+ Months Ago

I am working on a site with mulitiple links to outside sources. When clicked, these links open a form for accessing the linked URL. The form requests a name and e-mail address, then on submit the link opens. Presently the user must re-enter their name and e-mail info each time they click a link that opens a form. I'd prefer for the forms to auto-fill with the data the user entered the first time. These are all separate forms leading to separate URLs.

Is there a way to make the user data persistent through the forms, so the data need only be entered once?

I have cgi-bin access, and presently run a perl-based form handler. Unfortunately it doesn't provide what I'm looking for.

Thanks for any assistance!

  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3423
  • Loc: Richland, WA

Post 3+ Months Ago

Well i have no idea how to use CGI, i use php and its really quite easy to do what your trying to do and you might even be able to do it with CGI but not sure.
you could use cookies with php or you can use a url datatransfer$name&email=$email
thats in php i dont know what the symbol for varibles in CGI is
you might be able to do that with CGI, im guessing you can.

Code: [ Select ]
<form action='otherpage.tag?name=$name&email=$email method='post'>
<input type='text' name='name' value='$name'>
<input type='text' name='email' value='$email'>
<input type=button value='Submit'>
  1. <form action='otherpage.tag?name=$name&email=$email method='post'>
  2. <input type='text' name='name' value='$name'>
  3. <input type='text' name='email' value='$email'>
  4. <input type=button value='Submit'>
  5. </form>

if you put that as all your forms (with changing the varible symbol what ever info is in the url for name will be put into the feild for name and same for email
hope that help not sure if thats quite what u wanted but atleast its something if you dont understand post again for you can talk to me on aim

  • Carnix
  • Guru
  • Guru
  • User avatar
  • Posts: 1098

Post 3+ Months Ago

If the forms are on seperate domains ( and, for example), then cookies will not work, unless you make use of an exploit... which you shouldn't do. If not, use cookies to populate the form data.

I don't know exactly how cookies are passed, but I'm sure they're in the of the ENV hash somewhere. If you're submitting from a PHP page to a CGI form processor (which, I might add, is pretty silly... in my opinion), you can pull the cookies with PHP, and add them to either the querystring or the HTTP form request (in the form of hidden fields). Neither is particularly secure, but then again, it probably doesn't much matter unless you're doing something sensitive (of so, and you're using cookies, make sure to encrypt the data being written to the cookies before setting them.. actually.. encrypting the cookie data is a good practice either way).

If users are required to login, then you already know who they are and you can set a Session or cookie (or both) to maintain persistence... Anyway, there are a large number of ways to do session-scope stuff, some builtin to the server, some not... How you have to do it will vary based on the technologies you're using.

  • stevegmag
  • Novice
  • Novice
  • User avatar
  • Posts: 29
  • Loc: Washington DC

Post 3+ Months Ago

Are you just trying to grab names and emails and forwarding to the urls?

Do you just want to be nice and store this info for the user for later requests?

or are you passsing this data to the new pages as a login?

why multiple forms?

In any event there are several ways to handle this...

1) use cookies.... don't need anything other than javascript to read and write cookies... but can use any scripting language

2) if you have assess to session variables you can pass this data from page to page and do with it what you will on the new page

3) use the url to pass info link?name=[name]&email=[email], then you can use any scripting lang to get that info from the url

using one form...
again this can be done in javascript or whatever scipt language you have access to... you can populate the form's action dynamically on request and also populate hidden fields that get sent along to the new page for processing.

hope this helps,

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 54 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.