-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
News articles are now loaded from the server.
- Loading branch information
T0astBread
committed
Jul 27, 2017
1 parent
d80c3e4
commit 753268d
Showing
2 changed files
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
<?php | ||
include_once "utils.internal.php"; | ||
|
||
if(!isset($_GET["id"])) bad_request("You need to specifiy the id of the news story to load!"); | ||
if(!isset($_GET["id"]) || !isset($_GET["lang"])) bad_request("You need to specifiy the id and language (lang) of the news story to load!"); | ||
$id = $_GET["id"]; | ||
$lang = $_GET["lang"]; | ||
if(!is_numeric($id)) bad_request("The id must be a number!"); | ||
if($id < 0) bad_request("The id must be bigger than 0!"); | ||
|
||
|
||
echo "This is the news text for id ".$id; | ||
require_once "db/db.internal.php"; | ||
|
||
$stmt = $mysqli->prepare("SELECT text FROM news_article_localizations, languages WHERE article_id = ? AND languages.abbreviation = ? AND news_article_localizations.language_id = languages.id"); | ||
$stmt->bind_param("is", $id, $lang); | ||
$stmt->execute(); | ||
$stmt->bind_result($text); | ||
$stmt->fetch(); | ||
echo $text; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
753268d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This closes #17