Exemple #1
0
<?php

// outputs merchant id given user id
if ($submitted == 1) {
    require_once '_conn.php';
    if ($included == 1) {
        $id = quoty($id);
    } else {
        $id = quoty($_REQUEST['id']);
    }
    $query = "SELECT * FROM merchantinfo WHERE idu_mi=" . $id;
    $result = mysql_query($query);
    while ($row = mysql_fetch_assoc($result)) {
        $id_mi = $row['id_mi'];
    }
    if ($id_mi > 0) {
        if ($included != 1) {
            $json['id_mi'] = $id_mi;
            echo json_encode($json);
        } else {
            $_SESSION['id_mi'] = $id_mi;
        }
    } else {
        if ($included != 1) {
            echo 'DNE';
        } else {
            header('Location: /registermerchant');
        }
    }
} else {
    ?>
Exemple #2
0
<?php

require_once '_session.php';
// outputs user id given correct username password else DNE
require_once '_conn.php';
$msg = 'Welcome!';
if ($submitted == 1) {
    $u = quoty($_REQUEST['username']);
    $p = quoty($_REQUEST['password']);
    $query = sprintf("SELECT * FROM users WHERE username='******' AND password='******'", $u, $p);
    $result = mysql_query($query);
    while ($row = mysql_fetch_assoc($result)) {
        $username = $row['username'];
        $id = $row['id_u'];
    }
    if ($id > 0) {
        if ($form_submitted == 1) {
            $_SESSION['id_u'] = $id;
            $_SESSION['username'] = $row['username'];
            header('Location: /dashboard');
        } else {
            $json['id_u'] = $id;
            echo json_encode($json);
        }
    } else {
        if ($form_submitted == 1) {
            $msg = 'Incorrect username or password';
        } else {
            echo 'DNE';
        }
    }
Exemple #3
0
<?php

$title = ' customize and order skillfully made things';
require_once 'lay/lay.top.php';
require_once 'lay/lay.topbar.php';
?>
<div class="container">
<?php 
if (strlen($get) > 0) {
    ?>
<div class="panel panel-default"><div class="container">
<h1>Customize this skillfully made product!</h1>
<?php 
    require_once '_conn.php';
    $query = 'SELECT * FROM items WHERE id_i=' . quoty($get) . ' LIMIT 1';
    $result = mysql_query($query);
    while ($row = mysql_fetch_assoc($result)) {
        echo '<div class="row"><div class="col-md-4"><img src="' . $row['photo_large'] . '" /></div><div class="col-md-4"><h2>' . $row['name'] . '</h2> ' . $row['description'] . '<div><hr /><button href="https://testflightapp.com/join/3029fbb8c6cca865ef7515dedf81b87a-MjU4ODA2/" class="btn btn-default">Get the App!</button></div></div></div>';
    }
    echo '</div></div>';
} else {
    ?>
<h1>Get Customized Products Made By Real People</h1>
<?php 
}
?>
<a href="https://testflightapp.com/join/3029fbb8c6cca865ef7515dedf81b87a-MjU4ODA2/"><img src="/appicon.png" width="256" height="256" /></a>
</div>
<?php 
require_once 'lay/lay.bot.php';