close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Populating a form field from a recordset

Thread began 9/17/2009 4:32 pm by troyd | Last modified 9/20/2009 2:40 am by troyd | 2110 views | 6 replies



If I understand you right, you have a page that has records that someone could click a "contact" link and then you would have Universal Email grab the data from that row and input it to your email.

But now, you are going to have them click your link and now go to the form so they can use a form to fill out the info. And furthermore, you want a particular field from the database to populate the subject field in that form?

If that is right, you could do it one of two ways. If you just need the subject, you can have your link carry the data in the URL. So in your table your a href address for your link would be something like "contact_form.php?subject=$_row['subject']".

And then on contact_form, you would then first check to see if the URL variable exists (at the top of your page)... if it does, you then set the value into another variable like this:

if ($_GET['subject']) {
$formsubject = "$_GET['subject']) ;
} else {
$formsubject = "" :

Notice, I used an else statement to set the variable equal to nothing if the URL variable didn't exist... then in your form, you can just set the initial value as <?php echo $formsubject; ?>.

The other way to do it would be to pass the ID through the URL method as described above and then query for a recordset using the WHERE clause to get the fields you need.



Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...