Button-hyperlink and PHP variables.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • opt_inf_env@yahoo.com

    Button-hyperlink and PHP variables.

    Hello,

    anybody know why the following button

    <form action="newpage .php?id=3">
    <input type="submit" value="Cancel">
    </form>


    loads "newpage.ph p?" (not "newpage.php?id =3")?

  • Wayne

    #2
    Re: Button-hyperlink and PHP variables.

    On 8 Jul 2005 12:41:12 -0700, opt_inf_env@yah oo.com wrote:
    [color=blue]
    >Hello,
    >
    >anybody know why the following button
    >
    ><form action="newpage .php?id=3">
    ><input type="submit" value="Cancel">
    ></form>
    >
    >loads "newpage.ph p?" (not "newpage.php?id =3")?[/color]

    Some browsers do not support url parameters in form actions -- I think
    it's officially not supposed to.

    You're supposed to do this instead:

    <form action="newpage .php">
    <input type="hidden" name="id" value="3">
    <input type="submit" value="Cancel">
    </form>


    Comment

    • Geoff Berrow

      #3
      Re: Button-hyperlink and PHP variables.

      I noticed that Message-ID: <i0ptc1ltq42rfl flk4huuk8ealg06 opjmv@4ax.com>
      from Wayne contained the following:
      [color=blue]
      ><form action="newpage .php">
      ><input type="hidden" name="id" value="3">
      ><input type="submit" value="Cancel">
      ></form>[/color]

      shouldn't that be

      <form action="newpage .php" method="get">
      <input type="hidden" name="id" value="3">
      <input type="submit" value="Cancel">
      </form>

      --
      Geoff Berrow (put thecat out to email)
      It's only Usenet, no one dies.
      My opinions, not the committee's, mine.
      Simple RFDs http://www.ckdog.co.uk/rfdmaker/

      Comment

      • John Dunlop

        #4
        Re: Button-hyperlink and PHP variables.

        Geoff Berrow wrote:
        [color=blue]
        > I noticed that Message-ID: <i0ptc1ltq42rfl flk4huuk8ealg06 opjmv@4ax.com>
        > from Wayne contained the following:
        >[color=green]
        > ><form action="newpage .php">
        > ><input type="hidden" name="id" value="3">
        > ><input type="submit" value="Cancel">
        > ></form>[/color]
        >
        > shouldn't that be
        >
        > <form action="newpage .php" method="get">
        > <input type="hidden" name="id" value="3">
        > <input type="submit" value="Cancel">
        > </form>[/color]

        Arguably! though 'method' defaults to GET anyway. I don't see
        why you wouldn't put it in.

        --
        Jock

        Comment

        • John Dunlop

          #5
          Re: Button-hyperlink and PHP variables.

          Wayne wrote:
          [color=blue]
          > Some browsers do not support url parameters in form actions[/color]

          Ok, have you run any tests?
          [color=blue]
          > -- I think it's officially not supposed to.[/color]

          Well, the HTML spec merely restricts 'action' to a URI.
          There's nothing wrong with having a query part in a URI,
          though following the procedures set out in the spec you could
          get some surprising results here!

          --
          Jock

          Comment

          • Tony

            #6
            Re: Button-hyperlink and PHP variables.

            opt_inf_env@yah oo.com wrote:[color=blue]
            > Hello,
            >
            > anybody know why the following button
            >
            > <form action="newpage .php?id=3">
            > <input type="submit" value="Cancel">
            > </form>
            >
            >
            > loads "newpage.ph p?" (not "newpage.php?id =3")?[/color]

            are you checking the value of $_GET["id"]?

            --
            Tony Garcia
            Web Right! Development
            Riverside, CA



            Comment

            • Jerry Stuckle

              #7
              Re: Button-hyperlink and PHP variables.

              opt_inf_env@yah oo.com wrote:[color=blue]
              > Hello,
              >
              > anybody know why the following button
              >
              > <form action="newpage .php?id=3">
              > <input type="submit" value="Cancel">
              > </form>
              >
              >
              > loads "newpage.ph p?" (not "newpage.php?id =3")?
              >[/color]

              Maybe?

              <form action="newpage .php&amp;id=3">

              (Note: not tried).

              --
              =============== ===
              Remove the "x" from my email address
              Jerry Stuckle
              JDS Computer Training Corp.
              jstucklex@attgl obal.net
              =============== ===

              Comment

              Working...