justAnoob Posted June 12, 2009 Share Posted June 12, 2009 I have a session that is displayed.... I only want it to display for 10 seconds... What should I do below? <?php if($count > 0) { $_SESSION['dup'] = "This username is already registered. Please try again."; } ?> <?php if(isset($_SESSION['dup'])) { set_time_limit(10); //this doesn't work.. where to put it? echo '<div class="duppy">'; echo $_SESSION['dup']; echo '</div>'; } ?> Link to comment https://forums.phpfreaks.com/topic/161898-solved-time-limit-question/ Share on other sites More sharing options...
haku Posted June 12, 2009 Share Posted June 12, 2009 You can't really do this - php cannot make something disappear on the users computer (client side) without a page refresh. So the best you can do is refresh the page after 10 seconds: header('refresh: 10; url=/page/to/load/after/10/seconds'); Link to comment https://forums.phpfreaks.com/topic/161898-solved-time-limit-question/#findComment-854194 Share on other sites More sharing options...
justAnoob Posted June 12, 2009 Author Share Posted June 12, 2009 thank you. Link to comment https://forums.phpfreaks.com/topic/161898-solved-time-limit-question/#findComment-854203 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.