- 1
- 260578
- 조회 수 1093
(상부 Style 생략)
<?php
$naeyong = htmlspecialchars($_POST['contents']);
$chamgo = htmlspecialchars($_POST['age']);
?>
<script type="text/javascript">
// 아이프레임 세로 자동 리사이징 (세로값을 자동으로 추출하여 스크롤바 생기지 않음)
function resizeFrame(frm) {
frm.style.height = "auto";
contentHeight = frm.contentWindow.document.body.scrollHeight;
frm.style.height = contentHeight + 4 + "px";
}
</script>
</head>
<body>
<?php
$name = $_POST['name'];
if(!isset($name)){
$name = "frontpage";
}
?>
<section id="m_main">
<span class="tbar">
<ul>
<li>
<form action="do.php" method="post">
<input type="hidden" name="less" value="<?php echo $name;?>" />
<input type="submit" value="✍" />
</form>
</li>
</ul>
</span>
<iframe src="d/<?php echo $name; ?>.html" name="m_view" width="1000px" height="0px" marginwidth="0px" marginheight="0px" frameborder="no" scrolling="no" onload="resizeFrame(this)">
</iframe>
</section>
</div>
</body>
</html>[page.php]
<html>
<head>
<title>진행중...</title>
<meta charset="UTF-8" />
</head>
<body>
<?php echo $_POST['name'];?>
<?php
$_POST['less'] = $title;
?>
<form action="save.php" method="post">
<fieldset>
<legend>편집</legend>
<textarea name="contents" cols="30" rows="10">
<?php
$fp = fopen("d/$title.html", 'r');
$content = fread($fp, filesize("$title.html"));
echo $content;
fclose($fp);
?>
</textarea>
</fieldset>
<p><input type="submit" /></p>
</form>
<p><?php echo $title;?></p>
</body>
</html>[do.php]
<?php $_POST['contents'] = $dgfd; echo $dgfd; ?>
[save.php]
Post.php에서 열려있는 d 폴더의 html 파일을 그대로 가져와서 do.php에서 불러와서 편집한 다음 save.php에서 저장된 내용을 보려고 합니다.
그러나 실행되지 않더군요, 문제가 무엇인가요?



일단 save.php가 아래처럼 되어야 할 것 같네요
<?php
$dgfd = $_POST['contents'];
echo $dgfd;
?>