コード例 #1
0
                url: "add-item-to-kart.php",
                type: "GET",
                data: ajaxData,
                dataType: "html",
                success: function(msg){
                    //alert('added to cart');
                }
            });
        });
    });
</script>
</head>

<body>
<?php 
printContainerTop(true);
function getProducts()
{
    $con = mysql_connect("localhost", "root", "");
    if (!$con) {
        die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("xyz_shopping", $con);
    $sql = "SELECT * FROM item";
    $result = mysql_query($sql, $con);
    $cnt = 0;
    while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
        ?>

    <div class="product" product_id="<?php 
        echo $row[0];
コード例 #2
0
        margin-right: 2%;
        float: right;
    }
    textarea.textbox{
        resize: none;
    }
    
    #registration-form div.clear{
        padding: 5px 0;
    }
</style>
</head>

<body>
<?php 
printContainerTop(false);
function register($form_input)
{
    if ($form_input != NULL) {
        $con = mysql_connect("localhost", "root", "");
        if (!$con) {
            die('Could not connect: ' . mysql_error());
        }
        mysql_select_db("xyz_shopping", $con);
        if ($form_input[username] != NULL and $form_input[password] != NULL and $form_input[gender] != NULL and $form_input[address] != NULL and $form_input[email] != NULL) {
            $sql = "INSERT INTO user (username, password, gender, address, email)\n                VALUES\n                ('{$form_input['username']}','{$form_input['password']}','{$form_input['gender']}','{$form_input['address']}','{$form_input['email']}')";
            if (!mysql_query($sql, $con)) {
                die('Error: ' . mysql_error());
            }
            echo "1 record added", $form_input[username];
        }