/* * The main logic starts here.... */ // // First, a special case; if formmail.php is called like this: // http://.../formmail.php?testalert=1 // it sends a test message to the default alert address with some // information about your PHP version and the DOCUMENT_ROOT. // if (isset($aGetVars["testalert"]) && $aGetVars["testalert"] == 1) { function ShowServerVar($s_name) { global $aServerVars; return isset($aServerVars[$s_name]) ? $aServerVars[$s_name] : "-not set-"; } $sAlert = GetMessage(MSG_ALERT, array("LANG" => $sLangID, "PHPVERS" => implode(".", $aPHPVERSION), "FM_VERS" => $FM_VERS, "SERVER" => IsServerWindows() ? "Windows" : "non-Windows", "DOCUMENT_ROOT" => ShowServerVar('DOCUMENT_ROOT'), "SCRIPT_FILENAME" => ShowServerVar('SCRIPT_FILENAME'), "PATH_TRANSLATED" => ShowServerVar('PATH_TRANSLATED'), "REAL_DOCUMENT_ROOT" => CheckString($REAL_DOCUMENT_ROOT))); if (DEF_ALERT == "") { echo "<p>" . GetMessage(MSG_NO_DEF_ALERT) . "</p>"; } elseif (SendAlert($sAlert, false, true)) { echo "<p>" . GetMessage(MSG_TEST_SENT) . "</p>"; } else { echo "<p>" . GetMessage(MSG_TEST_FAILED) . "</p>"; } exit; } if (isset($aGetVars["testlang"]) && $aGetVars["testlang"] == 1) { if (!IsPHPAtLeast("4.1.0")) { ?> <p>testlang feature only works with PHP version 4.1.0 or later</p> <?php } else {
// First, a special case; if formmail.php is called like this: // http://.../formmail.php?testalert=1 // it sends a test message to the default alert address with some // information about your PHP version and the DOCUMENT_ROOT. // if (isset($HTTP_GET_VARS["testalert"]) && $HTTP_GET_VARS["testalert"] == 1 || isset($_GET["testalert"]) && $_GET["testalert"] == 1) { function ShowServerVar($s_name) { global $aServerVars; return isset($aServerVars[$s_name]) ? $aServerVars[$s_name] : "-not set-"; } $sAlert = "This is a test message. PHP version is " . implode(".", $aPHPVERSION); $sAlert .= "\n\n"; $sAlert .= "DOCUMENT_ROOT: " . ShowServerVar('DOCUMENT_ROOT') . "\n"; $sAlert .= "SCRIPT_FILENAME: " . ShowServerVar('SCRIPT_FILENAME') . "\n"; $sAlert .= "PATH_TRANSLATED: " . ShowServerVar('PATH_TRANSLATED') . "\n"; $sAlert .= "\n"; $sAlert .= "REAL_DOCUMENT_ROOT: " . $REAL_DOCUMENT_ROOT . "\n"; if (DEF_ALERT == "") { ?> <p>No DEF_ALERT value has been set.</p> <?php } elseif (SendAlert($sAlert, false, true)) { ?> <p>Test message sent. Check your email.</p> <?php } exit; } // // check configuration values for potential security problems