regarding url appending

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bandy
    New Member
    • Mar 2010
    • 25

    regarding url appending

    Hi,
    This is the code snippet,
    Code:
    function notEmpty()
    	{
    		{"data-file":"file1.php?p="+act.value+"&q="+inact.value+"&r="+dis.value}
    		
    	}
    in this, i have to pass these three javascript variables, to file1.php with appending above variable, but problem is that i am getting value of acthf.value variable on file1.php but not getting rest two variables. is there any better solution to append rest variables, i need urgent solution on this can anybody please?

    Rushi.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    I rather suspect to be something wrong with the form element calls, for it has been working for me.

    Comment

    • bandy
      New Member
      • Mar 2010
      • 25

      #3
      Hi Dormilich,
      I am sorry but not better in javascript, but before appending these variables to url, I am printing it to make it confirm that getting values in variables, and getting value of first variable , so more confused on this .

      Rushi

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        if you have a link to the page, I could probably tell you more.

        Comment

        • bandy
          New Member
          • Mar 2010
          • 25

          #5
          Hi,
          OK i tell u what i'm doing,
          Code:
          function passdata(){
          {"data-file":"file1.php?p="+acthf.value+"&q="+inacthf.value+"&r="+dishf.value}
          }
          see in this function "file1.php?p="+ acthf.value+"&a mp;q="+inacthf. value+"&r=" +dishf.value is the source for the "data-file".
          The function will be called on body load event.
          Everything works perfect upto this (gets value in variables.)
          Here is problem >>>>>
          when i go to file1.php, i access these values, like this,
          Code:
            $var1 = $_GET['p'];
            $var2 = $_GET['q'];
            $var3 = $_GET['r'];
          i get value of $var1 , but i don't get values of $var2 and $var3. i don't understand why it is so? means am i getting wrong in passing values or what.
          I will really appreciate your help, please..
          Last edited by Dormilich; Mar 5 '10, 07:21 AM. Reason: Please use [code] tags when posting code

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            dump $_GET and $_SERVER["QUERY_STRI NG"] to see, if you correctly passed the URL to PHP

            Comment

            • bandy
              New Member
              • Mar 2010
              • 25

              #7
              can you be specific , what should i do after dumping $_GET in file1.php

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #8
                look at the dump*

                * in case you misunderstood "dump a variable":
                Code:
                var_dump($_GET);

                Comment

                • bandy
                  New Member
                  • Mar 2010
                  • 25

                  #9
                  Sorry to bother you Dormilich, but i tried it with var_dump($_GET['p']) but its giving error.
                  See, i have to display pie chart. so i am using file1.php as a source file for parameters. so i have to pass these three variables as parameters. appending url is: "data-file":"file1.ph p?p="+acthf.val ue+"&q="+in acthf.value+"&a mp;r="+dishf.va lue
                  see i am getting value of 1st variable in file1.php, but not getting rest two with above code.
                  am i making mistake in above url, or is there any other way to do this(like split function ).
                  The page in which i am writing code has action to page itself. is this because of that, if it is so why i'm getting value of 1st variable.
                  can you make my these points clear.

                  Comment

                  • Dormilich
                    Recognized Expert Expert
                    • Aug 2008
                    • 8694

                    #10
                    do var_dump($_GET) ;, this will show all parameter contents of the URL

                    Comment

                    • bandy
                      New Member
                      • Mar 2010
                      • 25

                      #11
                      JSON Parse Error [Syntax Error]
                      Error at character 0, line 1:

                      0: string(1) "1"
                      getting this error.

                      Comment

                      • Dormilich
                        Recognized Expert Expert
                        • Aug 2008
                        • 8694

                        #12
                        what actually you put in the URL??? or rather, where does that output come from?

                        Comment

                        Working...