Announcement

Collapse
No announcement yet.

Using ; instead of & in URLs

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

  • Using ; instead of & in URLs

    I heard (and saw) somewhere you can use ; instead of & in addresses to separate variables.
    (not only in PHP, but also with Perl, etc.)

    I tried doing it with vBulletin, and also some other scripts, but it didn't work.
    For example:
    http://vbulletin.com/forum/newthread...ead;forumid=12

    So I asked someone, and he told me something needs to be done inside the script to enable this functionality.

    Not that I see any good reason for using ; and not &, I'm still wondering.

    Thanks.
    Chen Avinadav
    Better to remain silent and be thought a fool than to speak out and remove all doubt.

    גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

  • #2
    You would use ; instead of & to be XHTML 1.1 compliant....

    Comment


    • #3
      BTW:
      Try these:
      http://www.php.net/manual/en/function.urlencode.php
      http://www.php.net/manual/en/function.htmlentities.php


      For some information concerning this, I did a quick search, there could be more, but thats all I found...

      Comment


      • #4
        You could grab them yourself..
        Something like this:
        PHP Code:
        $delimiter ";"

        $pairs explode($delimiter$QUERY_STRING);

        foreach (
        $pairs as $pair) {
            list(
        $var$val) = explode("="$pair);
            $
        $var $val;

        Comment


        • #5
          Forgot a ; after the $delimiter.
          Thanks (again), that worked.

          I'm still waiting for the 'official' way though.
          Chen Avinadav
          Better to remain silent and be thought a fool than to speak out and remove all doubt.

          גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

          Comment


          • #6
            the one i've been using doesn't look as nice :/

            PHP Code:
            function ParseQ($QSTRING$delimeter) {
              if (!(empty(
            $QSTRING))) {
                if (
            ereg($delimeter$QSTRING)) {
                  
            $T_QSTRING explode($delimeter$QSTRING);

                  for (
            $x=0$x count($T_QSTRING); $x++) {
                    
            $T_LINE explode("="$T_QSTRING[$x]);

                    eval(
            "global \$" $T_LINE[0] . ";");
                    eval(
            "\$" $T_LINE[0] . " = " $T_LINE[1] . ";");
                  }
                } else {
                  if (
            ereg("="$QSTRING)) {
                    
            /*
                    ** There is an equals, so were only dealing with one value
                    */
                    
            $T_LINE explode("="$QSTRING);

                    eval(
            "global \$" $T_LINE[0] . ";");
                    eval(
            "\$" $T_LINE[0] . " = " $T_LINE[1] . ";");
                  }
                }
              }

            I think i'll use Marks
            Scott MacVicar

            My Blog | Twitter

            Comment


            • #7
              now that I thought about it

              php.ini in the data handling section

              arg_separator.input = ";&"

              if you set it to that then the delimeter is ; and & as each character is considered one.

              So then you would just need to change ALL the templates and code to use ;

              i think there should be a delimeter variable so we could change it with ease.


              Scott
              Scott MacVicar

              My Blog | Twitter

              Comment


              • #8
                Hmm, thanks Scott.
                I didn't know about that setting.
                Chen Avinadav
                Better to remain silent and be thought a fool than to speak out and remove all doubt.

                גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

                Comment

                Loading...
                Working...
                X