我希望获得$sched->start_time
和$sched->end_time
的值,并将其发送到next_page.php
。
<?php
foreach($foo as $row){
echo "
<tr>
<td>".$sched->start_time."</td>
<td>".$sched->end_time."</td>
<td class='add'><a class='add_sched' href='next_page.php'>add new</a></td></tr>";
}
?>
输出将如下所示
| 7:30 | 8:30 | *添加|
| 8:30 | 9:30 | *添加|
| 9:30 | 10:30 | *添加|
如果我点击*添加@ 8:30-9:30,该值将在next_page.php
上发送
我应该怎么做?
答案 0 :(得分:3)
试试这个......
echo
...
"<td class='add'>
<a class='add_sched' href='next_page.php?start_time=".$sched->start_time."&end_time=".$sched->end_time."'>add new</a>
</td>"
在next.php
$start_time = $_GET['start_time'];
$end_time = $_GET['end_time'];