A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Send the form ID to php?

  1. #1
    Junior Member
    Join Date
    May 2009
    Posts
    2

    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"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

  2. #2
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    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.

  3. #3
    Junior Member
    Join Date
    May 2009
    Posts
    2
    Quote Originally Posted by MyFriendIsATaco View Post
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center