interpim Posted January 15, 2008 Share Posted January 15, 2008 OK... my bit of code is for paging in a guestbook script. if anyone puts anything into the address bar besides a number it will display it aswell :/ anywho, does anyone know how to prevent this? here is my code snippet. $page = 1; if(isset($_GET['page'])){ $page = $_GET['page']; $x = $page*5-5; } Quote Link to comment Share on other sites More sharing options...
p2grace Posted January 15, 2008 Share Posted January 15, 2008 Try this: $page = 1; if(isset($_GET['page'])){ $page = $_GET['page']; if(is_numeric($page)){ $x = $page*5-5; } } Quote Link to comment Share on other sites More sharing options...
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.