Hello
I am trying to pass a value though a few pages
the first page is called license.php, then fans.php, fans1.php and to license_provider_v7.pl
the value challenge is not comming across.

I know how to do this in ASP
<%Dim Challenge
Challenge = request.form(“Challenge”)%>

<input type=”hidden” name=”challenge” value =”<%=Challenge”%>

But in PHP its not working.
Please take a look at the files 🙂
Thanks for all your help.

    The challenge value gets lost in fans1.php.

    I am not sure about the exact syntax of php, but the value shoudle get appended to the url that the user is being redirected to.

    I am guessing it should look something like this:

    <form name="getlicense" action="http://www.snoozeboxmusic.com/drm/provider_license_v7.pl?challenge=$challenge’ method="POST">

    can some one show me the correct syntax i would need. in referring to the first post and attached files.

      You were on the right track. The equivalent of your ASP example in PHP is this:

      ASP:
      Challenge = Request.Form(“Challenge”)

      PHP
      $Challenge = $_POST["Challenge"];

      The Request.QueryString() or whatever it is in ASP is this in PHP:

      $Challenge = $_GET["Challenge"];

      The equvialent of just Request("Challenge") in PHP is $_REQUEST["Challenge"] in php.

      Then do what you want with the variables as you were doing.

      There are some other differences too, such as how PHP handles arrays passed between pages, but I'll leave that up to you to check out.

      K, cya.
      -Adam 🙂

        Hello
        Thanks for all your help.
        but i need some one to look over this.

          Some of code looks a bit dodgy. Can't run it cause i don't have PHP on this machine.

          Also, you left some ASP still in there:

          <input type="hidden" name="challenge" value ="<%=Challenge"%>

          You need to convert it to PHP:

          <input type="hidden" name="challenge" value ="<?=$Challenge?>">

          Also note that you messed up the HTML... the " and > weren't closed properlly.

          As as security measure you shouldn't do all your validation client side... I.e. with JavaScript... anyone can bypass that. Make sure you check server side too before processing the data.

          Double check your HTML too... there's unclosed tags everywhere... you don't want to leave <b> tags unclosed... will make your page look quite silly...

          Anyway, I guess the rest looks alright... can't you test to to see what it does?

          k, cya man.
          -Adam 🙂

            Hello
            I used http detect, to see if the first page was getting/posint the challenge value to the second and i see that the urlencoded, this could be why i am not getting the challenge value.
            how do i accept urlencoded post values.

            DE

              You don't have to decode URL encoded values....

              If a PHP script is passed some data through GET or POST (i.e. in a form or in the query string) then php will automatically decode that data when the script runs, and the decoded data will be available in the either the $GET or $POST arrays. You shouldn't have to touch that at all.

              If you want to check whether data is being passed between scripts, just do this:

              print_r($POST); or print_r($GET)

              That will show all the data that was passed from the previous script through a form or the query string.

              Unless you've fixed up your code too as I mentioned before of course it won't be working anyway. You were still using ASP and not PHP in a lot of spots, esp concerning the Challange variable.

              That's most likely your problem.

              Take your time...read through the code and make sure it's all correct...

              k, good luck man
              - Adam 🙂

                You don't have to decode URL encoded values....

                If a PHP script is passed some data through GET or POST (i.e. in a form or in the query string) then php will automatically decode that data when the script runs, and the decoded data will be available in the either the $GET or $POST arrays. You shouldn't have to touch that at all.

                If you want to check whether data is being passed between scripts, just do this:

                print_r($POST); or print_r($GET)

                That will show all the data that was passed from the previous script through a form or the query string.

                Unless you've fixed up your code too as I mentioned before of course it won't be working anyway. You were still using ASP and not PHP in a lot of spots, esp concerning the Challange variable.

                That's most likely your problem.

                Take your time...read through the code and make sure it's all correct...

                k, good luck man
                - Adam 🙂

                  You don't have to decode URL encoded values....

                  If a PHP script is passed some data through GET or POST (i.e. in a form or in the query string) then php will automatically decode that data when the script runs, and the decoded data will be available in the either the $GET or $POST arrays. You shouldn't have to touch that at all.

                  If you want to check whether data is being passed between scripts, just do this:

                  print_r($POST); or print_r($GET)

                  That will show all the data that was passed from the previous script through a form or the query string.

                  Unless you've fixed up your code too as I mentioned before of course it won't be working anyway. You were still using ASP and not PHP in a lot of spots, esp concerning the Challange variable.

                  That's most likely your problem.

                  Take your time...read through the code and make sure it's all correct...

                  k, good luck man
                  - Adam 🙂

                    You don't have to decode URL encoded values....

                    If a PHP script is passed some data through GET or POST (i.e. in a form or in the query string) then php will automatically decode that data when the script runs, and the decoded data will be available in the either the $GET or $POST arrays. You shouldn't have to touch that at all.

                    If you want to check whether data is being passed between scripts, just do this:

                    print_r($POST); or print_r($GET)

                    That will show all the data that was passed from the previous script through a form or the query string.

                    Unless you've fixed up your code too as I mentioned before of course it won't be working anyway. You were still using ASP and not PHP in a lot of spots, esp concerning the Challange variable.

                    That's most likely your problem.

                    Take your time...read through the code and make sure it's all correct...

                    k, good luck man
                    - Adam 🙂

                      Write a Reply...