SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Multiple Zeros

  1. #1
    ********* Scotland Saltire's Avatar
    Join Date
    Jan 2000
    Location
    Scotland
    Posts
    660
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Multiple Zeros

    I don't want people to be able to try and spoof the variable in the URL with multiple zeros, as if they do this, it will just show the page with the incorrect image.

    So how do I check the input for someone modifying the URL to contain say

    0

    00

    0000

    00000

    any number above 0 is OK i.e. 1 > whatever, but multiple zeros cannot be allowed.

    Thanks.

  2. #2
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Írebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Try something like this:

    PHP Code:
    if( isset($_GET['id']) && intval($_GET['id']) > )
    {
      
    $id intval($_GET['id']);
      
    // your code here...

    Yours, Erik.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •