Jump to content

how to add item to "select" in html form


aldm

Recommended Posts

Hi,

I'm building one application with HTML, CSS and PHP. In this web application, I have a form for

creating new member and form with list of members, where member should be selected from the "select" element in html form, and then informations about that member can be viewed.

How can I add member's name and surname to "select" when I'm creating him, on form for view member's profile?

Thanks in advance

Link to comment
Share on other sites

  • 5 weeks later...

<?php

//first you have to know really about mysql and php

//connect to your database and don't forget user session

//get your data using fetch array based on user session

//Let say that your array is being stored inside '$array'

 

$myrecordfromdatabase = $array['record_kept_in_database'];

?>

<select name="choose"><option value='check1' <?php if($myrecordfromdatabase=='check1'){

echo "SELECTED";}else{

 }>

 

hope it could give you some hints

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.