echo 안의 코드
본문
echo "<input type='button' onClick='window.open('<?="$board_skin_url/sms.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>', '', 'left=1200, top=400, width=420, height=370');' style="cursor:pointer;" value='SMS'>";
에코안에 인풋버튼을 넣으려는데 ...
에러가 나서요,,
어떻게 해야 할지요,,,
답변 4
저런식으로 하는것 보다는요,
우선 html 을 만드세요
<input type='button' onClick="window.open('http://example.com', '', 'left=1200, top=400, width=420, height=370');" style="cursor:pointer;" value='SMS'>
그리고 정상동작 확인되면 'http://example.com' 이부분만 맞도록 해주면 접근이 수월합니다.
<?php
$openurl = "$board_skin_url/sms.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}";
echo '[' . $openurl . ']';
?>
<input type='button' onClick="window.open('<?php echo $openurl; ?>', '', 'left=1200, top=400, width=420, height=370');" style="cursor:pointer;" value='SMS'>
무언가 잘못되었다면 html 이 잘못 뿌려진 것일수 있으니
소스보기로 어떻게 html 이 만들어졌는지 확인도 해보시구요
!-->!-->수정 전:
echo "<input type='button' onClick='window.open('<?="$board_skin_url/sms.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>', '', 'left=1200, top=400, width=420, height=370');' style="cursor:pointer;" value='SMS'>";
수정 후:
?>
<input type='button' onClick='window.open('<?="$board_skin_url/sms.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>', '', 'left=1200, top=400, width=420, height=370');' style="cursor:pointer;" value='SMS'>
<?php
echo "<input type='button' onClick='window.open('<?="$board_skin_url/sms.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>', '', 'left=1200, top=400, width=420, height=370');' style="cursor:pointer;" value='SMS'>";
echo "<input type='button' onClick='window.open('".$board_skin_url."/sms.php?bo_table=".$bo_table."&wr_id=".$list[$i][wr_id]}."', '', 'left=1200, top=400, width=420, height=370');' style="cursor:pointer;" value='SMS'>";