Skip navigation
phpandcss
Currently Being Moderated

where to post an upload variable

Nov 4, 2013 12:33 AM

I use a cart on my website and in order for it to process orders I need to post this variable on the form for the check out cart. does it go on the credit card processor form where user inputs the credit card info?

 

<input type="checkbox" title="Manual" name="cmd" value="_cart">

<input type="checkbox" title="Manual" name="upload" value="1">

<input type="checkbox" title="Manual" name="business" value="Your PayPal Email Address">

<input type="checkbox" title="Manual" name="item_name_1" value="Post Your Value Here">

<input type="checkbox" title="Manual" name="amount_1" value="x.xx">

<input type="submit" name="submit" value="submit">

</form>

 
Replies
  • Currently Being Moderated
    Nov 4, 2013 2:00 AM   in reply to phpandcss

    The posted results should be processed in the action page as in

    <form action="mypage.php">

    This action page can be the same page as the form or it could be a different page. This depends on how the script has been coded.

     

    I find the markup, that you have posted, a bit strange though. There is no label for the user to identify the input field.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 4, 2013 10:45 AM   in reply to phpandcss

    If you need to include a variable when the form is submitted, use a hidden field:

     

    <input type="hidden" name="some_variable" value="xyz123">

     

    Although it's called a "hidden" field, it's actually visible in the HTML source code, so it shouldn't be used for sensitive data.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 4, 2013 3:40 PM   in reply to phpandcss

    As David has suggested, you should use hidden fields as in

    <input type="hidden" name="cmd" value="_cart">

    <input type="hidden" name="upload" value="1">

    <input type="hidden" name="business" value="Your PayPal Email Address">

    <input type="hidden" name="item_name_1" value="Post Your Value Here">

    <input type="hidden" name="amount_1" value="x.xx">

    <input type="submit" name="submit" value="submit">

    Also, you should ensure that the red-coloured values have been entered.

     

    As for the placement, because the fields are hidden - with the exception of the submit button - from view, it matters not, as long as they are inside the form. The submit button is usually placed at the end of the fieldset/form.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 4, 2013 6:28 PM   in reply to phpandcss

    1. Your form is meant to be processed by PayPal. PayPal requires information in a format that they understand, hence the fields that you have erroneously typed as 'checkbox'.

     

         If you have a product called 'Pull Up Widget' that has a price of 10 cents, then PayPal needs to know that. The two affected fields would look like

    <input type="hidden" name="item_name_1" value="Pull Up Widget">

    <input type="hidden" name="amount_1" value="0.10">

    2. Copy and paste the following into a new document and view in 'Live' view or in your favourite browser.  Note that hidden fields do not require a label.  

    <!doctype html>

    <html>

    <head>

    <meta charset="utf-8">

    <title>Untitled Document</title>

    </head>

     

    <body>

    <h3>No Label</h3>

    <p>User has no idea what the checkbox is for</p>

    <form>

      <p>

        <input type="checkbox" title="Manual" name="cmd" value="_cart">

      </p>

      <p>

        <input type="checkbox" title="Manual" name="upload" value="1">

      </p>

      <p>

        <input type="checkbox" title="Manual" name="business" value="Your PayPal Email Address">

      </p>

      <p>

        <input type="checkbox" title="Manual" name="item_name_1" value="Post Your Value Here">

      </p>

      <p>

        <input type="checkbox" title="Manual" name="amount_1" value="x.xx">

      </p>

      <p>

        <input type="submit" name="submit" value="submit">

      </p>

    </form>

    <hr>

    <h3>With Label</h3>

    <p>User is told what the checkbox is for</p>

    <form>

      <p>

        <label>

          <input type="checkbox" title="Manual" name="cmd" value="_cart">

          input 1</label>

      </p>

      <p>

        <label>

          <input type="checkbox" title="Manual" name="upload" value="1">

          input 2</label>

      </p>

      <p>

        <label>

          <input type="checkbox" title="Manual" name="business" value="Your PayPal Email Address">

          input 3</label>

      </p>

      <p>

        <label>

          <input type="checkbox" title="Manual" name="item_name_1" value="Post Your Value Here">

          input 4</label>

      </p>

      <p>

        <label>

          <input type="checkbox" title="Manual" name="amount_1" value="x.xx">

          input 5</label>

      </p>

      <p>

        <input type="submit" name="submit" value="submit">

      </p>

    </form>

    </body>

    </html>

    3. Not sure what you mean.     

     

    Here for a free Dreamweaver PayPal-extension and some information that will help

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points