I am new to PHP, i started developing application using php, please look into my code
index.php
[php]<?php require_once('./config.php'); ?>
<?php /* * Following code will get single product details * A product is identified by product id (pid) */ // array for JSON response $response = array(); // check for required fields if (isset($_POST['name'])) { $title = $_POST['name']; $company = $_POST['company']; require_once('./db_connect.php'); // connecting to db $db = new DB_CONNECT(); // mysql inserting a new row $result = mysql_query("INSERT INTO user(name,company) VALUES('$title','$company')"); } ?> // this identifies your website in the createToken call below Stripe.setPublishableKey("<?php echo $stripe['publishable_key']; ?>"); function stripeResponseHandler(status, response) { if (response.error) { // re-enable the submit button $('.submit-button').removeAttr("disabled"); // show the errors on the form $(".payment-errors").html(response.error.message); } else { var form$ = $("#payment-form"); // token contains id, last4, and card type var token = response['id']; // insert the token into the form so it gets submitted to the server form$.append(""); // and submit form$.get(0).submit(); } } $(document).ready(function() { $("#payment-form").submit(function(event) { // disable the submit button to prevent repeated clicks $('.submit-button').attr("disabled", "disabled"); // createToken returns immediately - the supplied callback submits the form if there are no errors Stripe.createToken({ number: $('.card-number').val(), cvc: $('.card-cvc').val(), exp_month: $('.card-expiry-month').val(), exp_year: $('.card-expiry-year').val() }, stripeResponseHandler); return false; // submit from callback }); });Name:
Company:
Purchase a quote by Oscar Wilde today! Only $535! Limited supply and going fast, buy now!!
Card Number
CVC
Expiration (MM/YYYY)
/
Buy!
Tab 3 Content Goes Here...