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

Kelley Kent
Kelley Kent
33,450 Points

Help!-Integrating with PayPal Code challenge

Hi there,

I am stuck on the HTML Forms code challenge task 1. I have watched the videos several times so I'm not really sure what I am doing wrong. Here is the question:

The code below contains a simple HTML form. It looks fine in the browser, but it does not send the information to the server. In this code challenge, we’ll make a few modifications so that it will. First, we need the data submitted to a process.php file in the same folder as this form.html. What do we need to add to the HTML? (Hint: we need to add one attribute to an existing HTML element.)

And here is the coding that I tried, but got wrong : <!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 <?php include(process.php); ?>>

    <label for="flavor">Flavor</label>
    <select id="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>

I get the message: Bummer! It looks like you have added an attribute to the right element, the form element, but it's not the attribute that determines where the form should submit

But I have tried moving my <?php include(process.php); ?> other places and it just fails. What am I doing wrong?

Thanks, Kelley

5 Answers

Kelley Kent
Kelley Kent
33,450 Points

Sorry, it looks like my question didn't post right but I did this: <form <?php include(process.php); ?>> before the label line

Kelley Kent
Kelley Kent
33,450 Points

Ah it still isn't typing correctly :( I'm doing the include ( process.php after the form

Kelley Kent
Kelley Kent
33,450 Points

Thank you Randy! I went back to the videos that you said and was able to get the right answer. Thanks for your help!

Change the : to a = and you will be good to go.

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

Hey Kelley,

You don't need to include the process.php file: you need to submit the form to it. We initially covered this back when talked about the contact form: Working With Post Variables, 0:30-0:40. We then talked about it briefly again in Creating Paypal Buttons, 2:10-2:15.

What you are looking to do is to add a new attribute to the form element, something like this --

<form attribute="process.php">

-- replacing the word attribute with the correct attribute name.

andrewjc
andrewjc
22,185 Points

Hello Randy,

I have this code and it is not working for this section of the challenge:

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

        <label for="flavor">Flavor</label>
        <select id="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>

Please help - I'm pretty sure its something super simple

andrewjc
andrewjc
22,185 Points

Never mind, I reloaded the webpage and it worked...