i have this code in the top of my index.php. And it works perfect when i run it locally with mamp. But when i go live with the page and upload it to the hosting service and launch the website i get this error in the log. And the site does not load.
PHP Parse error: syntax error, unexpected '?' in /home/*****/*****.*****.**/index.php on line 3
<?php
session_start();
$AccountsucessRegister = $_SESSION['Accountsucess'] ?? '';
$AccountfailRegister = $_SESSION['Accountfail'] ?? '';
unset($_SESSION['Accountsucess']);
unset($_SESSION['Accountfail']);
?>
<?php if ($AccountsucessRegister !== ''): ?>
<?php echo "<script>alert('$AccountsucessRegister');</script>" ?>
<?php endif; ?>
<?php if ($AccountfailRegister !== ''): ?>
<?php echo "<script>alert('$AccountfailRegister');</script>" ?>
<?php endif; ?>