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

Paypal extra credit Stage 5 PHP build a simple php application

Hi i just wanted to know if this is the correct code for displaying the shirt style and gift message on the paypal for the extra credit. it sends the message but the shirt style and size don't appear this is the code that i used

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
                        <input type="hidden" name="cmd" value="_s-xclick">
                        <input type="hidden" name="hosted_button_id" value="<?php echo $product["paypal"]?>">
                        <input type="hidden" name="item_name" value="<?php echo $product["name"]?>">    
                        <table>
                        <tr>
                            <th>
                                <input type="hidden" name="on0" value="Sizes">
                                <label for="os0">Sizes</label><br>

                            </th>
                            <td>
                                <select name="os0" id="os0">
                                    <?php foreach($product["sizes"] as $size) { ?>
                                    <option value="<?php echo $size?>"><?php echo $size?></option>
                                    <?php } ?>
                                </select>
                            </td>
                        </tr>

                            <tr>
                            <th>
                                <input type="hidden" name="on0" value="Style">
                                <label for="os0">Style</label><br>

                            </th>
                            <td>
                                <select>
                                    <?php foreach($product["styles"] as $style) { ?>
                                    <option value="<?php echo $style?>"><?php echo $style?></option>
                                    <?php } ?>
                                </select>
                            </td>
                        </tr>

                            <tr>
                            <th>
                                <input type="hidden" name="on0" value="Message">
                                <label for="os0">Message</label><br>

                            </th>
                            <td>
                                <textarea name="os0" id="os0" placeholder="Gift Message"></textarea>
                            </td>
                        </tr>

                        </table>
                        <input type="submit" value="Add to Cart"  border="0" name="submit">
                    </form>

1 Answer

I'm not that far into the training yet so not much help...but when I get there, I will return to your question :)

I sorted figured it out haha if you need help just gimme a shout