-1

我想获取 and 的值$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 | *添加 |

如果我点击 *add @ 8:30-9:30 该值将被发送到next_page.php 我应该怎么做?

4

1 回答 1

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'];
于 2013-02-05T05:21:59.417 回答