I have a page called projects.php to let the users submit their bid information via form. When the user is logged in, he can submit this form. But am not able to find out which user has applied to the job unless I specify a username field in the form itself. Each user has to write his username while submitting this form to let me know they have submitted it. I have mysql set up, where the username is stored. How to connect the username automatically when the user is submitting this form without having to enter his username when logged in.
<form id='contactus' action='<?php echo $formproc->GetSelfScript(); ?>' method='post' enctype="multipart/form-data" accept-charset='UTF-8'>
<fieldset >
<legend>Apply to work</legend>
<input type='hidden' name='submitted' id='submitted' value='1'/>
<input type='hidden' name='<?php echo $formproc->GetFormIDInputName(); ?>' value='<?php echo $formproc->GetFormIDInputValue(); ?>'/>
<input type='text' class='spmhidip' name='<?php echo $formproc->GetSpamTrapInputName(); ?>' />
<div class='short_explanation'>* required fields</div>
<div><span class='error'><?php echo $formproc->GetErrorMessage(); ?></span></div>
<div class='updown'>
<label for='username' >User Name*:</label><br/>
<input type='text' name='username' id='username' value='<?php echo $fgmembersite->SafeDisplay('username') ?>' maxlength="50" /><br/>
<span id='login_username_errorloc' class='error'></span>
</div>
<div class='container'>
<label for='title'>Work Title*: </label><br/>
<input type='text' name='title' id='title' value='<?php echo $formproc->SafeDisplay('title') ?>' maxlength="50" /><br/>
<span id='contactus_title_errorloc' class='error'></span>
</div>
<div class='container'>
<label for='bid value'>Bid value ( INR )*:</label><br/>
<input type='number' name='bid' id='bid' value='<?php echo $formproc->SafeDisplay('bid') ?>' maxlength="50" /><br/>
<span id='contactus_bid_errorloc' class='error'></span>
</div>
<div id="sample">
<label for='Bidtext'>Cover letter or Bid Text*:</label><br/>
<textarea name="Bidtext" style="width: 500px; height: 200px;" value='<?php echo $formproc->SafeDisplay('Bidtext') ?>'> </textarea>
<span id='contactus_Bidtext_errorloc' class='error'></span>
</div>
<div class='container'>
<label for='resume'>Upload file:</label><br/>
<input type="file" name='resume' id='resume' /><br/>
<span id='contactus_resume_errorloc' class='error'></span>
</div>
<div class='container'>
<input type='submit' name='Submit' value='Submit' />
</div>
</fieldset>
</form>
After submission I get all values of the form except not knowing who filled the form.