Hi,
Been trying to do this for a while, but not getting anywhere!! Tried to search for it but nothing.
I'm new to PHP so apologies now for errors:
Trying to create a form; when the users selects his/her username from the drop down list the textbox below populated the users email address.
The information is stored in a MySQL DB called helpdesk_test, table called name userdetails.
The table holds:
Userid
username
ufirstname
usurname
uemail
I probably have to code some javascript, but dont know how to!
Can someone help please?
Thanks
My PHP, so far....
<?php
/* Get all the required files and functions */
include('connectionstring.php');
$db2=mysql_connect($MySQLServerName2, $MySQLUserName2, $MySQLPassword2);
mysql_select_db($MySQLDBName2,$db2);
?>
<form method="POST" action="submit_ticket.php" name="form1" enctype="multipart/form-data">
<table border="0" cellspacing="0" cellpadding="5" size="750">
<tr>
<td>
<!--<input type="text" name="name" size="25" maxlength="30"></td>-->
<!-- Contact info -->
<table border="0">
<tr>
<td align="right" width="150"><?php echo $hesklang['name']; ?>: <font class="important">*</font></td>
<td align="left" width="600"><select name="name">
<?php
$query = ("SELECT * FROM `userdetails` order by `userid`");
$DatabasecountQuerys = mysql_query($query,$db2);
while ($row = mysql_fetch_array($DatabasecountQuerys))
{
echo "<option value='$row[0]'>$row[1]</option>";
}
?>
</select>
</tr>
<tr>
<td align="right" width="150"><?php echo $hesklang['email']; ?>: <font class="important">*</font></td>
<td align="left" width="600"><input type=text name="email" size="50" maxlength="80"></td>