I just finished few things on my project, so I decided to publish it to the server we have at school. However, every time I try to run anything it shows nothing at all. Here's some code I use in my index.php:
<?php require '/root.php'; ?>
In my root.php, I specify everything I want to apply to all of my pages on server, for example:
<?php
$root_php = (realpath(dirname(__FILE__)));
?>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<?php
$db_connection = mysqli_connect("localhost", "username", "password", "db_main");
?>
The lines above work fine, but here's the problem: when I try to include any script with forward slash "/" at the beginning to make sure the path "starts" on the path the "root.php" script is executed, the script breaks returning nothing but plain uncompleted HTML page. When I try to look at the source code, it always looks something like this:
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
The code which breaks it looks something like this:
require_once '/account/login_verify.php';
(there's the slash at the beginning, which I need there to ensure the script won't try to find it somewhere else)
I also tried another hosting with PHP & MySQL support, but it returned (almost) same result:
<!doctype html>
<html>
<head>
It works neither with the slash at the beginning, nor with $root_php
variable to set the whole path to the script.
Is there any problem with Apache / PHP configuration? If not, why does the code fully work on virtual server while it does nothing on the physical server? Any ideas to try are much appreciated. By the way, I don't have access to reconfigure server at our school, but one of our teachers have and can reconfigure it, if I tell him what he should change.
Thanks in advance!