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; } Link to comment https://forums.phpfreaks.com/topic/86086-xss-problem-i-need-some-help-fixing/ 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; } } Link to comment https://forums.phpfreaks.com/topic/86086-xss-problem-i-need-some-help-fixing/#findComment-439571 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.