* Prints OK message
 *
 * @param string $sNote additional note
 *
 */
function printOk($sNote = '')
{
    if ($sNote) {
        $sNote = ' ' . $sNote;
    }
    echo " <b><font color='green'>OK</font></b>{$sNote}<br><br>";
}
// check php version and zend decoder
echo 'Teste PHP-Version. ';
if (version_compare('5.3', phpversion()) < 0) {
    printOK();
} else {
    printError("PHP 5.3 oder gr&ouml;&szlig;er wird vorausgesetzt. Installiert ist jedoch: " . phpversion() . ".", "Bitte PHP 5.3.x oder gr&ouml;&szlig;er verwenden.");
    $blError = true;
}
//CURL installed?
echo 'Teste ob CURL installiert ist.';
if (extension_loaded('curl')) {
    printOk();
} else {
    printError('CURL nicht verf&uuml;gbar.', 'Bitte Installieren Sie CURL f&uuml;r PHP. Weitere Hinweise in der <a href="http://de2.php.net/manual/en/book.curl.php" target="_blank">PHP Dokumentation</a>.');
    $blError = true;
}
//OpenSSL installed?
echo 'Teste ob OpenSSL installiert ist.';
if (extension_loaded('openssl')) {
Exemple #2
0
function submit($vector, $name, $email, $algorithm, $hardware, $runtime, $notes)
{
    if (!vectorCorrectFormat($vector)) {
        printError("The vector has an incorrect format.");
        return 1;
    }
    $name = str_replace(' and ', ', ', $name);
    $dim = getVectorDimension($vector);
    $norm = getEuclideanNorm($vector);
    $vector = normalizeVector($vector);
    $message = "<p>You have submitted: <br />\nvector='" . htmlspecialchars($vector) . "'<br />\ndim='" . htmlspecialchars($dim) . "'<br />\nname='" . htmlspecialchars($name) . "'<br />\nemail='" . htmlspecialchars($email) . "'<br />\nalgorithm='" . htmlspecialchars($algorithm) . "'<br />\nhardware='" . htmlspecialchars($hardware) . "'<br />\nruntime='" . htmlspecialchars($runtime) . "'<br />\nnorm='" . htmlspecialchars($norm) . "'<br />\nnotes='" . htmlspecialchars($notes) . "'</p>";
    echo $message;
    /* printStep("Testing if vector " . htmlspecialchars($vector) . " is formatted correctly...");
    	
    	printStep("Testing if vector " . htmlspecialchars($vector) . " is the correct solution...");
    	$result = exec("includes/verify --dim " . escapeshellcmd($dim) . " --solution '" . $vector . "'");
    	//echo ("includes/verify --dim " . escapeshellcmd($dim) . " --solution '" . $vector . "'");
    
    
    	if (strcmp($result, "the vector is too long") == 0) {
    		printError("The vector is too long. The sub process returned: " . htmlspecialchars($result));
    		return 1;
    	}
    	
    	if (strcmp($result, "the vector is in the lattice") != 0) {
        printError("The vector is not the correct solution. The sub process returned: " . htmlspecialchars($result));
        return 1;
      }
    	
      $best = vectorIsTheBestInThisDim($dim, $norm);
      
      if (!$best) {
        printError("The vector is a correct solution, but a better vector has already been submitted");
        return 1;
      }
    
    */
    printOK("Success! You have successfully submitted a correct solution!");
    enterInHallOfFame($norm, $vector, $dim, $name, $email, $algorithm, $hardware, $runtime, $notes);
    //mail("*****@*****.**", "[LatticeChallenge] New Solution", $message);
    ?>
<script type="text/css" href="style/colour.css">
     $( '#cell' ).css('background', 'red');
</script>
<?php 
}