저는 PHP를 배우기위한 간단한 PHP 폼을 가지고 있습니다. 튜토리얼의 코드가 있습니다. 내 HTML은 다음과 같습니다POST 할 수 없습니다.
<form action="php/learnphp.php" method="post">
<table border="0">
<tr>
<td>Name</td>
<td align="center">
<input type="text" name="username" size="30" />
</td>
</tr>
<tr>
<td>Address</td>
<td align="center">
<input type="text" name="streetaddress" size="30" />
</td>
</tr>
<tr>
<td>City</td>
<td align="center">
<input type="text" name="cityaddress" size="30" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Submit" />
</td>
</tr>
</table>
</form>
내 PHP 파일은 다음과 같습니다 /php/learnphp.php 게시 할 수 없습니다 :
<?php
$usersName = $_POST['username'];
$streetAddress = $_POST['streetaddress'];
$cityAddress = $_POST['cityaddress'];
echo '<p>Your Information</p>';
// You can combine variables with text using a .
echo $usersName. ' lives at </br>';
echo $streetAddress. ' in </br>';
echo $cityAddress. '</br></br>'; ?>
난라는 오류가 제출 버튼을 누르면.
나는 루트 맵에 'php'라는 맵을 가지고있다. 나는 아마 그것이 정말로 간단하다는 것을 알고있다. 그러나 나는 그것을 이해할 것 같지 않다.
learnphp.php 및 HTML 관련 파일은 다른가요? – rahulsm
예 2 파일이 있습니다 : 첫 번째는 html로 양식, 두 번째는 learnphp.php입니다 – Rikkers
learnphp.php는 폴더 php에 있습니까? 파일의 위치를 모두 공유 할 수 있습니까 – rahulsm