Community Forums 

Main Content

Re:remote call with myspl

    May 25 2011 06:26:04

    #1

    totr

    Join date : 2010-04-03      Posts : 17

    Fixed it,

    On Mals click remote call and enter your path to cart_insert.php

    eg www.mydomain.com/cart_insert.php

    method POST

    Next

    I changed in mysql the id to an auto_increment and removed the default option.

    Then chanded the cart_order.php script to :

    <?PHP
    include("config.php");
    mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database $DBName");

    mysql_select_db($DBName) or die("Unable to select database $DBName");

    $order_date=time("m j y h:i");

    // create varibles

    $id = $_POST['id'];
    $username = $_POST['username'];
    $ip = $_POST['ip'];
    $method = $_POST['method'];
    $cart = $_POST['cart'];
    $discount = $_POST['discount'];
    $subtotal = $_POST['subtotal'];
    $shipping = $_POST['shipping'];
    $tax = $_POST['tax'];
    $total = $_POST['total'];
    $shipping_zone = $_POST['shipping_zone'];
    $inv_name = $_POST['inv_name'];
    $inv_company = $_POST['inv_company'];
    $inv_addr1 = $_POST['inv_addr1'];
    $inv_addr2 = $_POST['inv_addr2'];
    $inv_state = $_POST['inv_state'];
    $inv_zip = $_POST['inv_zip'];
    $inv_country = $_POST['inv_country'];
    $del_name = $_POST['del_name'];
    $del_addr1 = $_POST['del_addr1'];
    $del_addr2 = $_POST['del_addr2'];
    $del_state = $_POST['del_state'];
    $del_zip = $_POST['del_zip'];
    $del_country = $_POST['del_country'];
    $tel = $_POST['tel'];
    $fax = $_POST['fax'];
    $email = $_POST['email'];
    $message = $_POST['message'];

    // query insert

    mysql_query("INSERT INTO orders (id,username,ip,date,method,cart,discount,subtotal,shipping,tax,total,shipping_zone,inv_name,inv_company,inv_addr1,inv_addr2,inv_state,inv_zip,inv_country,del_name,del_addr1,del_addr2,del_state,del_zip,del_country,tel,fax,email,message)

    VALUES
    ('$id',
    '$username','$ip','$order_date','$method','$cart','$discount','$subtotal','$shipping','$tax','$total','$shipping_zone','$inv_name','$inv_company','$inv_addr1','$inv_addr2','$inv_state','$inv_zip','$inv_country','$del_name','$del_addr1','$del_addr2','$del_state','$del_zip','$del_country','$tel','$fax','$email','$message')");

    ?>

    Done


    ----------------------------------------------------------------------------------------

    Now works perfect !! Hope it help others who struggled like me !!

    Eric