siema potrzebuje otworzyc plik tpl na serwerze . glowny plik index napisany jest w php i wywala mi takie coś 404 Not Found .
serwer jest na ubuntu 16.04 Apache/2.4.18 ktoś coś wie dlaczego tak się dzieje?
<?php
if (!isset($_GET['page'])) { header('Location: template/main.tpl'); }
try {
$db = new PDO
('mysql:host=localhost;dbname=123', 'root', 'Tome', array(PDO
::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")); } catch (PDOException $e) {
}
if (isset($_COOKIE['hash'])) { $sql = $db->query("SELECT * FROM `users` WHERE `hash` = " . $db->quote($_COOKIE['hash']));
if ($sql->rowCount() != 0) {
$row = $sql->fetch();
$user = $row;
}
}
switch ($_GET['page']) {
case 'main':
$page = getTemplate
('main.tpl', array('user'=>$user)); break;
}
function getTemplate($name, $in = null) {
include "template/" . $name;
return $text;
}
function curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
>?
Not Found
The requested URL /main was not found on this server.
a tu po wejsciu na serwer strony
Ten post edytował dvdx95 11.10.2016, 21:46:38