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

i am not really getting it

i am failing to understand where to write the process

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 target="paypal" action =="method">

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

2 Answers

Grace Kelly
Grace Kelly
33,990 Points

It looks like you have the action attribute incorrect in your code, the first step in the challenge asks for the data to be sent to "process.php". In order to set the destination we use the "action" attribute, so it should look like:

<?php

<form action = "process.php">

?>

You use the "method" attribute to determine what method should be used to send the data (GET or POST)

Hope that helps!!

a form usually has a method and an action property

the method tells the browser what protocol to use to submit the form, use the GET method when you want to receive information, and POST when you want to send information. the action property tells the browser where to submit the form, this is usually a server side script that will have programming inside to handle the data it receives from the form.

an example

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

when the user hits the submit button on this form, the browser will use the post method to send the data to form.php, and in form.php you or someone else will have written a program that will handle all the form data that just got sent to it