2010-04-19 5 views
-2

이 html 폼은 addstuds.php를 호출하여 mysql 데이터베이스에 레코드를 삽입하는 코드를 실행합니다. 나는 그래서 regstuds.php (HTML 형식)이해야 할 일을html 폼을 다시 호출하는 방법

<form name="formcheck" method="post" action="addstuds.php"> 
<td width="30" height="35"><font size="3">*I D Number:</td> 
<td width="30"><input name="idnum" onkeypress="return isNumberKey(event)" type="text" maxlength="5" id='numbers'/></td> 
</tr> 

<tr> 
<td width="30" height="35"><font size="3">*Year:</td> 
<td width="30"><input name="yr" onkeypress="return isNumberKey(event)" type="text" maxlength="5" id='numbers'/></td> 

<td width="30" height="35"><font size="3">Section:</td> 
<td width="30"><input name="sec" type="text" maxlength="15"></td> 
</tr> 

실행이 완료됩니다 addstuds.php에 삽입 코드 뒤에 다시 볼 것 하나가 될 것입니다? 도와주세요

답변

0

addstuds.php에있는 양식 처리 코드를 regstuds.php 상단에 포함시키고 양식 조치를 통해 $ _SERVER [ 'PHP_SELF']를 사용하여 regstuds.php로 되돌릴 수 있습니다.

성공 메시지는 추가가 성공하면 플래그를 설정하고 해당 플래그가 true이면 스크립트 태그를 반향시킬 수 있습니다.

1

실행 후 파일은 include 또는 require입니다.

아니면 그냥 좋은 HTTP 리디렉션을 할 수 있습니다 : header('Location: regstuds.php');. 리디렉션과 관련된 문제는 이미 클라이언트에 헤더를 보낸 경우 이미 보낸 후에 수정할 수 없다는 것입니다. 그러나 물론, 거기에 대한 해결책도 있습니다 : 자바 스크립트를 사용하십시오 : window.location = "regstuds.php"; 그것을 할 것입니다.

+0

감사합니다. 괜찮습니다.하지만 더 이상 addstuds.php에 넣은 확인을 볼 수 없습니다. echo ""; – user225269

관련 문제