Hello everybody,
I'm stuck with this and I hope there is somebody who can help me.
I have a Form
<html> <form action="" method="POST"> <input type="text" name="credentials[firstname]"> <input type="text" name="credentials[lastname]"> <input type="text" name="credentials[email]"> <input type="text" name="game[points]"> <input type="text" name="game[wins]"> <input type="submit" name="submit"> </form> </html>
and I want to post the values of this array to mysql
The array look like this when I insert some stuff
Array
(
[credentials] => Array
(
[firstname] => rute
[lastname] => dkp
[email] => mail
)
[game] => Array
(
[points] => 12
[wins] => 99
)
[submit] => Query verzenden
)
but the script only prints the credential parts.
this is the script
<?php
print "<pre>";
print_r($_POST);
print "</pre>";
if (isset($_POST['credentials'])){
$myvalue = $_POST['credentials'];
foreach ($myvalue as $value){
echo $value;
}
}
?>
What did I try?
I also tried
if (isset($_POST['credentials']['game'])){
$myvalue = $_POST['credentials']['game'];
foreach ($myvalue as $value){
echo $value;
}
But then the values won't print. I see the right output in the array though.
I hope someone can help me.
I don't have the insert statement yet.
Thanks
Rem