-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwiki.php
More file actions
45 lines (33 loc) · 1.59 KB
/
wiki.php
File metadata and controls
45 lines (33 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
include("connection.php");
$cID = $_GET["wid"];
if(empty($cID)){die('<center style="font-weight: bold; color:#F00">You cannot access this page like this</center>');}
if(!is_numeric($cID)){
$sql2 = "SELECT * FROM `wiki_dict` WHERE `word`='".$_GET["wid"]."' AND word LIKE '%".$_GET["wid"]."%'";
$sql_result2 = mysqli_query($conn, $sql2) or die ('request "Could not execute SQL query" '.$sql2);
/* $sql = "SELECT `word` FROM `entries` WHERE id='".$_GET["wid"]."'";
$sql_result = mysqli_query($conn, $sql) or die ('request "Could not execute SQL query" '.$sql); */
$word = $_GET["wid"];
}
else{
$sql2 = "SELECT * FROM `wiki_dict` WHERE `word`=(SELECT `word` FROM `wiki_dict` WHERE id='".$_GET["wid"]."')";
$sql_result2 = mysqli_query($conn, $sql2) or die ('request "Could not execute SQL query" '.$sql2);
$sql = "SELECT `word` FROM `wiki_dict` WHERE id='".$_GET["wid"]."'";
$sql_result = mysqli_query($conn, $sql) or die ('request "Could not execute SQL query" '.$sql);
$row = mysqli_fetch_assoc($sql_result);
$word = $row["word"];
}
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo ucwords(strtolower($word));?> (Wiktionary)</title>
<?php
include("def-header.php");
$num_rows = 0;
while($row2 = mysqli_fetch_assoc($sql_result2)){
$num_rows++;
echo '<li class="hide'.$num_rows.'" value="'.$num_rows.'"><input type="checkbox" name="chk" class="chk">'.str_replace( array('{{','}}') , array('<span style="color: #F0FF00;">','</span>') , str_replace(array('[[',']]'),'',$row2['meaning'])).'</li>';
}
include("def-footer.php");
?>