Web Analytics Made Easy -
StatCounter Passing Variables in the URL - CodingForum

Announcement

Collapse
No announcement yet.

Passing Variables in the URL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Passing Variables in the URL

    hi

    I am tring to pass variables in the url like this:

    PHP Code:
    print '<img src="shape_cls.php?dataAlpha=$countMen&$dataBeta=$countWomen&title=Gender&dataKeyAlpha=Men&dataKeyBeta=Women">'
    variables assigned to title, dataKeyAlpha and dataKeyBeta work fine but the others dataAlpha and dataBeta do not.

    I am picking them up with _GET[]

    It seems to have a problem passing the variables holding a value and they dont make it to the shape_cls file.

    any help appreciated.
    slh

  • #2
    If you use single quotes in a string in PHP the variables won't be parsed.

    Use double quotes (and escape the double quotes of your html-string) or do it like this:

    PHP Code:
    print '<img src="shape_cls.php?dataAlpha='.$countMen.'&.... 
    www.united-scripts.com
    www.codebattles.org

    Comment


    • #3
      I know this maybe isn't really related, but I'm just wondering how an image's src is a php file? Like what can that accomplish?

      This is not a snide remark, but I'm actually curious as to what cool things this can allow you to do.

      Thanks,
      Sadiq.

      Comment


      • #4
        I should imagine that it's creating an image using the gd library (or similar) in that php file, which would be why the img tag is using the php page

        Comment


        • #5
          Sweet! Who knew? lol, NightFire.... duh

          Anyway, I'm just reading these articles on this GD Library:



          This could be some cool new stuff.... apparently you cannot create GIFs, however. I wonder if you can also create animations using this technology. Or if you can get javascript to do weird things to your jpeg image...

          Time to research!

          Cheers,
          Sadiq.

          Comment


          • #6
            This could be some cool new stuff.... apparently you cannot create GIFs, however. I wonder if you can also create animations using this technology. Or if you can get javascript to do weird things to your jpeg image...
            It will be possible...
            And it is possible using XML, JavaScript and SVG :-)
            www.united-scripts.com
            www.codebattles.org

            Comment


            • #7
              Oh yea I in fact had a question about SVG. However I'm not sure that this is the correct place to post the question...

              Well here goes:

              I have a bunch of SVG files, that make up a website. The website requires Adobe SVG plug-in for my browser to view the SVG files. When I take a look at the source code of the SVG files, they are not text, but in fact some weird binary.

              I'm not sure if these SVG files are in fact encrypted, or are indeed in binary format. I have been trying to research this topic, but have had no luck.

              The website is on a CD, so I cannot give you a link to it. It's a phone book. I wanted to be able to view the text source to grab the phone book information. My company wants to be able to use this information for our area to create an Address Accuracy type of application to concatenate postal codes.

              Anyway, just wondering if anyone has dealt with this sort of thing. I recall viewing some SVG at one point during my computer science degree, and recalling that it looked a lot like HTML or XML even. I was hoping to be able to convert this binary crap to that format if it were possible.

              Any help/direction would be greatly appreciated.

              Thanks,
              Sadiq.

              Comment


              • #8
                rewrite:
                PHP Code:
                print '<img src="shape_cls.php?dataAlpha=$countMen&$dataBeta=$countWomen&title=Gender&dataKeyAlpha=Men&dataKeyBeta=Women">'
                as

                PHP Code:
                print "<img src=\"shape_cls.php?dataAlpha=" $countMen "&dataBeta=" $countWomen "&title=Gender&dataKeyAlpha=Men&dataKeyBeta=Women" ."\" />"

                Comment


                • #9
                  @sad69, sorry, can't help you, i haven't done almost nothing with SVG still...
                  But in fact, that's the wrong place, ask the question in some XML Forum (oder Newsgroup)
                  www.united-scripts.com
                  www.codebattles.org

                  Comment

                  Working...
                  X