Hallo,
Ik heb dus iets met;
invullen => button => volgend invullen => uitvoeren
Het is een beetje moeilijk om het te verwoorden, maar hij voert de
elseif (isset($_POST[verander_naam]))
Niet uit.
Dus eerst vraag ik van welk lid de beheerder iets wilt aanpassen, en dan wat hij wilt aanpassen.
Dan na de keuze, komt de form. Als je dan de form hebt ingevuld, van naar welke gebruikersnaam je het wilt veranderen, springt hij direct terug naar het ding van wie wil je aanpassen etc.
Als je het wilt zien;
http://sander.freux.nl/
Login:
Sander
test
(hooflettergevoelig)
=> Klik op de link (Beheerders-Paneel)
=> Klik op de link (Lid aanpassen)
Daar zie je het
Ik hoop dat ik het goed uitlegde en dat iemand mij kan helpen? Bedankt
Ik heb dus iets met;
invullen => button => volgend invullen => uitvoeren
Het is een beetje moeilijk om het te verwoorden, maar hij voert de
elseif (isset($_POST[verander_naam]))
Niet uit.
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL] [COLOR= #DD0000]../config.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user_aanpas[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wat_aanpas[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wat_aanpas[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"username"[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT username FROM leden WHERE username = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user_aanpas[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$show[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$show_it[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$show[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Naam op dit moment:<b>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$show_it[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</b>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<form action="#" method="post">
<input type="text" name="verander_naam">
<input type="submit" value="Verander naam">
</form>
[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verander_naam[/COLOR][COLOR= #007700]]))
{[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR][COLOR= #DD0000]"
UPDATE
werknemers
SET
username = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verander_naam[/COLOR][COLOR= #007700]])).[/COLOR][COLOR= #DD0000]"
WHERE
voornaam = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user_aanpas[/COLOR][COLOR= #007700]])).[/COLOR][COLOR= #DD0000]"
"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$res[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]().[/COLOR][COLOR= #DD0000]<br />In query: [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_affected_rows"]mysql_affected_rows[/URL][COLOR= #007700]() ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Geen records gewijzigd. <br />Query: [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Update was succesvol![/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000] Geen andere functies mogelijk als username aanpassen[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
?>
<form action="#" method="post">
Welke user wil je aanpassen?<input type="text" name="user_aanpas"><br/>
Wat wil je aanpassen?
<select name="wat_aanpas">
<option value="username">username</option>
</select>
<input type="submit" value="Verder">
</form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?> Dus eerst vraag ik van welk lid de beheerder iets wilt aanpassen, en dan wat hij wilt aanpassen.
Dan na de keuze, komt de form. Als je dan de form hebt ingevuld, van naar welke gebruikersnaam je het wilt veranderen, springt hij direct terug naar het ding van wie wil je aanpassen etc.
Als je het wilt zien;
http://sander.freux.nl/
Login:
Sander
test
(hooflettergevoelig)
=> Klik op de link (Beheerders-Paneel)
=> Klik op de link (Lid aanpassen)
Daar zie je het
Ik hoop dat ik het goed uitlegde en dat iemand mij kan helpen? Bedankt




