Hi everyone,
I have pulled data from mysql into an select list in my admin area.
$query="SELECT id, linklabel FROM pages ORDER BY id ASC";
[I]//I am not sure if the form should be like this...?[/I]
'<form name=test id=test action=edit_page.php method=post>';
$result = mysqli_query ($myConnection, $query);
echo "<select class=\"boxstyles\" name=linklabel=''>Choose a page to edit</option>";
[I]// printing the list box select command[/I]
while($nt=mysqli_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[id]>$nt[linklabel]</option>";
[I]// Option values are added by looping through the array[/I]
}
echo "</select>";// Closing of list box
'</form>';
?>
So..now the values are inside the listbox, and the next thing I want to do is, when a value is clicked, I want to redirect to an edit_page.php, where I have a form for editing the page.
The form should be prepopulated with the current text and information in the different form fields.
I am just not sure how to grab the selected value from the select box, and the relevant information from the chosen value in the list box, and display it in the form fields in: edit_page.php
I am at a learning stage, so I hope you will bear with me, if this is a silly question :-)
Looking forward to hearing from some of you!
Regards,
Jan