0
<html>
<head>
</head>
<body>
<?php
$days_array = array("");
for($_GET['days'] as $val2)
{	
$days_array[] = $val2;
echo $days_array[0]; 
}
?>
<form name="fors" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
Enter text:<input type="text" name="days">
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>

get the text box value using array and display the value using array.

4
Contributors
3
Replies
7
Views
9 Years
Discussion Span
Last Post by peter_budo
0
<html>
<head>
</head>
<body>
<?php
$days_array = explode(',',$_POST['days']); // turn post into array
foreach($days_array as $v)
{	
echo $v.'<br />'; // display array
}
?>
sperate dates with a comma<br />
<form name="fors" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
Enter text:<input type="text" name="days"> <input type="submit" name="submit" value="submit">
</form>
</body>
</html>
0

Not that much perfect coding solution

<html>
<head>
</head>
<body>
<?php
$days_array = explode(',',$_POST['days']); // turn post into array
foreach($days_array as $v)
{	
echo $v.'<br />'; // display array
}
?>
sperate dates with a comma<br />
<form name="fors" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
Enter text:<input type="text" name="days"> <input type="submit" name="submit" value="submit">
</form>
</body>
</html>
0

Not that much perfect coding solution

It is so easy to critize somebody's else work. So why don't you explain what is wrong with the proposed code and provide your solution to compare?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.