;

PDA

Click to See Complete Forum and Search --> : Send the form ID to php?


Layne Smith
05-27-2009, 06:06 PM
Hi everybody.

I have a form set up like this...<form id="form1" name="form1" method="post" action="bid.php">
<label for="biddersName">Name: </label>
<input type="text" name="name" id="name" tabindex="10"/>
<label for="biddersEmail">Email: </label>
<input type="text" name="email" id="email" tabindex="11"/>
<label for="biddersAmmount">Bid: </label>
<input type="text" name="ammount" id="ammount" tabindex="12" size="7"/>
<p>
<input type="submit" name="Submit" id="submit" value="Place Bid" tabindex="13" />
</form>which is being pitched to this PHP...<?php
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$bid = $_REQUEST['ammount'] ;
$item = $_REQUEST['form1.id'] ; //I need to figure out how to pass the form id to php.

$message = $name . "," . $email . "," . $bid . "," . $item ;

mail( "name@myDomain.com", "AUCTION: " . $item,
$message, "From: $email" );
header( "Location: http://www. myDomain.com/thankyou.html" );
?> Obviously the variable $item comes in blank because I don't know how to send the form id to the pHP so it can email it to me. Even if I could somehow pass a hard-wired variable from the form into the PHP and email that, it would be fine.

Basically, I'm using the same bid.php to allow people to bid on multiple items separately and I need a way to know which item they're bidding on.

Any help would be appreciated!!!

Thanks,
Layne

MyFriendIsATaco
05-27-2009, 06:55 PM
You should add in an item field then.<input type="hidden" name="item" value="1" />Add that to the form, and it'll submit that item id with it.

Layne Smith
05-27-2009, 09:10 PM
You should add in an item field then.<input type="hidden" name="item" value="1" />Add that to the form, and it'll submit that item id with it.Perfect! Thank you very much!