Sending two fields via a form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Morrison

    Sending two fields via a form

    Hi,

    I am trying to create an option to vote on a subject. I have created a form
    like so:

    <form method="get" action="place_v ote.php">
    <b>
    Please place your vote for this article<p>
    <input type="radio" name="vote" value="1"> 1 &nbsp&nbsp Worst
    <br />
    <input type="radio" name="vote" value="2"> 2
    <br />
    <input type="radio" name="vote" value="3"> 3
    <br />
    <input type="radio" name="vote" value="4"> 4
    <br />
    <input type="radio" name="vote" value="5"> 5 &nbsp&nbsp Best
    <br />
    <br />
    <input type="submit" value="Vote">
    </b>
    </form>

    However, I also want to send the value of the title of the article from the
    form. I added a new input

    <input type="hidden" name="article" value=$_GET['title']>

    but using the title like this done not work. I know that this GET call does
    work because further up in the code I do the following and it works fine:

    <?php
    include ("phpFunctions. inc");
    $title = $_GET['title'];
    echo("<title>Ar ticle: $type</title>");
    ?>

    The problem is that it sends article=%24titl e rather than the correct title.
    I dont know why this wont work, so any help would be much appreciated!

    Cheers,

    Paul


  • Janwillem Borleffs

    #2
    Re: Sending two fields via a form

    Paul Morrison wrote:[color=blue]
    > <input type="hidden" name="article" value=$_GET['title']>
    >[/color]

    <input type="hidden" name="article" value="<?php print $_GET['title'] ?>">


    JW


    Comment

    • Paul Morrison

      #3
      Re: Sending two fields via a form

      Cheers!
      [color=blue][color=green]
      >> <input type="hidden" name="article" value=$_GET['title']>
      >>[/color]
      >
      > <input type="hidden" name="article" value="<?php print $_GET['title'] ?>">
      >
      >
      > JW
      >[/color]


      Comment

      Working...