테스트 사이트 - 개발 중인 베타 버전입니다

db값 불러오기 채택완료

조미가 4년 전 조회 3,557

결과코드와 비번을 입력하여, db의 값($a_test_name)을 불러와 값의 위치로 이동하여, 결과값 페이지를 보여주려고 합니다.

</strong></p>

<p>action="/bbs/page.php?hid=we_result_<?=$a_test_name?>"</p>

<p><strong>

그런데 위의 form 의 action에 들어갈 db값을 못 불러오고 있습니다.  여러가지로 해봐도 잘 안되네요..

 

</strong></p>

<p><strong>// 변수 지정     

$result_code = $result_code1.'-'.$result_code2 ;  // 입력코드 및 db 값 형식 '0000-0000'

$result_pw = $result_pw; // 비번 및 db 값 형식 '0000'</strong></p>

<p> </p>

<p><strong>// 검사 결과 데이터 

$res = sql_fetch(" SELECT * FROM ptest_result WHERE result_code=$result_code AND</strong></p>

<p><strong>result_pw=$result_pw ");</strong></p>

<p>

<strong>$a_test_name = $res['test_name'];</strong></p>

<p> </p>

<p>//========</p>

<p><strong>         

<form name="rForm" method="post" </strong></p>

<p><strong>                               action="/bbs/page.php?hid=we_result_<?=$a_test_name?>" </strong></p>

<p><strong>                               onsubmit="return goResult();">

 </strong></p>

<p><strong><div class="result-code">

   <input type="hidden" name="result_code">

   <input type="text" onkeyup="nextInput(this, 4);" name="result_code1" </strong></p>

<p><strong>                     placeholder="결과코드(앞)"><span class="dashbar">-</span></strong></p>

<p><strong>   <input type="text" onkeyup="nextInput(this, 5);" name="result_code2"</strong></p>

<p><strong>                    placeholder="결과코드(뒤)">

</div>

     <input type="password" name="result_pw" placeholder="비밀번호">

      <button type="submit" class="ptest-btn" style="background: #7FB5FF; </strong></p>

<p><strong>         height: 66px"> 결과 확인</button>

</form></strong>

 </p>

<p><strong>
 

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
e
4년 전

아래와 같이 작은 따옴표를 추가해보세요.

result_pw=password('$result_pw') 로 해야하는건 아닌가요?? 

</p>

<p>$res = sql_fetch(" SELECT * FROM ptest_result WHERE result_code='$result_code' AND

result_pw='$result_pw' ");</p>

<p>

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

조미가
4년 전
'$result_code' AND result_pw='$result_pw' 2군데 따옴표를 추가했습니다만 잘 안됩니다.

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인