Forum Moderators: phranque

Message Too Old, No Replies

Automatically filling in form field...

when someone clicks a link to the form

         

verbatim

12:39 am on Mar 22, 2004 (gmt 0)

10+ Year Member



I have a form that i would like to have friends put a link to at the bottom of their emails.

When someone clicks on the link, in the referred by field on the form i would like the name of the person who had the link in their email to appear.

For example, if Sally sends a email to Jim with a link to my site - I would like Sally's name* to appear in the refered by field automatically.

*If not her name, her email address or something that i can link back to her.

How would i go about doing that?

Any help given would be greatly appreciated.

Thanks

grahamstewart

9:28 am on Mar 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Verbatim, Welcome to WebmasterWorld.

You would need to give each person a different link.
Something like this would work..


<a href="http://www.example.com/theform.php?referrer=sally">My Form</a>
<a href="http://www.example.com/theform.php?referrer=bob">My Form</a>
<a href="http://www.example.com/theform.php?referrer=jim">My Form</a>
..etc..

..then the server side script to generate your form would take the 'referer' value, make sure it made sense and then plug it into the value attribute of the appropriate input control, like this...


<input type="text" name="refferer" value="sally">