PDA

Click to See Complete Forum and Search --> : Auto-Fill forms on destination page (link)


Skootles
Jan 19th, 2006, 02:41 PM
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 :)

penagate
Jan 20th, 2006, 06:41 PM
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:
<a href="vote.php?name=Fred">Vote for Fred</a>

and on the vote.php page
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.

Skootles
Jan 22nd, 2006, 01:14 PM
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 ?)

penagate
Jan 22nd, 2006, 07:03 PM
an ampersand &

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

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