Hallo
nou kijk ik heb zeg maar een formulier gemaakt en dat wil ik dat het naar een gebruiker veld gaat bijvoorbeeld ik log in met admin en ik ga het formulier invullen wil ik het dat het bij de veld admin dan staat in de databse maar nu komt die met zonder naam etc
weet iemand hoe je het doet?
dit is mijn script
nou kijk ik heb zeg maar een formulier gemaakt en dat wil ik dat het naar een gebruiker veld gaat bijvoorbeeld ik log in met admin en ik ga het formulier invullen wil ik het dat het bij de veld admin dan staat in de databse maar nu komt die met zonder naam etc
weet iemand hoe je het doet?
dit is mijn script
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]../config.php[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR] [COLOR= #007700]&& ![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700]))
{[/COLOR]
[COLOR= #0000BB]$aFouten[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bedrijfnaam[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Je hebt geen bedrijfnaam ingevuld[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bedrijf[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000][/COLOR] [COLOR= #007700]|| ![/COLOR][URL="http://www.php.net/is_numeric"]is_numeric[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bedrijf[/COLOR][COLOR= #007700]]))
{[/COLOR]
[COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Je hebt geen bedrijf aangevinkt[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]De volgende fouten zijn opgetreden: <br /><br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Fi[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$Fi[/COLOR] [COLOR= #007700]<[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$Fi[/COLOR][COLOR= #007700]++)
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$Fi[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />Klik <a href="javascript:history.go(-1);">hier</a> om terug te keren[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO gebruikers (bedrijfnaam,bedrijf) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/addslashes"]addslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bedrijfnaam[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bedrijf[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]De gegevens zijn succesvol opgeslagen in de database[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
?>
<form action="" method="POST">
Bedrijfnaam: <input type="text" name="bedrijfnaam"><br />
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Welke regio wil je?[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</br>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<input type="radio" name="bedrijf" value="1">horica<br />[/COLOR][COLOR= #007700];[/COLOR]
?>
<input type="submit" name="verzenden" value="verzenden">
</form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?> 

