<?php

session_start(); 
error_reporting(E_ALL ^ E_NOTICE);

$_SESSION['test'] = "<b>Test #1:</b> PHP 'session' support is working.";

if ( (isset($_SESSION['test'])) && ($_SESSION['test'] != "") ) {
	echo "<font color='green'>";
	echo $_SESSION['test'];
	echo "</font>";

	echo "<p>Please click the link below to start test #2.";

	// Get path to this script being run.
	if ($_SERVER["PATH_TRANSLATED"]) {
		$_SESSION['SCRIPT_PATH'] = realpath(dirname($_SERVER["PATH_TRANSLATED"]));
	}
	else {
		$_SESSION['SCRIPT_PATH'] = realpath(dirname($_SERVER["SCRIPT_FILENAME"]));
	}

	echo "<p><a href='sessions-test2.php'>Start test #2</a>";
}

else {
	echo "<font color='red'>";
	echo "<b>Test #1 failed.</b><br>";
	echo "It appears that your server does not support PHP 'sessions' properly. You must ask your web host to enable PHP 'sessions' support.";
	echo "<p>It appears that your web server does not support PHP 'sessions' properly. You must ask your web host to enable PHP 'sessions' support.";
	echo "<p>This is probably a mistake by your web host, because PHP 'sessions' support is a very very basic function of PHP.  I recommend contacting your web host and: <ol><li>Tell them that 'PHP sessions is not working on the server'.</li><li>Give them the URL you used to start this test.</li></ol>Your web host can perform the tests themselves and view the source code from the two test files to see what is the problem.";
	echo "<p>Once your web host has fixed this problem, then snippetmaster should work for you.";
	echo "</font>";
}

exit;

?>