Posts: 1,168
Name: Dragos-Valentin
Location: Cluj-Napoca, RO
|
that part of code seems corect, i don't know why you add <option value="" selected>select an image...</option>, you can just add it as text before the select box and you woun't have to make sure they don't select it.
any way, back to the problem:
i see you have no submit button, how are you submitting it?
anyway, here is some code you can use as inspiration since i really must leave soon.
PHP Code:
<form name="st_stud" method="post" action="index.php?pagina=cont">
<select name="idpr">
<?
$query = mysql_query("SELECT `username`, `id_user` FROM `dor_useri` WHERE `tip` = 1");
while ($row = mysql_fetch_array($query, MYSQL_ASSOC)) {
?>
<option value="<? echo $row['id_user']; ?>"><? echo $row['username']; ?></option>
<?
}
?>
</select>
<input type="submit" name="stergepr" value="sterge cont profesor">
</form>
PHP Code:
if (isset($_POST['stergepr'])) {
$user = $_POST['idpr'];
echo $user;
}
the $user in the last part will be your image.
than you do an sql update with it.
SELECT url FROM update WHERE name = $user (your image)
than UPDATE profiles .... with the url.
__________________
.
» Please remember to add to my Talkupation if you enjoyed my post. Thank you :)
.
|