View Category

Check your language appears on the langref.org site

Your language name should appear within the HTML found at the http://langreg.org main page.
php
if (preg_match("/PHP/i", file_get_contents("http://langref.org/"))) {
echo "PHP appears on langref.org";
} else {
echo "PHP doesn't appear on langref.org";
}

Send an email

Use library functions, classes or objects to create a short email addressed to your own email address. The subject should be, "Greetings from langref.org", and the user should be prompted for the message body, and whether to cancel or proceed with sending the email.
php
/* This is a version without any prompt – use it for a website */
$to = "mail@domain.tld";
$subject = "Greetings from langref.org";
$body = "Hi,\n\nHow are you?";
$headers = "From: sender@domain.tld\n"; // you can comment this out and delete it from below
if (mail($to, $subject, $body, $headers)) {
echo "Success";
}

/****
* For some (security)reason I couldn't
* submit this without adding a space to
* the functionnames. Please remove it :)
* in this case, only "f write" and "f gets"
****/

$to = "mail@domain.tld";
f write(STDOUT, "Mail: ".$to."\n");
$subject = "Greetings from langref.org";
f write(STDOUT, "Subject: ".$subject."\n");
f write(STDOUT, "Please type the body. Use \\n for newlines: \n");
$body = trim(f gets(STDIN)); // we get input
if ($body == "") { // if empty input
$body = "Hi! How are you?";
f write(STDOUT, "Using standard body: ".$body."\n");
}
f write(STDOUT, "Would you like to send the mail? [y/n]: ");
if (trim(f gets(STDIN)) == "y") {
if (mail($to, $subject, $body)) {
f write(STDOUT, "Success\n");
} else { // fallback
f write(STDOUT, "Failed to mail\n");
}
} else { // fallback
f write(STDOUT, "I'm sorry :(\n");
}