Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending 2 fields via a form

Status
Not open for further replies.

pmorrison1985

Programmer
Mar 4, 2006
7
GB
Hi,

I am trying to create an option to vote on a subject. I have created a form
like so:
Code:
<form method="get" action="place_vote.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
Code:
<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:
Code:
<?php
include ("phpFunctions.inc");
$title = $_GET['title'];
echo("<title>Article: $type</title>");
?>
The problem is that it sends article=%24title rather than the correct title.
I dont know why this wont work, so any help would be much appreciated!

Cheers,

Paul
 
try this instead:
Code:
EITHER
echo "<input type=\"hidden\" name=\"article\" value=\"".$_GET['title']."\">";
OR if you are in place html
<input type="hidden" name="article" value="<?=$_GET['title']?>">
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top