Reputation: 667
I have a page that needs to be constantly refreshed multiple times a minute. The page has is a echo'd php table.
The page loads perfectly fine, all is good, I have used the META tag HTML, I have used the header tag with the refresh function in PHP... and yet a problem arises :
When I hit Start Session button the refresh stops. And the table bellow does does not get updated. So then I have to manually refresh the page. This is not the desired affect. Can some one explain to me how to refresh a page continually.
Edit 1:
Code that makes the include of the session start
foreach($result as $row)
{
echo "<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td> <a href=student.php?anum=" . $row['anum'] . " target='_blank'>" .$row['anum'] . " </a></td>";
echo "<td>" . $row['first'] . "</td>";
echo "<td>" . $row['last'] . "</td>";
echo "<td>" . $row['why'] . "</td>";
echo "<td>" . $row['comments'] . "</td>";
echo "<td>" . $row['additional_req'] . "</td>";
echo "<td>" . $row['signintime'] . "</td>";
echo "
<td> <form action='counselor.php?id=" . $row['id'] . "' method='post' target='_new'>
<select name='namedrop'>
<option value=''>Counselor Name</option>
<option value='Admin-John'>Admin - John</option>
<option value='Admin-Christine'>Admin - Christine</option>
<option value='Admin-Dawne'>Admin - Dawne</option>
<option value='Counselor-Cherie'>Counselor - Cherie</option>
<option value='Counselor-Tootie'>Counselor - Tootie</option>
<option value='Counselor-Debbie'>Counselor - Debbi</option>
<option value='FrontDesk-Delores'>Front Desk - Delores</option>
<option value='FrontDesk-Kiana'>Front Desk - Kiana</option>
</select>
</td>
<td> <input type='submit' name='submit' value='Start Session'></td>
</form> </td>";
}
Upvotes: 1
Views: 30826
Reputation: 442
Is it possible for you to use Javascript to achieve the desired effect? I don't know enough about what you're doing to determine whether that would clear your changes or not (my assumption here is: no).
If you are able to use Javascript, you could write a simple function which refreshes the page on an interval.
Upvotes: 0
Reputation: 21295
If you are looking to refresh the page when you click "Start Session", then you can edit your submit button to have this onClick listener. It should refresh the page.
<input type='submit' name='submit' value='Start Session' onClick="window.location.reload()" />
Upvotes: 2
Reputation: 6058
<form action="<?php echo $PHP_SELF; ?>" method="post">
or
<form action="thispage.php" method="post">
Upvotes: -1