Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL);
- $pdo = new PDO("mysql:host=localhost;dbname=_fantapc", '_fpcroot', '');
- $query = $pdo->prepare("SELECT * FROM users WHERE id=:id");
- $query->bindValue(":id", $_GET['id'], PDO::PARAM_INT);
- $query->execute();
- $profile = $query->fetch();
- if(isset($_POST['formsub'])) {
- $comment = $_POST['comment'];
- $rating = $_POST['rating'];
- $judge = $_SESSION['user_id'];
- $victim = $_GET['id'];
- $query = $pdo->prepare("INSERT INTO profile_comments(user_id_judge,user_id_victim,comment, rating) VALUES (:user_id_judge,:user_id_victim,:comment,:rating)");
- $query->bindValue(":comment", $comment, PDO::PARAM_STR);
- $query->bindValue(":rating", $rating, PDO::PARAM_INT);
- $query->bindValue(":user_id_judge", $judge, PDO::PARAM_INT);
- $query->bindValue(":user_id_victim", $victim, PDO::PARAM_INT);
- $query->execute();
- }
- ?>
- <table><tr><td><p class='lead'>PROFILE PIC</p></td><td>
- <h1><? echo strtoupper($profile['username']); ?></h1><br />
- <img class='pull-right' src='img/abel.gif' />
- Fantasica ID: <? echo $profile['gameid']; ?><br />
- Member since: <? echo $profile['signUpDate']; ?></p>
- </td></tr>
- </table>
- <? if($_SESSION['username']) {
- echo "<table><td>";
- echo "<form action='index.php?page=profile&id={$_GET['id']}' method='post'>";
- echo "<input type='text' name='comment'><br>";
- echo "<input type='hidden' name='formsub' value='1'>";
- echo '<tr><td></td><td><input type="image" src="img/send.png" alt="Submit Form" /></td></tr>';
- echo "</form></td>";
- } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement