Simple coding question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • v4 media
    Confirmed User
    • Feb 2005
    • 2934

    #1

    Simple coding question

    If I want to copy a thumb over to a new page, say someone clicks on thumb 01 and this is the url 'join.htm?t=01' I want the 01 thumb to show on the join page.


    I would imagine it's simple but I don't even know what I need to search for to actually find the code.

    Anyone want to tell me what I'm looking for,

    thanks
  • Babaganoosh
    ♥♥♥ Likes Hugs ♥♥♥
    • Nov 2001
    • 15841

    #2
    Sounds like you need to hire an actual webmaster.
    I like pie.

    Comment

    • fris
      Too lazy to set a custom title
      • Aug 2002
      • 55679

      #3
      get the t variable

      Code:
      <?php
      
      $thumb = $_GET['t'];
      echo $thumb . '.jpg';
      
      ?>
      or whatever path, etc.
      Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

      Comment

      • v4 media
        Confirmed User
        • Feb 2005
        • 2934

        #4
        Originally posted by fris
        get the t variable

        Code:
        <?php
        
        $thumb = $_GET['t'];
        echo $thumb . '.jpg';
        
        ?>
        or whatever path, etc.
        Thank you very much.




        Originally posted by Babaganoosh
        Sounds like you need to hire an actual webmaster.
        Everything else was done just needed to solve that, And within 4 minutes of posting it was. So I'll put the webmaster hiring on hold, thanks for your wise words though.

        Comment

        • fris
          Too lazy to set a custom title
          • Aug 2002
          • 55679

          #5
          might wann add a trim to the $_GET and also check if its set so you dont get some fool trying to inject shit.
          Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

          Comment

          • Babaganoosh
            ♥♥♥ Likes Hugs ♥♥♥
            • Nov 2001
            • 15841

            #6
            You're lucky there are folks willing to help out the lazy and incompetent. I'm guessing you'll be around as long as they're willing to think for you.
            I like pie.

            Comment

            • v4 media
              Confirmed User
              • Feb 2005
              • 2934

              #7
              Originally posted by Babaganoosh
              You're lucky there are folks willing to help out the lazy and incompetent. I'm guessing you'll be around as long as they're willing to think for you.
              Who pissed on your cornflakes this morning?

              Comment

              • Babaganoosh
                ♥♥♥ Likes Hugs ♥♥♥
                • Nov 2001
                • 15841

                #8
                Originally posted by v4 media
                Who pissed on your cornflakes this morning?
                Nobody, I just hate incompetence.
                I like pie.

                Comment

                • Zoxxa
                  Confirmed User
                  • Feb 2011
                  • 1026

                  #9
                  Just to build off Fris' code and recommendation.

                  Code:
                  <?php
                  
                  // Only allow integar values
                  $thumb = preg_replace('/[^0-9]/', '', $_GET['t']) . '.jpg';
                  
                  // If no thumb set, use default thumb
                  if(empty($thumb)) {
                  	$thumb = 'default.jpg';
                  }
                  
                  // Output thumb
                  echo $thumb;
                  
                  ?>
                  [email protected]
                  ICQ: 269486444
                  ZoxEmbedTube - Build unlimited "fake" tubes with this easy 100% unencoded CMS!

                  Comment

                  • v4 media
                    Confirmed User
                    • Feb 2005
                    • 2934

                    #10
                    Originally posted by Zoxxa
                    Just to build off Fris' code and recommendation.

                    Code:
                    <?php
                    
                    // Only allow integar values
                    $thumb = preg_replace('/[^0-9]/', '', $_GET['t']) . '.jpg';
                    
                    // If no thumb set, use default thumb
                    if(empty($thumb)) {
                    	$thumb = 'default.jpg';
                    }
                    
                    // Output thumb
                    echo $thumb;
                    
                    ?>
                    thanks, reading up now.

                    Comment

                    Working...