I have NO idea what is wrong.
I'm a PHP n00b and I'm trying to have a user click a drop down menue and choose a client. Then they hit "edit" and it takes them to editprofile.php?CID=[insert the correct ID here]. That's all I'm trying to do.
I had it so it was working, but it would only bass editprofile.php?CID=1 for any choice.
Here is my code for the index page:
<form name="edit" method="post" action="editprofile.php?CID=<?php echo $CID; ?>">
<p>EDIT EXISTING ACCOUNT<br>
<select name="editclient" id="editclient" MM_jumpMenu('parent',this,0)>
<?php
$query = mysql_query("SELECT * FROM clients ORDER BY CNAME");
$n = mysql_num_rows($query);
$x = 0;
while( $n > $x){
$row = mysql_fetch_array($query);
$CNAME = $row['CNAME'];
$CID = $row['CID'];
echo "<option value=\"$CID\">$CNAME</option>";
$x++;
}
?>
</select>
<input name="edit" type="submit" id="edit" value="Edit">
</form>
Now, I know there is no variable defined for the first $CID at the top... but I don't know how to define it. I know it's a simple task, but I dont get how.
Any help?
Also, I'm confused as to what to put in the
echo "<option value=\"$CID\">$CNAME</option>"
part... For the value, I mean.