if (isset($_GET['author'])) { $query = $_GET['author']; $filter = 2; } else { if (isset($_GET['section'])) { $query = $_GET['section']; $filter = 1; } else { $filter = 0; } } } if (isset($query)) { viewPost($count, 5, $filter, $query); } else { viewPost($count, 5, $filter, $query); } function viewPost($rowFrom, $numRows, $filter, $query) { // $filter = 0 -- no filter // $filter = 1 -- section // $filter = 2 -- author // $filter = 3 -- post id try { /* $cxn = mysqli_connect(DB_SERVER,$user,$password, $database); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); die(); } */
<?php session_start(); //Database Connectivity include_once "dbinfo.inc.oop.php"; include_once "cookie.php"; if (!isset($_GET['pid'])) { header('Location: index.php'); } $pid = $_GET['pid']; $pviewed = viewPost($pid); $result_cookie = addCookieProduct($cookie_identifier, $pid); $product_details = getPost($pid); $product = mysqli_fetch_array($product_details); $uid = $product['Post_uid']; $category_details = getCategory($product['Post_category']); $category = mysqli_fetch_array($category_details); $user_details = getUserDetails($uid); $user = mysqli_fetch_array($user_details); $title = str_replace(' & ', ' and ', $product['Post_title']); $new_title = str_replace('"', "", $title); $new_title = str_replace("'", "", $new_title); $fb_desc = substr($product['Post_desc'], 0, 85); $fb_string = 'http://www.facebook.com/sharer.php?s=100&p[url]=http://flickecom.com/2013/php/product.php?pid=' . $pid . '&p[images][0]=http://flickecom.com/2013/php/' . $product['Post_img1'] . '&p[title]=' . $new_title . '&p[summary]=' . $fb_desc . '...'; ?> <!DOCTYPE html> <html lang="en"> <!---------------------------------------- Created by: Saurav Majumder All Rights Reserved to Wizlyst.com ------------------------------------------>