使用地址栏中的信息填充文本框

I have a page that needs the user to input a promotional code from another page, depending on what choices they make. Now I'm not sure how this is done....or even if it's possible with my lack of knowledge. But I'd like to give it a go.

What I'm trying to do is make the promotional code they click on, link to the registration page, (which basically only asks which code they want to use) but autocomplete the promotional code field textbox with the code that represents their choice. (just so they don't have to copy and paste really.) Heres the form code.

<input type="text" id="registration_code" name="c[registration_code]" {if $badCode}value="{$badCode}"{/if} size="30" maxlength="30" class="field" />

I've tried....

www.mywebsite.com/registration.php?id="registration_code"&name="c[mypromocode]"

AND..

www.mywebsite.com/registration.php?id=registration_code&name=mypromocode

I've also tried a few others.... I'm probably barking up the wrong tree, but I'm sure I've seen this done somewhere?

If the url is generated by JavaScript then you need to format the string correctly:

var url="www.mywebsite.com/registration.php?id="+registration_code+"&name="+c[mypromocode];

It the url is generated by php then use:

$url="www.mywebsite.com/registration.php?id=".$registration_code."&name=".$c[mypromocode];