1
아래 코드와 같은 값을 읽는 모달이 있습니다. 모달 내에서 제출 버튼을 클릭하면 $ row3 [ 'first_name'] 등의 값을 데이터베이스에 삽입 할 수 있습니까? 나는 이것을 연구했지만 텍스트 필드를 주로 사용하므로 많은 정보를 보지 못했습니다.버튼 클릭시 데이터베이스에 데이터를 삽입하는 방법은 무엇입니까?
<a href="#" class="btn btn-success hidden" id="request" data-toggle="modal" name="req" data-target="#basicModal">Request from Lender</a>
</br></br>
<form action="" method="post">
<div class="modal fade" id="basicModal" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
<h4 class="modal-title" id="myModalLabel"><?php
print $row3['title'] . ' from ' . $row3['first_name'] . ' ' . $row3['last_name'];
?></h4>
</div>
<div class="modal-body">
<p>Are you sure you want to borrow <b> 1 x <?php
print $row3['title'];
?></b> from <b> <?php
print $row3['first_name'];
?> <?php
print $row3['last_name'];
?></b> for <b id="total"></b> cogs?
</br></br> You will be required to collect and return this item to <?php
print $row3['houseno'];
?> <?php
print $row3['address1'];
?> <?php
print $row3['postcode'];
?>.
</br></br> <?php
print $_GET[$from];
?> Your cogs will not be transferred to <?php
print $row3['first_name'];
?> until you have confirmed you wish to proceed following the lenders decision!</p>
</div>
<div class="modal-footer">
<button type="submit" value="submit" class="btn btn-success">Register</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</form>
어떻게 내가 그 일을 가겠어요? : S – user2244961
업데이트 응답을 참조하십시오 – Tbseven
고마워요 - 그래도 이런 식으로 끝내 줬습니다 ... if (isset ($ _ POST [ 'button1'])) { $ q = mysql_query ("INSERT INTO table (keys) VALUES ('$ values') ") 또는 die (mysql_error()); if ($ q) { echo "successful"; } else { echo "error"; } } – user2244961