Skip to content

Instantly share code, notes, and snippets.

@oquno
Created February 2, 2012 08:55
Show Gist options
  • Save oquno/1722436 to your computer and use it in GitHub Desktop.
Save oquno/1722436 to your computer and use it in GitHub Desktop.
ワンクリック採用.php
<?php
$recruited = false;
if ($_POST["saiyou"])
{
$host = gethostbyaddr(getenv("REMOTE_ADDR"));
$fp = fopen("/path/to/entries", "a");
fwrite($fp, "\n".date("Y-m-d H:i:s")."\t".$host);
fclose($fp);
$recruited = true;
}
?>
<!DOCTYPE html>
<head>
<meta charset="UTF-8" />
<title>ワンクリック採用</title>
<style>
#sbmt { font-size: x-large; }
</style>
</head>
<h1>ワンクリック採用</h1>
<?php if ($recruited):?>
<p>応募完了しました</p>
<?php else :?>
<p>採用する企業名はリモートホストから取得します</p>
<form name="frm" method="POST">
<input type="hidden" name="saiyou" value="true" />
<input type="submit" id="sbmt" onclick="disabled=true;document.frm.submit();" value="USERNAMEを採用します"/>
</form>
<?php endif ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment