session_start();
if( $_SESSION["ANTI_SPAM"] == "" || strlen( $_SESSION["ANTI_SPAM"] ) != 4 ){
$code = "";
for( $i = 0; $i < 4; $i++ ){
$code .= chr( rand( 65, 90 ) );
}
$_SESSION["ANTI_SPAM"] = $code;
}
$error = "";
// Did somebody try to post?
if( isset( $_POST["name"] ) ){
$name = strip_tags( stripslashes( $_POST["name"] ) );
$url = strip_tags( stripslashes( $_POST["url"] ) );
$text = strip_tags( stripslashes( $_POST["text"] ) );
$email = strip_tags( stripslashes( $_POST["email"] ) );
$error = "";
if( $name == "" ){
$error .= "Please fill in a name.
";
}
if( $text == "" ){
$error .= "Please fill something in the textbox.
";
}
if( $email == "" ){
$error .= "Please fill in your email address.
";
}
if( strtoupper( $_POST["captcha"] ) != $_SESSION["ANTI_SPAM"] ){
$error .= "You seem to be a spammer. Sorry if that's wrong. Please re-enter the captcha code!
";
}
$name = str_replace( ",", ",-", $name );
$url = str_replace( ",", ",-", $url );
$text = str_replace( ",", ",-", $text );
$email = str_replace( ",", ",-", $email );
if( $error == "" ){
mail( "hansiraber@yahoo.de", "fsp5/new comment", "$name\n$email\n$url\n$text\n" );
$file = fopen( "comments.txt", "a" );
fwrite( $file, str_replace( "\n", "
", str_replace( "\r", "", time() . ",,$name,,$url,,$text,,$email" ) ) . "\n" );
fclose( $file );
$code = "";
for( $i = 0; $i < 4; $i++ ){
$code .= chr( rand( 65, 90 ) );
}
$_SESSION["ANTI_SPAM"] = $code;
// clear the post array
$_POST = array();
$error = "Your comment was added!";
}
else{
// hm... error will be displayed below
//mail( "hansiraber@yahoo.de", "fsp5/comment-error", "$name\n$url\n$text\n" );
}
}
?>
import fullscreen.*; FullScreen fs; void setup(){ // set size to 640x480 size(640, 480); // 5 fps frameRate(5); // Create the fullscreen object fs = new FullScreen(this); // enter fullscreen mode fs.enter(); } void draw(){ background(0); // Do your fancy drawing here... for(int i = 0; i < 10; i++){ fill( random(255), random(255), random(255) ); rect( i*10, i*10, width - i*20, height - i*20 ); } }