Hello everyone, I am using php-mysql.
The scenario is I have a member database.
After login, it will shows the search member webpage which I have done so.
After I search, it will shows a member list who meet the search criteria on the new page.
The code of this page is shown below.
From this page, I only need 2 functions.
First, when I click the member name button, it will shows the full profile of that particular member on the other page (I have done this page).
For this function, I just do not know how to get the respective member id.
For second function, I want to choose the members’ phone number who I want to contact and shows it on the new page.
For this function, I do not know how to gather the selected phone number and shows it on the new page.
Hope everyone is understand my scenario.
Remarks: htmlout = htmlspecialchars function,
I use index.php to write all the php code function and use member.html.php to show the webpage.
Any help would be much appreciated. Thank you very much.
<table><form action="?" method="post">
<?php foreach ($rows as $row): ?>
<tr>
<td width="300"><input type = "hidden" name = "id" value = "<?php htmlout($row['ID']); ?>">
<input type = "hidden" name = "action" value = "viewprofile">
<input type = "submit" value = "<?php htmlout($row['Name']) ?>"></td>
<td width="300"><fieldset>
<legend>Phone</legend>
<div><label for="row<?php htmlout($row['Phone']);?>">
<input type="checkbox" name="selectedphone[]"
id="row<?php htmlout($row['Phone']); ?>" value="<?php htmlout($row['Phone']); ?>"><?php htmlout($row['Phone']); ?></label></div>
</fieldset></td>
<td width="300"><?php htmlout($row['Currentstatus']) ?></td>
<td width="300"><?php htmlout($row['Gender']) ?></td>
<td width="300"><?php htmlout($row['Race']) ?></td>
<td width="300"><?php htmlout($row['Nationality']) ?></td>
<td width="400"><?php htmlout($row['Birthday']) ?></td>
<td width="550"><?php htmlout($row['Address']) ?></td>
<td width="400"><?php htmlout($row['University']) ?></td>
<td width="400"><?php htmlout($row['Coursemajor']) ?></td>
</tr>
<?php endforeach; ?>
</form>
<tr>
<form action="?" method="post">
<td><div align="center"><input type = "hidden" name = "action" value = "phonenumber">
<input type = "submit" value = "Phone Number"></div></td>
</form>
<td>
<form action="?" method="post">
<div align="center"><input type = "hidden" name = "action" value = "anothersearch">
<input type = "submit" value = "Another Search"></div>
</form>
</td>
</tr>
</table>