Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Build a Simple PHP Application Integrating with PayPal HTML Forms

James Houston II
James Houston II
1,812 Points

I have been stuck on 3/3 for a week now what is the issues with my code HELP!!!

Integrating with PayPal stage 5

form.html
<!DOCTYPE html>
<html>
<head>
  <title>Ye Olde Ice Cream Shoppe</title>
</head>
<body>

<p>Your order has been created. What flavor of ice cream would you like to add to it?</p>

<form action="process.php" method="post">

    <label for="flavor">Flavor</label>
    <select id="flavor" name="flavor"> 

        <option value="">&#8212; Select &#8212;</option>
        <option value="Vanilla">Vanilla</option>
        <option value="Chocolate">Chocolate</option>
        <option value="Strawberry">Strawberry</option>
        <option value="Cookie Dough">Cookie Dough</option>
    </select>

    <input type="submit" value="Update Order">

</form>

</body>
</html>

2 Answers

Any time that data should be not displayed in the browser, they want the data to be "hidden" which means using the <input type="hidden"> element which will not display in the browser. Any data in the hidden element can be accessed by the process.php program. As a side note, any data sent this way can also be seen by the user if they view the source code of the page they are on since input elements are client-side elements.

I put the <input type="hidden"> element above the submit element but you can put it anywhere in the form, I'm sure.

The name and order ID are just inserted from the given text.

<!DOCTYPE html>
<html>
<head>
  <title>Ye Olde Ice Cream Shoppe</title>
</head>
<body>

<p>Your order has been created. What flavor of ice cream would you like to add to it?</p>

<form action="process.php" method="post">

    <label for="flavor">Flavor</label>
    <select id="flavor" name="flavor"> 

        <option value="">&#8212; Select &#8212;</option>
        <option value="Vanilla">Vanilla</option>
        <option value="Chocolate">Chocolate</option>
        <option value="Strawberry">Strawberry</option>
        <option value="Cookie Dough">Cookie Dough</option>
    </select>

    <input type="hidden" name="order_id" value="7546">

    <input type="submit" value="Update Order">


</form>

</body>
</html>

My pleasure, James!

Hugo Paz
Hugo Paz
15,622 Points

Hi James,

Add this after the closing select tag

<input type="hidden" value="7546" name="order_id">