찾다
  • 로그인
  • 가입
비밀번호 재설정 성공

당신이 관심을 갖고 있는 프로젝트를 팔로우하고 그들에 관한 최신 뉴스를 맛보세요

HTML 양식

웹사이트는 사용자와 어떻게 상호작용하나요? 대답은 HTML 양식을 사용하는 것입니다. 양식은 뷰어가 입력한 데이터를 서버로 전송할 수 있으므로 서버측 프로그램은 양식을 통해 전달된 데이터를 처리할 수 있습니다.

문법:

<form   method="传送方式"   action="服务器文件">

설명:

1.<form>: <form> 태그는 <form>로 시작하여 < /양식>끝.

2.action: PHP 페이지(save.php) 등 시청자가 입력한 데이터가 전송되는 곳입니다.

3.method: 데이터 전송(get/post) 방법입니다.

<form    method="post"   action="save.php">
        <label for="username">用户名:</label>
        <input type="text" name="username" />
        <label for="pass">密码:</label>
        <input type="password" name="pass" />
</form>

참고:

1. 모든 양식 컨트롤(텍스트 상자, 텍스트 필드, 버튼, 라디오 상자, 확인란 등)을 배치해야 합니다. <form></form> 태그 사이(그렇지 않으면 사용자가 입력한 정보가 서버에 제출되지 않을 수 있습니다!)

2. 메소드의 차이점: post/get 이 부분은 백엔드 프로그래머가 고려해야 할 사항입니다. 관심 있는 친구들은 자세한 소개가 있는 이 섹션의 위키를 확인해 보세요.

새로운 파일
<html> <head> <style> div#container{width:1000px} div#header {background-color: royalblue ;height: 100px;text-align:center;font-size: 20px} div#sidebar{background-color: darkorange;height:400px;width:300px;float:left;} div#mainbody {background-color: forestgreen;height:400px;width:700px;float:left;} div#footer {background-color: powderblue;height: 100px;clear:both;text-align:center;} </style> </head> <body> <div id="container"> <div id="header"> <h1>php中文网</h1> </div> <div id="sidebar"> <dl> <dt>list of book</dt> <dd> <ol> <li>hadoop</li> <li>linux</li> <li>c</li> </ol> </dd> </dl> </div> <div id="mainbody"> <h1>the summary of the book</h1> <p>i will lead you to travel in the season of linux</p> <form> <input type="checkbox" name="married" /> married <br/> <input type="checkbox" name="have a job" /> have a job <br/> <input type="checkbox" name="chinese" /> chinese </form> </div> <div id="footer">good good study day day up</div> </div> </body> </html>
시사 Clear
  • 코스 추천
  • 코스웨어 다운로드
현재 코스웨어를 다운로드할 수 없습니다. 현재 직원들이 정리하고 있습니다. 앞으로도 본 강좌에 많은 관심 부탁드립니다~