PHP question...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pornJester
    Confirmed User
    • Mar 2001
    • 6138

    #1

    PHP question...

    Forgive me if this sounds unprogrammerly but I'm trying to edit a php template I have. So the question is..

    How do I echo a variable in my url string. For example i have...

    http://www.foo.com/foo.php?category=apples

    I want to display.. Category: Apples ..on the top of the output page (based on what category is displayed in the URL).

    Any help would be appreciated. Thanks.


    FreshBucks | Webmaster Vault | GayAW
    Trusted Names in Adult.
    ICQ 9157.3698
  • Machete_
    WINNING!
    • Oct 2002
    • 14579

    #2
    buy one one Juicylinks books

    Comment

    • pornJester
      Confirmed User
      • Mar 2001
      • 6138

      #3
      Originally posted by ebus_dk
      buy one one Juicylinks books
      maybe JL can just look it up for me


      FreshBucks | Webmaster Vault | GayAW
      Trusted Names in Adult.
      ICQ 9157.3698

      Comment

      • apscripts
        Confirmed User
        • Mar 2003
        • 204

        #4
        print $_GET['category'];
        icq5708193

        aptgp III -- Build a Blog, an RSS feed, a text TGP, and a thumb TGP all from one installation. Own Comus or AutoGallery? Have APTGP III Installed free for 30 days; no obligations.

        Comment

        • SilverTab
          Confirmed User
          • Nov 2001
          • 5060

          #5
          Originally posted by apscripts
          print $_GET['category'];
          what he said...

          print $category;

          might do it also...
          mmm my sig was too big... no more cool animation
          but hey still! need php? ICQ: 94586959

          Comment

          • apscripts
            Confirmed User
            • Mar 2003
            • 204

            #6
            If he has register_globals on...but who in the hell uses that shit ass setting? heh
            icq5708193

            aptgp III -- Build a Blog, an RSS feed, a text TGP, and a thumb TGP all from one installation. Own Comus or AutoGallery? Have APTGP III Installed free for 30 days; no obligations.

            Comment

            • senseidru
              Confirmed User
              • Sep 2002
              • 1767

              #7
              why do peeps not like register_globals?

              Can someone explain to me.

              Comment

              • pornJester
                Confirmed User
                • Mar 2001
                • 6138

                #8
                Originally posted by apscripts
                print $_GET['category'];
                This worked. Thanks


                FreshBucks | Webmaster Vault | GayAW
                Trusted Names in Adult.
                ICQ 9157.3698

                Comment

                • Nysus
                  Confirmed User
                  • Aug 2001
                  • 7817

                  #9
                  Hey PornJester,

                  <?=$category;?>

                  should work for you, otherwise

                  <?=$_GET['category'];?>

                  would work.

                  Cheers,
                  Matt
                  What name is pr0 / Untouched Markets using these days? Untouched Markets - pr0 - Refund My Money Now

                  Someone owes me $2,000 because they didn't do any work that was paid for *pointing at pr0 / William / UntouchedMarkets*

                  See http://www.gfy.com/showthread.php?p=16744521 and for more detailed see http://www.gfy.com/showthread.php?t=948645

                  Comment

                  • inthestars
                    Registered User
                    • Sep 2002
                    • 2021

                    #10
                    Also, try the forums at PHP-Builder..

                    http://www.phpbuilder.org

                    Comment

                    • Why
                      MFBA
                      • Mar 2003
                      • 7230

                      #11
                      i would do

                      $fruit = $HTTP_GET_VARS['category'];

                      and then just use $fruit anywhere i would need it. that is if category wasnt working for whatever reason.

                      Comment

                      • SicChild
                        Confirmed User
                        • Mar 2003
                        • 365

                        #12
                        Originally posted by senseidru
                        why do peeps not like register_globals?

                        Can someone explain to me.
                        It allows people to set malicious variables. For instance, if you have a login script that checks cookies to see if you're logged in then does: if($logged_in hahahaha 1) { do stuff; }, then someone could just go like http://mydomain.com/mypage.php?logged_in=1

                        Comment

                        • oxenus
                          Registered User
                          • Jun 2002
                          • 11

                          #13
                          Originally posted by SicChild


                          It allows people to set malicious variables. For instance, if you have a login script that checks cookies to see if you're logged in then does: if($logged_in hahahaha 1) { do stuff; }, then someone could just go like http://mydomain.com/mypage.php?logged_in=1
                          It doesn't depend on register_globals, it depends of programer's qualification. :-)
                          http://www.greathotpanty.com/

                          Check it :-)

                          Comment

                          • Sphinx
                            Registered User
                            • Oct 2001
                            • 31

                            #14
                            http://www.something.com?user=<? "$user" ?>

                            Comment

                            • PowerCum
                              CjOverkill
                              • Apr 2003
                              • 1328

                              #15
                              Originally posted by SicChild


                              It allows people to set malicious variables. For instance, if you have a login script that checks cookies to see if you're logged in then does: if($logged_in hahahaha 1) { do stuff; }, then someone could just go like http://mydomain.com/mypage.php?logged_in=1
                              Then you get a cookie editor and set the cookie you need to have for logged_in=1 ... that easy...
                              register globals or not, if the programmer is not good enought you get hacked.
                              CjOverkill Traffic Trading Script
                              Free, secure and fast traffic trading script. Get your copy now

                              Comment

                              Working...