Results 1 to 4 of 4

Thread: Auto-Fill forms on destination page (link)

  1. #1

    Thread Starter
    Member Skootles's Avatar
    Join Date
    Jul 2005
    Posts
    34

    Auto-Fill forms on destination page (link)

    I've seen this done before on some webpages. There is a link to another page, and when you click on the link, it automatically fills out the forms on the destination page with information.

    For example, the site I saw it on linked to a "vote for this site" page on another website, and when you clicked on it, it would automatically put the website's url in a form that asked what site you wanted to nominate. I can't remember the exact syntax.. so if someone could help, that'd be awesome

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Auto-Fill forms on destination page (link)

    Most likely HTTP Post or Get parameters, which are then used by the target page (which would have to use some form of server-side scripting) to fill out the form.

    For example if you use the GET method and PHP you could do this with your link:
    HTML Code:
    <a href="vote.php?name=Fred">Vote for Fred</a>
    and on the vote.php page
    PHP Code:
    Vote for: <input type="text" name="name"><?php echo($_GET['name']); ?></input>
    Just a rough example. You'd need server-side scripting for it anyway.

  3. #3

    Thread Starter
    Member Skootles's Avatar
    Join Date
    Jul 2005
    Posts
    34

    Re: Auto-Fill forms on destination page (link)

    Ok, well thanks, that works perfectly
    One other thing though, how would you fill out more than one (what do you use to seperate the "?whatever=whatever" 's ?)

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Auto-Fill forms on destination page (link)

    an ampersand &

    But in the HTML/XHTML code you will need to represent it using &amp;

    so
    HTML Code:
    <a href="vote.php?first=Fred&amp;second=Ted">Vote #1 Fred, #2 Ted</a>

Posting Permissions

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



Click Here to Expand Forum to Full Width