Messaging issues!
<p>I have a functioning messaging script.
What I am trying to do is allow 2 extra things.</p>

<p>One is a message me button.
Second is the reply feature.</p>

<p>When a user sends a message, they select them from the dropdown box.
So its like <code>&lt;option value ="id"&gt;</code> and it displays the username.</p>

<p>When using a message me button, I assume I need to post the username and select it from the list.
When replying, again I post the username and it selects it from the list?</p>

<pre><code>&lt;form method='post' action='&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;?p=new'&gt;
    &lt;input type='hidden' name='rfrom' value='&lt;?php echo $row['username']; ?&gt;' /&gt;
    &lt;input type='hidden' name='rsubject' value='Re: &lt;?php echo $row['title']; ?&gt;' /&gt;
    &lt;input type='hidden' name='rmessage' value='Re: &lt;&lt;?php echo $row['message']; ?&gt;&gt;' /&gt;
    &lt;input type='submit' name='reply' class="button" value='Reply' /&gt;
&lt;/form&gt;
</code></pre>

<p>This is the reply code. As you can see, I pass the username through as <code>$_POST['rfrom']</code></p>

<p>I came up with the following code to select the user from the list.</p>

<pre><code>$fromname=(isset($_POST['rfrom'])) ? $_POST['rfrom'] : ''; //ought to validate $_POST
$selected=($u==$fromname) ? 'selected="selected"' : '';
echo "&lt;option value='$uid'&gt;$u&lt;/option&gt;"; 
</code></pre>

<p>This doesn't work and when I click Reply, I just get the first user on the list.</p>

<p>Also, could someone confirm if I could use the id to do this instead of the username?
It would be easier when using the button to send a new message from a user's profile.</p>

<p>Thankyou for reading, I hope you can help!</p>

<h3>EDIT</h3>

<p>I am now passing the user id through using <code>$_POST['rfrom']</code>.</p>

<p>The user id will be the option value.</p>

<p>Still, I cannot get the correct user to be selected in the list.</p>

<p>Someone please help!</p>
