Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: ryanbsoftware - helmikuu 26, 2005, 02:53:13 AP

Otsikko: Fill in field
Kirjoitti: ryanbsoftware - helmikuu 26, 2005, 02:53:13 AP
I have a custom profile field you can only fill out when registering an account, i was woundering if instead of /index.php?action=register the url could be /index.php?action=register&something=valule of field

to load the page with a field valude, i want this cause i use ['profile_refered_by'] and it is for the username of who refered you, this way someone could give you a link when refering you that fills that out with their username, so the new users dosen't have to search for it, cause i want username, not display ame for a custom query a friend who knows php is writing to reward you when you refer so many people.
Otsikko: Re: Fill in field
Kirjoitti: andrea - helmikuu 26, 2005, 03:19:11 AP
Sure you can do this. Simply modify your template such that your desired GET variable $_GET['something'] is interpreted.
Otsikko: Re: Fill in field
Kirjoitti: ryanbsoftware - helmikuu 28, 2005, 12:52:45 AP
ok so that tells me its possible, here is my code for the field, but i see their is something under valuse, so how would i do that

use $_GET['rf']

so the text bvox will display whatever referer is in the url which will be the userid.

<tr>
   <td width="40%"><b>Refered By: </b><br \> <div class="smalltext">use member id, leave empty if not refered by anyone.</div></td>
<td><input type="text" name="default_options[profile_refered_by]" size="30" value="', @$context['member']['options']['profile_refered_by'], '" /></td></tr>
Otsikko: Re: Fill in field
Kirjoitti: ryanbsoftware - helmikuu 28, 2005, 10:44:02 AP
ok so will it work if i replace what is in the valoude field with the _GET, like this?

<tr><td width="40%"><b>Refered By: </b><br \> <div class="smalltext">use member id, leave empty if not refered by anyone.</div></td>
<td><input type="text" name="default_options[profile_refered_by]" size="30" value="', $_GET['rf'], '" /></td></tr>
whats was that in the value field? and why was it their?