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

form 값 전달 시 에러 채택완료

안녕하세요 아직 초보라 하나 알려주고 나면 적용을 잘못해서 질문을 다시 올립니다 ㅠㅠ form 실행해서 값이 넘어가게 하려구 하는데 되지 않습니다 ㅠㅠㅠ 도움 주시면 감사하겠습니다

 

write.skin.php

if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가</p>

<p>// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨

add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);

?>

<form action="<a href="http://localhost/bbs/write.php?bo_table=medicine_info/"" target="_blank" rel="noopener noreferrer">http://localhost/bbs/write.php?bo_table=medicine_info/"</a> method="POST">

                    <input type="text" name="my" value="<?php echo $adm_drug_code[$i]?>" >

                    <input type="text" name="my2" value="<?php echo $adm_administer[$i]?>">

                    <input type="submit" value="전송">

                    </form>
이동된 write.skin.php
<?php

if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가</p>

<p>// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨

add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);

?>

<?php

$a = $_POST['my'];

$b = $_POST['my2'];

?>

<div><?php echo $a ?></div>

<div><?php echo $b ?></div>

이렇게 테스트로 맨상단에 해서 해보면 값이 제대로 넘어가는데 

 

write.skin.php

</p>

<p>    <label for="wr_1" style=" margin-left:15px;">질병명</label>

    <input type="text" id="wr_1" name="wr_1" class="frm_input" value="<?php echo $wr_1 ?>" >

    <label for="wr_2" style=" margin-left:15px;">약품명</label>

    <input type="text" id="wr_2" name="wr_2" class="frm_input" value="<?php echo $wr_2 ?>" >

    <label for="wr_3" style=" margin-left:15px;">유효성분명</label>

    <input type="text" id="wr_3" name="wr_3" class="frm_input" value="<?php echo $wr_3 ?>" >

   

 

    <input type="button" class="btn_cl"  value="검색"></input>

    <script>

                    $(document).ready(function() {

                        $(".btn_cl").on("click", function(e) {

                            e.preventDefault();

                            console.log(e)

                            $.ajax({

                                url : " <a href="http://localhost/bbs/dataloader/medicine_check.php"," target="_blank" rel="noopener noreferrer">http://localhost/bbs/dataloader/medicine_check.php",</a>

                                type : "post",

                                data : {

                                    wr_1 : $("#wr_1").val(),

                                    wr_2 : $("#wr_2").val(),

                                    wr_3 : $("#wr_3").val()

                                    

                                },

                                success : function(res) {

                                    if(res) {

                                        $("#co_result").html(res);

                                        //alert("성공")

                                        console.log(res)

                                    }

                                }                                

                            });

                

                        });

                    });

                    

                    </script>

                <div style="display:grid; grid-template-columns: repeat(5, 150px); margin:30px; margin-left:200px; text-align: center;">

                    <div>약품명</div>

                    <div>투여경로</div>

                </div>

    <div id="co_result" class="co_result" style="margin-left:35px; ">

    </div>

medicine_check.php

<?php

include_once('./_common.php');</p>

<p>$table=$_POST['tbl'];

$table_2=$_POST['tbl_2'];

$wr_1=$_POST['wr_1'];

$wr_2=$_POST['wr_2'];

$wr_3=$_POST['wr_3'];</p>

<p>

$result = sql_query("select distinct fish_drug.drug_name, administration_method.method_to_administer from fish_drug 

                      join active_ingredients_by_drug

                      on fish_drug.drug_code = active_ingredients_by_drug.drug_code 

                      join active_ingredient 

                      on active_ingredient.ingredient_code = active_ingredients_by_drug.active_ingredient_code 

                      join administration_method

                      on fish_drug.drug_code = administration_method.drug_code 

                      join fish_disease

                      on fish_disease.disease_code = administration_method.disease_code

                      where disease_name ='".$wr_1."' and drug_name='".$wr_2."'and ingredient_name='".$wr_3."'");

for ($i=0; $row=sql_fetch_array($result); $i++) {</p>

<p>  // $d_code[]= $row['disease_code'];

  // $d_name[]= $row['disease_name'];

  // $adm_spe_code[]= $row['species_code'];

  $adm_drug_code[]= $row['drug_name'];

  $adm_administer[]= $row['method_to_administer'];

  

   

  // echo $feed_name;

?>

 <form action="<a href="http://localhost/bbs/write.php?bo_table=medicine_info/"" target="_blank" rel="noopener noreferrer">http://localhost/bbs/write.php?bo_table=medicine_info/"</a> method="POST">

                    <input type="text" name="my" value="<?php echo $adm_drug_code[$i]?>" >

                    <input type="text" name="my2" value="<?php echo $adm_administer[$i]?>">

                    <input type="submit" value="전송">

                    </form>

<?

}

?></p>

<p>
이동된 write.skin.php
<?php

if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가</p>

<p>// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨

add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);

?>

<?php

$a = $_POST['my'];

$b = $_POST['my2'];

?>

<div><?php echo $a ?></div>

<div><?php echo $b ?></div>

write..skin.php에서 값을 입력후 ajax통해 check.php로 가서 form실행을 하는데 form 실행되서 '전송'을 누르면 아래 사진과 같이 에러가 뜹니다 ㅠㅠㅠ

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

답변 1개

채택된 답변
+20 포인트

안에.. 제목과 내용도 모두 추가해줘야 합니다.

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

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

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

로그인

전체 질문 목록