I'm trying to update an old college project, but when I open the php files in browser all php code after -> shows on screen.
The project used to work perfectly, but now any file I open has the same issue. PHP parses until the first appearance of this (->) symbol, and from then on is rendered as text on screen.
For example, here is my connection script:
<?php
$servername = "localhost";
$username = "root";
$password = ""; //no password on mine I don't think, but sure
$dbname = "clubhousetest";
//create connection
$conn = new mysqli($servername, $username, $password, $dbname);
//check connection
if($conn->connect_error){
die("connection failed: ".$conn->connect_error);
}else{
echo "totes connected <br>";
}
?>
When opened in browser, everything after the -> in line 10
if($conn->connect_error){
shows as text within the webpage on screen.
I've had a look around online but cannot figure out what the problem is, and was wondering if one of you might be able to help out.