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

두개의 내용을 하나의 필드에 저장하고 싶습니다. 채택완료

윤쓰양 10년 전 조회 4,809

제목 그대로 ...

 

이렇게 칸이 두개라서 두개로 받는데,

 

글쓰기 버튼 눌러서 저장하면

a b 가 wr_email 에 저장되게 하고 싶습니다.

wr_1. wr_2 이런 여분필드말고, wr_link1 이나 wr_homepage 이런곳에 저장되게요 ~

 

어떻게 해야하나요?ㅠ

 

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

답변 2개

채택된 답변
+20 포인트
Rido
10년 전

흠... 

그냥 간단하게 jquery이용해서 하나 만들어 드립니다.

cdn은 그누에 있으니 필요없고 테스트에만 사용하시구요

보여질 input은 안보이셔도 된다면 그냥 hidden처리 하셔도 될거 같네요 

</strong></p><p><strong style="color: rgb(127, 127, 127); font-family: 돋움, Dotum, sans-serif; font-size: 12px; line-height: normal;">
</strong></p><p><strong style="color: rgb(127, 127, 127); font-family: 돋움, Dotum, sans-serif; font-size: 12px; line-height: normal;"></strong><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b><!-- jquery cdn --></b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b><script src="<a href="https://code.jquery.com/jquery-1.11.3.min.js" target="_blank" rel="noopener noreferrer">https://code.jquery.com/jquery-1.11.3.min.js</a>"></script></b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b>
</b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b>
</b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b>
</b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b><form></b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b><input type='text' id="a" class="" val="" /></b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b><input type='text' id="b" class="" val="" /></b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b>
</b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b><!-- 통합될 input --></b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b><input type='text'  id="wr_email" class="" val="" /></b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b></form></b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b>
</b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b>
</b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b><script></b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b>$("#a").change(function(){</b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b><span class="Apple-tab-span" style="white-space:pre">	</span>$("#wr_email").val($("#a").val()+'@'+$("#b").val());<span class="Apple-tab-span" style="white-space:pre">	</span></b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b>});</b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b>
</b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b>$("#b").change(function(){</b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b><span class="Apple-tab-span" style="white-space:pre">	</span>$("#wr_email").val($("#a").val()+'@'+$("#b").val());<span class="Apple-tab-span" style="white-space:pre">	</span></b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b>});</b></span></font></p><p><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; line-height: normal;"><b></script></b></span></font></p><p><strong style="color: rgb(127, 127, 127); font-family: 돋움, Dotum, sans-serif; font-size: 12px; line-height: normal;">
</strong></p><p><strong style="color: rgb(127, 127, 127); font-family: 돋움, Dotum, sans-serif; font-size: 12px; line-height: normal;">
</strong></p><p><strong style="color: rgb(127, 127, 127); font-family: 돋움, Dotum, sans-serif; font-size: 12px; line-height: normal;">
 

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

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

P
10년 전

write_update.skin.php 파일안에

 

$email_inp = $a .'|'. $b;

 

$sql = "UPDATE {$write_table} SET wr_1='{$email_inp}' WHERE wr_id='{$wr_id}'"

sql_query($sql);

 

 

 

그리고 view.skin.php 파일안에

list($email_1, $email_2) = explode('|', $view['wr_1']);

echo $email_1;

echo $email_2;

 

이런식으로 하시면 됩니다.

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

답변에 대한 댓글 1개

윤쓰양
10년 전
sql 문구에서 wr_1 은 왜 들어가는건가요? write_update.skin.php 파일에 넣었더니...
흰화면만 뜨고 아예 먹통이 되었어요~

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

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

로그인