function createThread($title, $description) { require 'config.php'; $showId = getShowId($_GET['showTitle']); $channelId = getChannelId($_GET['showTitle']); $sql = $connect->query("INSERT INTO `topics` values('', '{$title}', '{$username}', '{$now}', '{$description}', '{$channelId}', '{$showId}', '')"); }
function getNewLinks() { require 'config.php'; $articleArray = array(); $threadId = $_GET['threadId']; $showId = getShowId($threadId); $sql = $connect->query("SELECT `text` FROM `content` WHERE `showId` = '{$showId}' AND `locationCode` = 'THP_SL_SHOWLINKS'"); while ($rows = $sql->fetch_object()) { $text = $rows->text; echo "<aside>" . $text . "</aside></br>"; } return true; }
function createThread($title) { require 'config2.php'; $showId = getShowId($_GET['showTitle']); $channelId = getChannelId($_GET['showTitle']); $title = strip_tags($title); $now = date('Y-m-d H:i:s'); //$title = mysqli_real_escape_string($connect, $title); $username = $_SESSION['username']; //$sql = $connect->query("INSERT INTO `topics` values('', '$title', '$username', '$now', '', '$channelId', '$showId', '', '0')"); //pdo $sql = "INSERT INTO `topics` values('', :title, :username, :now, '', :channelId, :showId, '', '0')"; $stmt = $pdo->prepare($sql); $stmt->bindParam(":title", $title); //more flexible then bindValue; $stmt->bindParam(":username", $username); $stmt->bindParam(":now", $now); $stmt->bindParam(":channelId", $channelId); $stmt->bindParam(":showId", $showId); $stmt->execute(); }
<input type="text" name="title" ><br> <input type="hidden" value="<?php echo $_SESSION['token']; ?> " name="token"/> <input type="submit" class="buttonStyle" value="Submit"> </form> <?php } ?> </article> <article id="article2"> <!-- group similar information -- articles can have headers and footers--> <?php if (isset($_GET['showTitle'])) { $input = urldecode($_GET['showTitle']); $id = getShowId($input); $result = getTopics($id); if (count($result) == 0) { echo "Be the first to start a thread."; } else { printThreads($result); } } else { header('Location: error.php'); } ?> </article> </section> <aside id="trendingNow" class="sideRight side_news twitter feed trendingNow general threads thread channelFeed"><!-- id was side_news--> <!-- More informaiton -- feeds ect-->