Guest User

Untitled

a guest
Oct 15th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.37 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $server ="localhost";
  5. $user = "root";
  6. $password = "";
  7. $blogdb = 'woofwarr_blog';
  8. $usersdb = 'woofwarr_users';
  9. $gallerydb = 'woofwarr_gallery';
  10. $pettdb = 'woofwarr_pett';
  11.  
  12. //connect to server and select database; you may need it
  13. $link = mysqli_connect($server, $user, $password, $gallerydb);
  14.  
  15. mysqli_set_charset($link, 'utf8mb4');
  16.  
  17. if (mysqli_connect_errno()) {
  18. //printf("Connect failed: %sn", mysqli_connect_error());
  19. //exit();
  20. }
  21.  
  22. mysqli_select_db($link, $blogdb);
  23.  
  24. mysqli_query($link, "CREATE TABLE IF NOT EXISTS `forum_posts` (`post_id` int(50) NOT NULL AUTO_INCREMENT, `post_text` text NOT NULL,`post_create_time` int(10) NOT NULL,`post_owner` varchar(50) NOT NULL,`post_title` varchar(50) NOT NULL,`post_image` varchar(50) NOT NULL, PRIMARY KEY (`post_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
  25. mysqli_query($link, "CREATE TABLE IF NOT EXISTS `comments` ( `comment_id` int(100) NOT NULL AUTO_INCREMENT, `post_id` int(50) NOT NULL, `user_id` int(50) NOT NULL, `comment` text NOT NULL, `comment_date` int(10) NOT NULL, PRIMARY KEY(`comment_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
  26.  
  27. ?>
  28.  
  29. <?php
  30. //path to users dir
  31. $domain = 'http://localhost:63342/WW/';
  32.  
  33. $gallery_dir = $domain.'gallery/';
  34.  
  35. $blog_dir = $domain.'woof/';
  36.  
  37. $users_dir = $domain.'users/';
  38. $users_dir_view = $domain.'users/view.php';
  39. $users_pic_dir = $domain.'users/profile_pic';
  40.  
  41.  
  42.  
  43. ?>
  44.  
  45. <?php
  46. session_start();
  47.  
  48. ?>
  49.  
  50. <!DOCTYPE html>
  51. <html>
  52.  
  53.  
  54. <?php
  55. $protocol = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://';
  56. $full_url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . $_SERVER['QUERY_STRING'];
  57.  
  58. ///Constructing breadcrumb
  59. $p = trim($_SERVER['REQUEST_URI'], '/');
  60. $ps = explode('/', $p);
  61. $urp = '';
  62. $bread_crumb_items = '{
  63. "@type": "ListItem",
  64. "position": 1,
  65. "item": {
  66. "@id": "https://neurobin.org",
  67. "name": "Neurobin"
  68. }
  69. },';
  70. for ($i = 0; $i < count($ps); $i++) {
  71. $psc = trim($ps[$i]);
  72. if ($psc == '') {
  73. continue;
  74. }
  75. $bc_name = $psc;
  76. $bc_name = ucfirst($bc_name);
  77. $bc_name = preg_replace('/[-]/', ' ', $bc_name);
  78. $urp = trim($urp, '/') . '/' . $psc . '/';
  79. if ($i == count($ps) - 1) {
  80. $urp = rtrim($urp, '/');
  81. }
  82. $bread_crumb_items .= '{
  83. "@type": "ListItem",
  84. "position": ' . ($i + 2) . ',
  85. "item": {
  86. "@type": "WebPage",
  87. "url": "' . $protocol . trim($_SERVER['HTTP_HOST'], '/') . '/' . ltrim($urp, '/') . '",
  88. "name": "' . $bc_name . '"forum_posts__20160814_083029
  89. }
  90. },';
  91. }
  92. //remove last comma from $bread_crumb_items
  93. $bread_crumb_items = rtrim($bread_crumb_items, ',');
  94.  
  95. if ($bread_crumb_items != '') {
  96. $bread_crumb = '
  97. "breadcrumb": {
  98. "@type": "BreadcrumbList",
  99. "itemListElement": [' . $bread_crumb_items . ']
  100. }';
  101.  
  102. } else {
  103. $bread_crumb = '';
  104. }
  105. $webpage = '
  106. "@type":"WebPage",
  107. "@id":"' . $full_url . '"
  108. ';
  109. if ($bread_crumb != '') {
  110. $webpage .= ',' . $bread_crumb;
  111. }
  112.  
  113. include_once("mysql.php");
  114. include_once("config.php");
  115. //include_once("analyticstracking.php");
  116. $servername = "localhost";
  117. $username = "root";
  118. $password = "";
  119. $table = "woofwarr_users";
  120.  
  121. $link = mysqli_connect($servername, $username, $password, $table);
  122. mysqli_set_charset($link, 'utf8mb4');
  123. if (!$link) {
  124. die("Connection failed: " . mysqli_connect_error());
  125. }
  126.  
  127.  
  128. $servername = "localhost";
  129. $username = "root";
  130. $password = "";
  131. $table = "woofwarr_blog";
  132.  
  133. $conn = mysqli_connect($servername, $username, $password, $table);
  134. mysqli_set_charset($conn, 'utf8mb4');
  135.  
  136. Warning: mysqli_connect(): (HY000/2002): No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/WW/mysql.php on line 13
  137.  
  138. Warning: mysqli_set_charset() expects parameter 1 to be mysqli, boolean given in /Applications/XAMPP/xamppfiles/htdocs/WW/mysql.php on line 15
  139.  
  140. Warning: mysqli_select_db() expects parameter 1 to be mysqli, boolean given in /Applications/XAMPP/xamppfiles/htdocs/WW/mysql.php on line 22
  141.  
  142. Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /Applications/XAMPP/xamppfiles/htdocs/WW/mysql.php on line 24
  143.  
  144. Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /Applications/XAMPP/xamppfiles/htdocs/WW/mysql.php on line 25
  145.  
  146. Warning: mysqli_connect(): (HY000/2002): No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/WW/index-carousel3.php on line 107
  147.  
  148. Warning: mysqli_set_charset() expects parameter 1 to be mysqli, boolean given in /Applications/XAMPP/xamppfiles/htdocs/WW/index-carousel3.php on line 108
  149. Connection failed: No such file or directory
Add Comment
Please, Sign In to add comment