Jump to content

Archived

This topic is now archived and is closed to further replies.

nimbus

Pre-populated forms from query string

Recommended Posts

Hi,

I am trying to create a form with some hidden fields which become populated with information from the URL.

For example, the URL would be [a href=\"http://www.blahblah.com/form.php?email=client@us.com\" target=\"_blank\"]http://www.blahblah.com/form.php?email=client@us.com[/a]
And from this the email field within the form is populated with their email address.

I think this is quite a simple thing to do but i can't seem to find any examples of it elsewhere. I know how to create a form etc in PHP, but just want to be able to prepopulated fields!

Many many many thanks in advance!!

justin

Share this post


Link to post
Share on other sites
short and sweet version:

<?php

echo "<form>";
echo "<input name='email' value='".$_GET['email']."'>";
echo "</form>";

?>

the key thing there is the value='blah' that's what puts the text into the field

Share this post


Link to post
Share on other sites

×

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.