Saving $_SESSION['MM_adUser'] in MySQL
<p>I built a site in Dreamweaver a while ago and have revamped it to 'version 2'
I managed to get user log-in to authenticate with Active Directory and have added $_SESSION['MM_adUser'] for their full AD name.</p>

<p>This seems to work fine as adding:</p>

<pre><code>&lt;?php $_SESSION['MM_adUser']; ?&gt;
</code></pre>

<p>to the page, shows the users full name in the browser .. ie: John Smith</p>

<p>However, i now want to insert this into MySQL, so i added to the bottom of the page (with some other misc variables):</p>

<pre><code>&lt;input name="SavedBy" type="hidden" value=&lt;?php $_SESSION['MM_adUser']; ?&gt; /&gt;
</code></pre>

<p>but it only inserts the users first name! Removing type="hidden" does indeed show it on the page as only their first name.</p>

<p>Question is, why the change? Why is it losing the last name? 
I'm guessing it has something to do with whitespace as this came up in an error when trying various fixes, but, alas, i can't fix it :(</p>

<p>Any ideas, please?</p>
