Hi,

I have a few issues, my first is how would I go about adding in here so that if you're not logged in when you enter your name it would automatically add guest_ to it and when you're logged in it sets your username as it and you cannot change it.


I use the following to get usernames when logged in and below that is my form to submit a comment:


Just let me know what else is needed and I can provide.

PHP Code:
<?php

if($session->logged_in){
   echo 
"$session->username";
}
else{

echo 
"Guest";

}
?>

PHP Code:
<form name=\"submitcomment\" method=\"post\" action=\"submitcomment.php\" onSubmit=\" return form_Validator(this)\">
<table width=\"100%\">
        <tr>
                <th colspan=\"2\"><h3 class=\"formtitle\">Leave a comment:</h3></th>
        </tr>
        <tr>

                <th scope=\"row\"><p class=\"req\">Name:</p></th>
                <td><input class=\"form\" tabindex=\"1\" id=\"name\" name=\"name\" /></td>
        </tr>
        <tr valign=\"top\">
                <th scope=\"row\"><p class=\"req\">Comment:</p><br /></th>
                <td><textarea class=\"formtext\" tabindex=\"4\" id=\"message\" name=\"message\" rows=\"10\" cols=\"50\"></textarea></td>
        </tr>

        <tr>    
                <td>&nbsp;</td>
                <td><input type=\"submit\" name=\"post\" class=\"submit\" value=\"Submit Comment\" /><br />
                <p>Note: Any inappropriate content will be deleted. </p>


</td>
        </tr>
</table>
<input type=\"hidden\" name=\"comurl\" value=\"
$comurl\" />
<input type=\"hidden\" name=\"comid2\" value=\"
$comid2\" />
</form> 


My second thing is I am unsure about how to go about having a date be set upon registration of users. The main reason I wanted this if it seemed easiest in my mind that I could have "Our newest member is: query for username by date, etc but if there is a better way to go about that and the registration date isn't needed just tell me. I thought I had the date going but every time it would just add the default to the database so i removed all of that for now but I can easily re add it.



Thank you very much in advance for any help that is provided.