|
Posted by Pedro Graca on 10/19/06 09:17
kirke wrote:
> <form name="form1" method="post" action="next.php">
> <textarea name="dayList" Id = "dayList" cols=20
> rows=10></textarea>
> </form>
>
> in text area there's one column of values.
>
>
> in "next.php", put values of 'dayList' in select option. I made a code
> by myself. However, as you see, it's just nonsense. How can I modify
> this? Thank you!
>
>
>
> <?php
> $value=(int)$_POST['dayList'];
> ?>
$_POST['dayList'] is a list of lines, not an int!
You want to convert a group of lines into an array.
<?php
$value = explode("\n", $_POST['dayList']);
?>
> <select name="dateList" id="dateList" >
> <?php
> echo '<option value="1">' .$value '</option>';
> ?>
> </select>
<select name="dateList" id="dateList">
<?php
foreach ($value as $k=>$v) {
echo '<option value="', $k, '">', $v, '</option>';
}
?>
</select>
--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot
[Back to original message]
|