다른 페이지의 양식에서 수집 된 데이터를 사용하여 HTML 페이지를 생성하려고합니다.PHP 함수로 생성 된 페이지 찾기
<html>
<body>
<meta http-equiv="cache-control" content="private" >
<link rel="stylesheet" type="type/css" href="vytran_css.css" />
<head> New Product Introduction </head>
<p> In order to begin the process of introducing a new product, please complete
the following form. Once you are satisfied with your responses to the various
prompts, please click on the submit button at the bottom of the page. If you
would like to start over, click the Reset button. If you have any questions,
Please follow the link that says "Help".
<form action="html_data.php" id=from1 method="post">
Product Name:
<input name="Name" size="20" type="text">
<br><br>
Project Lead Name:
<input name="PLname" size="20" type="text"> <br><br>
Team-members: <br>
<textarea name="Team-members" rows=10 cols=40 type="text"> </textarea> <br><br>
Product Type: <br>
<input name="Product Type" size="20" type="text"> <br><br>
Description: <br>
<textarea name="Description" rows=10 cols=40 type="text"> </textarea>
<br>
<br> <br>
<input value="Submit" type="submit" name="formSubmit">
<input value="Reset" type="reset">
<input value="Help" type="button" onclick="window.location.href='problems.html'">
</form>
</p>
</body>
</html>
을하고 html_data.php 페이지에서 I는 다음과 같습니다 : 나는 양식을 사용하여 HTML 페이지에이 태그가이 내가 그것을 할 것을 요청하고 어떻게해야
<?php
ob_start(); // start trapping output
$name = @$_POST['Name'];
?>
<html>
<body>
<p>
Product Name: <?php echo $Name; ?><br>
Project Lead: <?php echo $PLname; ?><br>
Team Members: <?php echo $Team-members; ?><br>
Description: <?php echo $Description; ?>
</p>
</body>
</html>
<?php
$output = ob_get_contents();
$newfile="output.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file);
ob_end_clean();
?>
. 양식은 문제없이 제출되지만 일단 제출하면 해당 페이지를 찾을 수 없습니다. 내가 바꿀 필요가있는 어떤 아이디어? 양식에서
페이지를 찾을 수 없다는 것은 무엇을 의미합니까? 브라우저에 나타나지 않습니까? 어떤 웹 서버를 사용하고 있습니까? – Sgoettschkes
"제출 한 페이지를 찾을 수 없다"는 것은 무엇을 의미합니까? 양식에 문제가 없다고 말하면됩니다. 당신이 쓰고있는 파일 말이에요? 너는 그것의 이름을 모른다? 그것은'output.txt'입니다. –
hmm $ name 및 'Name', 중첩 된 2 개의 양식이 코드입니까? –