I uses this from to submit some information to '2co' as a payment method some of this information I need to validate it by PHP server-side and in the same time send a notification to the admin by mail to tell him that someone has been paid.
now this is the form.
<form method="post" action="https://sandbox.2checkout.com/checkout/purchase">
                            <div class="body">
                                <div class="half f_right">
                                    <label for="card_holder_name" class="width_100per"><span class="fontRed2">*</span>card_holder_name
                                        </label>
                                    <input type="text" name="card_holder_name" id="card_holder_name"
                                           class="form_textarea_rec"/>
                                </div>
                                <div class="half">
                                    <label for="country" class="width_100per"><span class="fontRed2">*</span>country</label>
                                    <select name="country" id="country" class="form_select_rec">
                                        <option value="EGY" title="Egypt">Egypt</option>
                                        <option value="SaudiArabia" title="saudi Arabia">Any other</option>
                                    </select>
                                </div>
                                <div class="half">
                                    <label for="street_address" class="width_100per"><span class="fontRed2">* </span>street_address </label>
                                    <textarea name="street_address" id="street_address"
                                              class="form_textarea_rec height_50px"></textarea>
                                </div>
                                <div class="half">
                                    <label for="street_address2" class="width_100per"> address2</label>
                                    <textarea name="street_address2" id="street_address2"
                                              class="form_textarea_rec height_50px"></textarea>
                                </div>
                                <div class="half f_right">
                                    <label for="city" class="width_100per"><span class="fontRed2">* city</span>
                                        </label>
                                    <input id="city" type="text" name="city" class="form_textarea_rec"/>
                                </div>
                                <div class="half f_right">
                                    <label for="state" class="width_100per"><span class="fontRed2">*</span>
                                        States</label>
                                    <input id="state" type="text" name="state" class="form_textarea_rec"/>
                                </div>
                                <div class="half">
                                    <label for="email" class="width_100per"> <span class="fontRed2">*</span>Email</label>
                                    <input id="email" type="text" name="email" class="form_textarea_rec"/>
                                </div>
                                <div class="half">
                                    <label for="zip" class="width_100per"> <span class="fontRed2">*</span>Zip</label>
                                    <input id="zip" type="text" name="zip" class="form_textarea_rec"/>
                                </div>
                                <div class="half">
                                    <label for="phone" class="width_100per"> <span class="fontRed2">*</span>
                                        Phone</label>
                                    <input id="phone" type="text" name="phone" class="form_textarea_rec"/>
                                </div>
                            </div>
                            <?php
                            $fullName = @$_POST['card_holder_name'];
                            ?>
                            <input type='hidden' name='sid' value='*****'/>
                            <input type='hidden' name='mode' value='2CO'/>
                            <input type='hidden' name='li_0_type' value='product'/>
                            <input type='hidden' name='li_0_name' value='<?php echo $planName ?> '/>
                            <input type='hidden' name='li_0_price' value='<?php echo $planPrice ?> '/>
                            <input type='hidden' name='card_holder_name' value='<?php echo $fullName ?>'/>
                            <input type='hidden' name='street_address' value='<?php @$_POST['street_address']; ?>'/>
                            <input type='hidden' name='street_address2' value='<?php @$_POST['street_address2']; ?>'/>
                            <input type='hidden' name='city' value='<?php @$_POST['city']; ?>'/>
                            <input type='hidden' name='state' value='<?php @$_POST['state']; ?>'/>
                            <input type='hidden' name='zip' value='<?php @$_POST['zip']; ?>'/>
                            <input type='hidden' name='country' value='<?php @$_POST['country']; ?>'/>
                            <input type='hidden' name='email' value='<?php @$_POST['email']; ?>'/>
                            <div class="footer">
                                <input name="submit" type="submit" value="Continue" class="s_btn"/>
                            </div>
                        </form>
now I need to validate this fields and send the form and I need to send notes to the admin
I know about make it like this
<?php
if(isset($_POST['submit'])){
//remove the action from the form
//write the validation here ...
//and then send the mail 
//but how to post all this in the end to '2co'??
}
?>
 
     
     
     
    