Page 1 of 1

If no variable is present in the URL

Posted: Tue Jan 21, 2003 12:41 pm
by wreed
I have a page, and if you just call the rankings.php page nothing shows, but if you call the variable in the url like so rankings.php?week=1 it shows the information I want. Now I just want to know if someone types in rankings.php I would like it to just print the latest week anyway, how do I look to the URL and see if there is a variable there?

Posted: Tue Jan 21, 2003 12:49 pm
by volka
e.g.

Code: Select all

<?php
if (!isset($_GET['week']) || (int)$_GET['week'] < 1)
   $_GET['week'] = 1;
?>