Haunted Dawg Posted December 26, 2008 Posted December 26, 2008 Ok i just worked on this little script. It actualy reminded me of this script because isomerizer & ferdi made one similar they just added a little captcha test so the user does not cheat or something. Mine is in a 10 set delay. You can take away from it or add more to it. The only reason why im giving it away is because it is small and it is not finished. This little script will be on my new game with a 1 second delay. So if the page is reset during 1 second the user will need to do a little math quiz to make sure it is the user and not a bot. This can be good if you want to implement it on a gym script so no autotraining and such. Anyway's here it is. Add it to your header.php $_SESSION['page_time'] = time(); echo 'Page Time: '.$_SESSION['page_time'].' Page Viewed: '.$_SESSION['page_visited'].' Current Time: '.time().' Current Page: '.$_SERVER['REQUEST_URI'].' '; if($_SESSION['page_visited'] == $_SERVER['REQUEST_URI']) //Continue to check if time { if(time() > ($_SESSION['page_time'] + 10) OR time() < ($_SESSION['page_time'] + 10)) { echo 'The last time you visited this page was 10 second\'s ago.'; } } $_SESSION['page_visited'] = $_SERVER['REQUEST_URI']; Please post under this topic if you have made any type of edit's or this could be usefull. DON'T TRY AND RESELL as a security addon as this is totaly not security. But in a way it can become security. Quote
Savager Posted December 26, 2008 Posted December 26, 2008 Re: A little snipet (Could be security could be more) you could also use that to stop duping and constant page refreshing.. Quote
Savager Posted December 26, 2008 Posted December 26, 2008 Re: A little snipet (Could be security could be more) if(!$_session['z']) {$_session['z']="";} $_session['z'].="a"; $num=strlen($_session['z']); if($num>1) {$session['z']=""; die("");} else{$session['z']="";} i think that might actually work. Quote
Haunted Dawg Posted December 26, 2008 Author Posted December 26, 2008 Re: A little snipet (Could be security could be more) I know for a fact "duping" could be stoped by using simple sql. But this is more intended to stop constant page refreshing for example the gym or such. This infact can stop duping for some people. 2 Computer's will never run alike. There fore one will be slower than the other meaning one script will error out while the other won't. Duping is more done via the tab's. Open 2 tab's go to the same file. And just go right click then refresh all tab's. With that being done. And this script it could stop that with tab's. But then again the user can use http://domain.com and http://www.domain.com. That's only if they are clever enough. Anyway's i hope some one will find this rather usefull and post us with something usefull. Quote
Haunted Dawg Posted December 26, 2008 Author Posted December 26, 2008 Re: A little snipet (Could be security could be more) With your little test script luke. I get the same thing every page load. First Try: Session set $_SESSION['z'] is a String length is 1 Second is the same and third is the same. so i do not see why it should show the red font. Please explan more of what your script should be doing. Quote
Savager Posted December 26, 2008 Posted December 26, 2008 Re: A little snipet (Could be security could be more) yeah but you guys are not loading it at the exact same time. your just loading two tabs at different times. try it if you have two computers. Quote
Haunted Dawg Posted December 26, 2008 Author Posted December 26, 2008 Re: A little snipet (Could be security could be more) The problem is. It will not work on two computer's. Each computer get's a different session ID. So there is no way on doing this on two computer's. Quote
Savager Posted December 26, 2008 Posted December 26, 2008 Re: A little snipet (Could be security could be more) what if you took the sessions out.. and had it like so $z Quote
Haunted Dawg Posted December 26, 2008 Author Posted December 26, 2008 Re: A little snipet (Could be security could be more) Only way on stoping duping is mysql query's. Or some other technique added to [dot]htaccess. Quote
Floydian Posted December 27, 2008 Posted December 27, 2008 Re: A little snipet (Could be security could be more) lol there is a way to stop people from having two sessions.... try it on a Horizons Game Engine based gamed. You'll find out that every time you load a page on one browser/computer with a different session ID as another browser/computer, your other browser/computer is auto logged out. it'd be nearly impossible to do a dual page load on Horizons just because of that, at least using the multiple browser or multiple computer trick. multiple tabs though would work (naturally we account for that) So, it's pointless to go on and on about this script stopping dual page loads. I'm sure the script does what it's supposed to do, and that's great. Good job killah. Just a little hint, I'm checking for multiple sessions with the same $_SESSION['userid'] Yes that does involve running a count(*) where userid = blah on every page load to the database sessions table, but eh, the HGE header is highly optimized so adding that one query doesn't impact performance... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.