|
-
Send the form ID to php?
Hi everybody.
I have a form set up like this...
PHP Code:
<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 Code:
<?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( "[email protected]", "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
-
Bearded (M|G)od
You should add in an item field then.
PHP Code:
<input type="hidden" name="item" value="1" />
Add that to the form, and it'll submit that item id with it.
-
 Originally Posted by MyFriendIsATaco
You should add in an item field then.
PHP Code:
<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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|