Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $pdo = new PDO("mysql:host=localhost;dbname=_fantapc", '_fpcroot', '');
- $query = $pdo->prepare("SELECT * FROM cards WHERE id=:id");
- $query->bindValue(":id", $_GET['card_id'], PDO::PARAM_INT);
- $query->execute();
- $row = $query->fetch();
- $query = $pdo->prepare("INSERT INTO prices(te_value,pot_value,luna_value, user_id, card_id) VALUES (:te_value,:pot_value,:luna_value,:user_id,:card_id)");
- $query->bindValue(":te_value", $te, PDO::PARAM_INT);
- $query->bindValue(":pot_value", $pot, PDO::PARAM_INT);
- $query->bindValue(":luna_value", $luna, PDO::PARAM_INT);
- $query->bindValue(":user_id", $row2['id'], PDO::PARAM_INT);
- $query->bindValue(":card_id", $_GET['card_id'], PDO::PARAM_INT);
- $query->execute();
- $query = $pdo->prepare("SELECT * FROM users WHERE username=:username");
- $query->bindValue(":username", $_SESSION['username'], PDO::PARAM_STR);
- $query->execute();
- $row2 = $query->fetch();
- echo "<h1>" . "<img src={$row['img_avatar']} />" . $row['name'] . "</h1>";
- ?>
- <table class="table table-striped">
- <tr>
- <td></td><td><strong>TE Value</strong></td><td><strong>Pot Value</strong></td><td><strong>Luna Value</strong></td>
- </tr>
- <tbody>
- <tr><td><strong>Min</strong></td><td><? echo $row['te_value']; ?></td><td><? echo $row['pot_value']; ?></td><td><? echo $row['luna_value']; ?></td></tr>
- <tr><td><strong>Average</strong></td><td><? echo $row['te_value']; ?></td><td><? echo $row['pot_value']; ?></td><td><? echo $row['luna_value']; ?></td></tr>
- <tr><td><strong>Max</strong></td><td><? echo $row['te_value']; ?></td><td><? echo $row['pot_value']; ?></td><td><? echo $row['luna_value']; ?></td></tr>
- </tbody>
- </table>
- <br />
- <?php
- if(isset($_POST['formsub'])) {
- $te = $_POST['te_value'];
- $pot = $_POST['pot_value'];
- $luna = $_POST['luna_value'];
- }
- echo "<form action='index.php?page=card_details&card_id={$_GET['card_id']}' method='post'>";
- ?>
- te value: <input type="text" name="username"><br>
- pot value: <input type="password" name="password"><br>
- luna value: <input type="text" name="email"><br>
- <input type="hidden" name="formsub" value="1">
- <input type="submit">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement