[HELP]Getting values from mulitple textbox using array
Posted: Wed Jan 26, 2011 8:21 pm
Hey guys I'm trying to get the values from 2 text and put it in 1 array and display it.
I cant figure out whts wrong with my code, any suggestion or ideas will help a lot thanks
I cant figure out whts wrong with my code, any suggestion or ideas will help a lot thanks
Code: Select all
<html>
<head>
</head>
<body>
<?php
$try_array = array($_POST['name[]']);
foreach ($try_array as $try){
echo $try;
}
?>
<form name="fors" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
Enter text:<input type="text" name="name[1]">
Enter text:<input type="text" name="name[2]"><input type="submit" name="submit" value="submit">
</form>
</body>
</html>