ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文

  メンテナンス 前画面に戻る

対象スレッド 件名: PHP : 初心者用フォームスケルトン : SQL、メール、Twitter
名前: lightbox
処理選択
パスワード

件名 PHP : 初心者用フォームスケルトン : SQL、メール、Twitter
名前 lightbox
コメント
[[form.htm]]
@DIV
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>初心者用フォームスケルトン : SQL、メール、Twitter</title>
<script type="text/javascript">
function setPhpName() {
	var php_type = document.getElementById("php_type").value;
	if ( php_type != "none" ) {
		var param = document.getElementById("s");
		param.value = php_type;
	}
}

function resetIframe() {
	var ifdoc = document.getElementById("result").contentWindow.document;
	ifdoc.write("");
	ifdoc.close();
}
</script>
</head>
<body>
<div style='padding:10px;'>
<table style='width:100%'><tr>
<td style='width:1px;vertical-align:top;'>
<form
	id="frm"
	action="php.php?s=info"
	method="get"
	target="result"
	style='display:inline;'
>
	<input type="hidden" id="s" name="s" value="info">
	<span style='font-size:20px;'>初心者用フォームスケルトン</span>
	<textarea
		name="text"
		style='width:400px;height:300px;resize:none;'
	></textarea>
	<input
		type="submit"
		value="送信"
	/>
	<input
		type="button"
		value="結果をリセット"
		onclick='resetIframe();'
	/>
	<br />
	<br />
	処理タイプ : <select id="php_type" onchange='setPhpName()'>
	<option value="none"></option>
	<option value="dbaccess">SQL</option>
	<option value="mail">メール</option>
	<option value="twitter">Twitter</option>
	<option value="info">php の情報</option>
	</select>
</form>
</td><td>
<iframe
	id="result"
	name="result"
	frameborder="1"
	scrolling="yes"
	style='width:100%;height:700px;'
></iframe>
</td>
</tr></table>
</div>
</body>
</html>
@END

[[php.php]]
@DIV
<?
header( "Content-Type: text/html; Charset=utf-8" );
header( "pragma: no-cache" );
header( "Expires: Wed, 31 May 2000 14:59:58 GMT" );
header( "Cache-control: no-cache" );

ini_set( 'display_errors', "1" );

include( $_GET['s'] . ".php" );
?>
@END