Skip to content

Instantly share code, notes, and snippets.

@khamanaka
Created January 7, 2009 00:07
Show Gist options
  • Save khamanaka/44086 to your computer and use it in GitHub Desktop.
Save khamanaka/44086 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
<head>
<meta http-equiv="Content-Language" content="ja" />
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis" />
<title>Sync Static Pages.</title>
<style type="text/css">
<!--
body { font-family: "Lucida Grande", "Hiragino Kaku Gothic Pro", Geneva, Arial, Verdana, sans-serif; }
.pre { width: 50%; background-color: #f3f3f3;}
-->
</style>
</head>
<body>
<?php
if(isset($_POST['mode'])){
$mode = $_POST['mode'];
$mode = htmlspecialchars($mode);
if($mode == 'confirm'){
$output = shell_exec('sar 1 1');
}elseif($mode == 'sync'){
$output = shell_exec('ls -la');
}else{
$mode = 'start';
}
}else{
$mode = 'start';
}
?>
<?php if($mode == 'start'){ ?>
<h1>Sync StaticPages.</h1>
<p>Click button to sync static pages you transferred.</p>
<form action="sync.php" method="POST">
<input TYPE="hidden" NAME="mode" VALUE="confirm">
<input type="submit" name="submit" value="SyncStart.">
</form>
<?php } elseif ($mode == 'confirm') { ?>
<h1>Confrim Page.</h1>
<p>Are you ready?</p>
<pre class="pre"><?php echo($output);?></pre>
<table border=0 cellspacing=0 cellpadding=5>
<tr>
<td>
<form action="sync.php" method="POST">
<input TYPE="hidden" NAME="mode" VALUE="start">
<input type="submit" name="submit" value="Not,yet...">
</form>
</td>
<td>
<form action="sync.php" method="POST">
<input TYPE="hidden" NAME="mode" VALUE="sync">
<input type="submit" name="submit" value="I'm ready!">
</form>
</td>
</tr>
</table>
<p style="color:#999999;font-size:small;">Please push the button only once.</p>
<?php } elseif ($mode == 'sync') { ?>
<h1>Sync StaticPages.</h1>
<p>Start sync... Please wait a moment.</p>
<pre class="pre"><?php echo($output);?></pre>
<form action="sync.php" method="POST">
<input TYPE="hidden" NAME="mode" VALUE="start">
<input type="submit" name="submit" value="back to TOP">
</form>
<?php } ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment