hi i have the following form where a member chooses how long they want to be be displayed on another page like example below

<select name="hours"> <option value="1"<?php if(!empty($hours)) {?><?php if($_POST['hours']=="1") { echo "selected"; } ?><?php }?>>1</option> <option value="3"<?php if(!empty($hours)) {?><?php if($_POST['hours']=="3") { echo "selected"; } ?><?php }?>>3</option> <option value="6"<?php if(!empty($hours)) {?><?php if($_POST['hours']=="6") { echo "selected"; } ?><?php }?>>6</option> <option value="9"<?php if(!empty($hours)) {?><?php if($_POST['hours']=="9") { echo "selected"; } ?><?php }?>>9</option> <option value="12"<?php if(!empty($hours)) {?><?php if($_POST['hours']=="12") { echo "selected"; } ?><?php }?>>12</option> </select>

What would i need to put in to make sure a username disappears of the list would it be some sort of time out script

and help would be much appreciated ty jan

Member Avatar for diafol

The username will stay on the page indefintely until the page is closed. If you want it to disappear at a particular time, then you may need to poll the server at regular intervals (ajax). You're using php, so pages aren't updated. Using js you can certainly get this to work, but with a timer - but you then you may have to keep a list of times for each individual in a variable/object.
You'd be able to do this (I think) in nodejs. Also with websockets - but they can be fiddly to set up.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.