PROGRAMMERS: Nested PHP variables?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MonkeyMan
    So Fucking Banned
    • Dec 2002
    • 1026

    #1

    PROGRAMMERS: Nested PHP variables?

    Ok using gallery spots I have run into a snag
    they use PHP for thier gallery links with 2 variables.

    My TGP scripts also use multiple PHP variables.


    Using links like this

    outscript.php?varA=80&varB=10&url=http://babes.spotbrokers.com/gallery.php?snid=58&linkid=pop-14

    does not work becasue it only appears to be sending the first variable to the gallery script and the second seems to only go the tgp out script.

    is there a way I can nest 2 PHP urls that use multiple variables?
    (outscript.php?var=80&var=1&url=)(gallery.php?snid =58&linkid=pop-14)

    Many thanks if somone could enlighten me.



    Last edited by MonkeyMan; 02-15-2003, 03:53 AM.
  • Voodoo
    ♥ ♦ ♣ ♠
    • Sep 2002
    • 10600

    #2
    What are the two variable names?

    "I'm selflessly supporting the common good, but only coincidentally looking out for No.1."

    Comment

    • MonkeyMan
      So Fucking Banned
      • Dec 2002
      • 1026

      #3
      Originally posted by Voodoo
      What are the two variable names?
      what bearing does that have? They are in my qestion.


      var=

      snid=
      linkid=

      Comment

      • grumpy
        Too lazy to set a custom title
        • Jan 2002
        • 9870

        #4
        outscript.php?var=80&var=1&url=http://babes.spotbrokers.com/gallery.php?snid=58&linkid=pop-14


        var=80
        var=1

        You have two vars with the same name, tray to put the url in ' ' it has a questionmark in it
        Don't let greediness blur your vision | You gotta let some shit slide
        icq - 441-456-888

        Comment

        • MonkeyMan
          So Fucking Banned
          • Dec 2002
          • 1026

          #5
          Originally posted by grumpy
          outscript.php?var=80&var=1&url=http://babes.spotbrokers.com/gallery.php?snid=58&linkid=pop-14


          var=80
          var=1

          You have two vars with the same name, tray to put the url in ' ' it has a questionmark in it
          Yes I know I jsut typed it fast and i already tried ' '



          outscript.php?var=80&url='http://babes.spotbrokers.com/gallery.php?snid=58&linkid=pop-14'


          doesnt work

          Comment

          • Libertine
            sex dwarf
            • May 2002
            • 17860

            #6
            you can do it like this:

            firsturl.php?avar=2&bvar=3&url=http://www.blegh.com/script.php?ohio:kansas

            then just explode() the querystring on : on the second url. make sure you check the variables for validity/security though.
            /(bb|[^b]{2})/

            Comment

            • grumpy
              Too lazy to set a custom title
              • Jan 2002
              • 9870

              #7
              try this
              outscript.php?var=80&var=1&url='gallery.php?snid=5 8&linkid=pop-14'
              Don't let greediness blur your vision | You gotta let some shit slide
              icq - 441-456-888

              Comment

              • MonkeyMan
                So Fucking Banned
                • Dec 2002
                • 1026

                #8
                Originally posted by punkworld
                you can do it like this:

                firsturl.php?avar=2&bvar=3&url=http://www.blegh.com/script.php?ohio:kansas

                then just explode() the querystring on : on the second url. make sure you check the variables for validity/security though.
                Could you give me a full example??? I'm no good with PHP I dont really understand how to do what your saying.


                Originally posted by grumpy
                try this
                outscript.php?var=80&var=1&url='gallery.php?snid=5 8&linkid=pop-14'
                Cant...
                The surfer is going through my out link then to Galleyspots scipt on thier server. Its not my PHP script outscript.php is in my root but the other is not.

                Comment

                • Voodoo
                  ♥ ♦ ♣ ♠
                  • Sep 2002
                  • 10600

                  #9
                  Originally posted by MonkeyMan
                  what bearing does that have? They are in my qestion.


                  var=

                  snid=
                  linkid=
                  It has every bearing, as you didn't type them correctly in your question.

                  "I'm selflessly supporting the common good, but only coincidentally looking out for No.1."

                  Comment

                  • MonkeyMan
                    So Fucking Banned
                    • Dec 2002
                    • 1026

                    #10
                    Originally posted by Voodoo


                    It has every bearing, as you didn't type them correctly in your question.
                    heh Dude... Im not dumb.. I wouldn't ask the question if I hadn't double checked spelling.

                    Comment

                    • Voodoo
                      ♥ ♦ ♣ ♠
                      • Sep 2002
                      • 10600

                      #11
                      Originally posted by MonkeyMan
                      heh Dude... Im not dumb.. I wouldn't ask the question if I hadn't double checked spelling.

                      What does the following code do?
                      What is the purpose of the first var declaration?

                      var=80&var=1

                      "I'm selflessly supporting the common good, but only coincidentally looking out for No.1."

                      Comment

                      • MonkeyMan
                        So Fucking Banned
                        • Dec 2002
                        • 1026

                        #12
                        Originally posted by Voodoo



                        What does the following code do?
                        What is the purpose of the first var declaration?

                        var=80&var=1
                        OK your obviously not the one to help me so please just stop.... that has no bearing on my problem.

                        Is the variables in the SECOND url athat are not goign through.

                        Comment

                        • Voodoo
                          ♥ ♦ ♣ ♠
                          • Sep 2002
                          • 10600

                          #13
                          Originally posted by MonkeyMan
                          OK your obviously not the one to help me so please just stop.... that has no bearing on my problem.
                          Ok dude. It seems like the URL string that you posted has a few problems... but, I'll let you work it out for yourself then.


                          "I'm selflessly supporting the common good, but only coincidentally looking out for No.1."

                          Comment

                          • MonkeyMan
                            So Fucking Banned
                            • Dec 2002
                            • 1026

                            #14
                            Originally posted by Voodoo


                            Ok dude. It seems like the URL string that you posted has a few problems... but, I'll let you work it out for yourself then.

                            ITS A CONCEPT... nested variables has nothign to do with the specific string I put forth. That was jsut an example.

                            blah.php?varA=1&varB=2&url=bling.php?varA=1&varB=2

                            would STILL explain my qestion

                            varB is not getting parsed by bling.php

                            its abstract, it doesnt matter if my urls are correct or even real; its the concept of the code.

                            Comment

                            • Libertine
                              sex dwarf
                              • May 2002
                              • 17860

                              #15
                              Originally posted by MonkeyMan


                              ...
                              Sample code:


                              $testvar = $_SERVER['QUERY_STRING'];
                              $quervar = explode(":", "$testvar");
                              $varcount = count($quervar);
                              for($i=0;$i<$varcount;$i++){
                              echo($quervar[$i] . "\n");
                              }
                              /(bb|[^b]{2})/

                              Comment

                              • Libertine
                                sex dwarf
                                • May 2002
                                • 17860

                                #16
                                The code I just gave you gets the querystring, chops it up into an array, and displays each piece on a new line. That should help you on your way.
                                /(bb|[^b]{2})/

                                Comment

                                • mrreuben
                                  Registered User
                                  • Jan 2003
                                  • 10

                                  #17
                                  Simple solution:

                                  replace the ampersands in the 2nd url with % 2 6 (no spaces in the symbol. This turns the url into 1 long string. Then call your outscript as normal. Most tradescripts will then not choke on the extra symbols.

                                  If you have a custom script you must call the urldecode() php function in your internal code on the url before sending out the hit. This puts the url back together for the browser.

                                  example

                                  outscript.php
                                  var=80&var=1&url=http://babes.spotbrokers.com/gallery.php?snid=58%26linkid=pop-14


                                  hope this helps

                                  Comment

                                  • MonkeyMan
                                    So Fucking Banned
                                    • Dec 2002
                                    • 1026

                                    #18
                                    Originally posted by mrreuben
                                    Simple solution:

                                    replace the ampersands in the 2nd url with % 2 6 (no spaces in the symbol. This turns the url into 1 long string. Then call your outscript as normal. Most tradescripts will then not choke on the extra symbols.

                                    If you have a custom script you must call the urldecode() php function in your internal code on the url before sending out the hit. This puts the url back together for the browser.

                                    example

                                    outscript.php
                                    var=80&var=1&url=http://babes.spotbrokers.com/gallery.php?snid=58%26linkid=pop-14


                                    hope this helps

                                    so If i replace this

                                    $url = header_check($url);
                                    with
                                    $url = urldecode(header_check($url));

                                    in my outscript.php
                                    that should do it???

                                    Comment

                                    • MonkeyMan
                                      So Fucking Banned
                                      • Dec 2002
                                      • 1026

                                      #19
                                      Blah, it doesnt work becasue thers is a hahahahahahahahahaha involved that is converting the %26 when it generates the page.


                                      can somone tell me how to do a simple character replacment?

                                      like take a string and convert all the "|"'s in the string to "&"s using PHP

                                      I think that would be the simplest way, but I dont know how to do it.

                                      Comment

                                      • mrreuben
                                        Registered User
                                        • Jan 2003
                                        • 10

                                        #20
                                        Originally posted by MonkeyMan



                                        so If i replace this

                                        $url = header_check($url);
                                        with
                                        $url = urldecode(header_check($url));

                                        in my outscript.php
                                        that should do it???
                                        Basically yes.

                                        Php automaticly passes the variables from a querystring or a HTTP POST into your script as is you should not need to call header_check(). Unless you redefine it.

                                        Just make sure the url in your html pages you change out the ampersands in the 2nd url. This will ensure that $url is passed as 1 long string.

                                        Comment

                                        • Libertine
                                          sex dwarf
                                          • May 2002
                                          • 17860

                                          #21
                                          Originally posted by MonkeyMan
                                          ...
                                          Dude, you aren't in charge of the page which hits are sent to, but in charge of the one from which the hits are sent?

                                          Doh! Shoulda looked better

                                          (oh, and what you should do now depends on what that header_check function does)
                                          /(bb|[^b]{2})/

                                          Comment

                                          • MonkeyMan
                                            So Fucking Banned
                                            • Dec 2002
                                            • 1026

                                            #22
                                            Originally posted by mrreuben


                                            Basically yes.

                                            Php automaticly passes the variables from a querystring or a HTTP POST into your script as is you should not need to call header_check(). Unless you redefine it.

                                            Just make sure the url in your html pages you change out the ampersands in the 2nd url. This will ensure that $url is passed as 1 long string.
                                            yea but I already ruled out this method... my pages use java as well an that does the conversion when generating the page. Sorry I failed to mention the URLS are being generated using java.

                                            hahah it jsut keeps getting deeper and deeper but I think jsut using some kinda simple char replacment code would be my best bet.

                                            Originally posted by punkworld


                                            Dude, you aren't in charge of the page which hits are sent to, but in charge of the one from which the hits are sent?

                                            Doh! Shoulda looked better

                                            (oh, and what you should do now depends on what that header_check function does)
                                            No, Im in chare of ourscript.php

                                            but not the gallery.php (its on a different server)
                                            Last edited by MonkeyMan; 02-15-2003, 04:26 AM.

                                            Comment

                                            • ServerGenius
                                              Confirmed User
                                              • Feb 2002
                                              • 9377

                                              #23
                                              Originally posted by mrreuben
                                              Simple solution:

                                              replace the ampersands in the 2nd url with % 2 6 (no spaces in the symbol. This turns the url into 1 long string. Then call your outscript as normal. Most tradescripts will then not choke on the extra symbols.

                                              If you have a custom script you must call the urldecode() php function in your internal code on the url before sending out the hit. This puts the url back together for the browser.

                                              example

                                              outscript.php
                                              var=80&var=1&url=http://babes.spotbrokers.com/gallery.php?snid=58%26linkid=pop-14


                                              hope this helps
                                              Bingo....the only correct answer....

                                              use urlencode to translate special characters to ascii codes
                                              and ulrdecode to translate it back....allthough your browser also
                                              understand the ascii codes for the special characters.

                                              DynaMite
                                              | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

                                              Comment

                                              • JayJay
                                                Confirmed User
                                                • Jun 2002
                                                • 3739

                                                #24
                                                Wasn't it you that laughed at some poor guy who needed help yesterday?
                                                why dont you fucking try using google and stop expecting knowledge to be handed to you on an adult webmasters forum. its really not that difficult to figure out
                                                DICK HEAD

                                                Comment

                                                • Libertine
                                                  sex dwarf
                                                  • May 2002
                                                  • 17860

                                                  #25
                                                  Originally posted by mrreuben


                                                  Basically yes.

                                                  Php automaticly passes the variables from a querystring or a HTTP POST into your script as is you should not need to call header_check(). Unless you redefine it.

                                                  Just make sure the url in your html pages you change out the ampersands in the 2nd url. This will ensure that $url is passed as 1 long string.
                                                  header_check is a funtion of the tradescript (I believe CJ Ultra), not a predefined php one. The problem he has actually is a very basic one, and I even wrote a patch (unofficial) for CJUltra for something of the kind a year or so ago.
                                                  /(bb|[^b]{2})/

                                                  Comment

                                                  • MonkeyMan
                                                    So Fucking Banned
                                                    • Dec 2002
                                                    • 1026

                                                    #26
                                                    Originally posted by JayJay
                                                    Wasen't you that guy who laughed at someone who needed help yesterday?


                                                    DICK HEAD
                                                    LOL!!! Jayjay I love you.

                                                    Comment

                                                    • mrreuben
                                                      Registered User
                                                      • Jan 2003
                                                      • 10

                                                      #27
                                                      Originally posted by MonkeyMan
                                                      Blah, it doesnt work becasue thers is a hahahahahahahahahaha involved that is converting the %26 when it generates the page.


                                                      can somone tell me how to do a simple character replacment?

                                                      like take a string and convert all the "|"'s in the string to "&"s using PHP

                                                      I think that would be the simplest way, but I dont know how to do it.

                                                      If you are generating pages using php use the urlencode() function on the url as you generating the page.

                                                      If you have them hard coded use str_replace:

                                                      mixed str_replace ( mixed search, mixed replace, mixed subject)

                                                      Without disecting yourscript thats 1 way to approach it.

                                                      Comment

                                                      • JayJay
                                                        Confirmed User
                                                        • Jun 2002
                                                        • 3739

                                                        #28
                                                        If your going to Quote me MonkeyBoy get it right

                                                        Comment

                                                        • MonkeyMan
                                                          So Fucking Banned
                                                          • Dec 2002
                                                          • 1026

                                                          #29
                                                          Originally posted by mrreuben



                                                          If you are generating pages using php use the urlencode() function on the url as you generating the page.

                                                          If you have them hard coded use str_replace:

                                                          mixed str_replace ( mixed search, mixed replace, mixed subject)

                                                          Without disecting yourscript thats 1 way to approach it.
                                                          Naw pages generated by j a v a s c r i p t

                                                          I wonder why the hell thats censored.

                                                          Comment

                                                          • MonkeyMan
                                                            So Fucking Banned
                                                            • Dec 2002
                                                            • 1026

                                                            #30
                                                            str_replace("|", "&", $url);


                                                            ^ that would do it??

                                                            Comment

                                                            • Libertine
                                                              sex dwarf
                                                              • May 2002
                                                              • 17860

                                                              #31
                                                              Just use the special characters for the querystring (not for other stuff), and you don't need to do anything special at all, you can just leave it that way.
                                                              /(bb|[^b]{2})/

                                                              Comment

                                                              • ServerGenius
                                                                Confirmed User
                                                                • Feb 2002
                                                                • 9377

                                                                #32
                                                                Originally posted by MonkeyMan
                                                                Naw pages generated by j a v a s c r i p t

                                                                I wonder why the hell thats censored.
                                                                Try using & a m p ; without spaces in the hahahahahahahahahaha for the url
                                                                part

                                                                DynaMite
                                                                | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

                                                                Comment

                                                                • JayJay
                                                                  Confirmed User
                                                                  • Jun 2002
                                                                  • 3739

                                                                  #33
                                                                  Stop helping this Fucking Jerk!
                                                                  I used to run a passcracker forum

                                                                  Comment

                                                                  • MonkeyMan
                                                                    So Fucking Banned
                                                                    • Dec 2002
                                                                    • 1026

                                                                    #34
                                                                    Originally posted by JayJay
                                                                    Stop helping this Fucking Jerk!
                                                                    Let it go... why dont you link to the the thread Instead of taking snippets out to suit your sad need to bash me.

                                                                    Comment

                                                                    • JayJay
                                                                      Confirmed User
                                                                      • Jun 2002
                                                                      • 3739

                                                                      #35
                                                                      If you want it find it yourself

                                                                      Comment

                                                                      • mrreuben
                                                                        Registered User
                                                                        • Jan 2003
                                                                        • 10

                                                                        #36
                                                                        Originally posted by MonkeyMan
                                                                        Naw pages generated by j a v a s c r i p t

                                                                        I wonder why the hell thats censored.

                                                                        just do a search/replace using your html editor then , just single step each replacement or

                                                                        cut out the urls into a blank page the s/r then paste back in.

                                                                        Pain but it is the only way.

                                                                        Comment

                                                                        • MonkeyMan
                                                                          So Fucking Banned
                                                                          • Dec 2002
                                                                          • 1026

                                                                          #37
                                                                          hmmm


                                                                          $url = header_check($url);
                                                                          str_replace("|", "&", $url);
                                                                          header("Location: $url");


                                                                          Shouldnt that work??
                                                                          Im not seeing whats wrong with my code
                                                                          but its not replacing the |'s

                                                                          Comment

                                                                          • mrreuben
                                                                            Registered User
                                                                            • Jan 2003
                                                                            • 10

                                                                            #38
                                                                            Originally posted by MonkeyMan
                                                                            hmmm


                                                                            $url = header_check($url);
                                                                            str_replace("|", "&", $url);
                                                                            header("Location: $url");


                                                                            Shouldnt that work??
                                                                            Im not seeing whats wrong with my code
                                                                            but its not replacing the |'s
                                                                            We are on two different pages here.

                                                                            Your outscript code

                                                                            $url = "Location:" . urldecode($url);
                                                                            header ($url);

                                                                            That's it! The header_check() is not needed unless it serves to verify the url passed for some reason.


                                                                            your html source

                                                                            ttt-out.php?url=http://www.dollars4babes.com/mpa2/gallhit.php?w=100349%26p=2%26gall=1040389346&link= roxycarter

                                                                            I took this url from my site to show you since the second url has multiple variables.

                                                                            The focus of your changes is in your html source not the script code.

                                                                            Try that out

                                                                            Comment

                                                                            • Libertine
                                                                              sex dwarf
                                                                              • May 2002
                                                                              • 17860

                                                                              #39
                                                                              Originally posted by mrreuben

                                                                              That's it! The header_check() is not needed unless it serves to verify the url passed for some reason.
                                                                              the header_check() is perhaps the most important function in the script, for the maker that is.
                                                                              /(bb|[^b]{2})/

                                                                              Comment

                                                                              • MonkeyMan
                                                                                So Fucking Banned
                                                                                • Dec 2002
                                                                                • 1026

                                                                                #40
                                                                                Thanks for the help I ended up using.

                                                                                $url = header_check($url);
                                                                                $url = str_replace("|", "&", $url);
                                                                                header("Location: $url");

                                                                                And everthings wokring great.

                                                                                Comment

                                                                                • Mutt
                                                                                  Too lazy to set a custom title
                                                                                  • Sep 2002
                                                                                  • 34431

                                                                                  #41
                                                                                  AMP must be asleep.


                                                                                  Dancing Pig needed STAT!
                                                                                  I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!

                                                                                  Comment

                                                                                  Working...