php의 데이터를 배열로 만든후 자바스크립트에서 이용하는법을 알고싶습니다.
예를들어
$orderData['Order']['ordercode'] //주문시 생성되는 주문코드
$orderData['Order']['order_total_price'] //주문시 주문 합계금액이 찍히는 변수
주문코드와 주문합계금액을 오버추어 코드가 실행될때 ?value 의 형태로 파라매터값으로 넘기고 싶음.
<?php if (($this->name == 'Orders' && $this->action == 'complete')) {?> //주문페이지에서 주문완료시 체크
<script type="text/javascript">
/* <![CDATA[ */
var yahoo_conversion_id = 1234; //야후 컨버전 아이디
var yahoo_conversion_label = "M"; //야후 컨버전 라벨
var yahoo_conversion_value = 0; //컨버전 value 수치
if(<?php echo $orderData['Order']['order_total_price']?>){ //만약 주문 합계금액이 있다면
yahoo_conversion_value=<?php echo $orderData['Order']['order_total_price']?>; //야후 컨버전 value에 주문합계금액을 넣는다.
}
/* ]]> */
</script>
<script type="text/javascript" src="https://test.com/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="https://yahoo.co/pagead/conversion/1234/?value=<?php echo $orderData['Order']['order_total_price']?>&label=M&guid=ON&script=0&disvt=true"/>
//주문 합계금액을 파라매터값에 붙여 넘긴다.
</div>
</noscript>
<?php } ?>
현재 이와같이 되어있는데요..저렇게 하게되면 각각의 주문번호에 따른 합계금액이 아닌 주문양에 따른 합계금액이 표시될것 같아서
$orderData['Order']['ordercode'] //주문시 생성되는 주문코드 <- 이것을 value*(?value=<?php echo $orderData['Order']['order_total_price']?>)에 같이 붙이고 싶어서 넘기고 싶습니다.
일단 배열로 만든후 분리해서 자바스크립트에 붙이면 될듯한대..도움 부탁드리겠습니다.
댓글 2개
13년 전
AJAX와 JSON을 배워보세요.
13년 전
원하시는 답은 JSON이네요
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7630 | 10년 전 | 649 | ||
| 7629 |
|
10년 전 | 2380 | |
| 7628 | 10년 전 | 788 | ||
| 7627 |
|
10년 전 | 1021 | |
| 7626 |
|
10년 전 | 1786 | |
| 7625 | 10년 전 | 696 | ||
| 7624 | 10년 전 | 718 | ||
| 7623 |
|
10년 전 | 3078 | |
| 7622 | 10년 전 | 723 | ||
| 7621 |
leeleeleelee
|
10년 전 | 582 | |
| 7620 | 10년 전 | 538 | ||
| 7619 | 10년 전 | 481 | ||
| 7618 | 10년 전 | 1014 | ||
| 7617 | 10년 전 | 722 | ||
| 7616 | 10년 전 | 638 | ||
| 7615 | 10년 전 | 725 | ||
| 7614 | 10년 전 | 1256 | ||
| 7613 |
|
10년 전 | 2082 | |
| 7612 | 10년 전 | 1137 | ||
| 7611 | 10년 전 | 1407 | ||
| 7610 |
|
10년 전 | 1898 | |
| 7609 |
|
10년 전 | 1337 | |
| 7608 |
mwdkim
|
10년 전 | 1129 | |
| 7607 |
|
10년 전 | 1052 | |
| 7606 |
mwdkim
|
10년 전 | 3924 | |
| 7605 | 10년 전 | 686 | ||
| 7604 | 10년 전 | 1025 | ||
| 7603 | 10년 전 | 1647 | ||
| 7602 |
|
10년 전 | 1070 | |
| 7601 |
AniNest
|
10년 전 | 2787 | |
| 7600 |
port443
|
10년 전 | 1026 | |
| 7599 | 10년 전 | 942 | ||
| 7598 | 10년 전 | 1014 | ||
| 7597 | 10년 전 | 4569 | ||
| 7596 |
SeungYeon
|
10년 전 | 886 | |
| 7595 |
untitled
|
10년 전 | 2420 | |
| 7594 |
프로그래머7
|
10년 전 | 1721 | |
| 7593 |
untitled
|
10년 전 | 2361 | |
| 7592 |
untitled
|
10년 전 | 1932 | |
| 7591 |
untitled
|
10년 전 | 2674 | |
| 7590 |
아리마2001
|
10년 전 | 850 | |
| 7589 | 10년 전 | 1108 | ||
| 7588 |
|
10년 전 | 2916 | |
| 7587 | 10년 전 | 1302 | ||
| 7586 | 10년 전 | 667 | ||
| 7585 | 10년 전 | 1690 | ||
| 7584 | 10년 전 | 1409 | ||
| 7583 |
leeleeleelee
|
10년 전 | 1158 | |
| 7582 |
|
10년 전 | 1105 | |
| 7581 | 10년 전 | 1331 | ||
| 7580 | 10년 전 | 985 | ||
| 7579 |
|
10년 전 | 604 | |
| 7578 | 10년 전 | 1428 | ||
| 7577 |
|
10년 전 | 1870 | |
| 7576 | 10년 전 | 1384 | ||
| 7575 |
멋진남자임
|
10년 전 | 1459 | |
| 7574 | 10년 전 | 2118 | ||
| 7573 | 10년 전 | 3248 | ||
| 7572 | 10년 전 | 759 | ||
| 7571 |
|
10년 전 | 781 | |
| 7570 |
|
10년 전 | 1310 | |
| 7569 | 10년 전 | 1547 | ||
| 7568 |
this1mg
|
10년 전 | 1047 | |
| 7567 |
|
10년 전 | 755 | |
| 7566 | 10년 전 | 915 | ||
| 7565 |
Angel하늘
|
10년 전 | 994 | |
| 7564 |
seoldi
|
10년 전 | 1232 | |
| 7563 |
|
10년 전 | 1372 | |
| 7562 |
멋진남자임
|
10년 전 | 2080 | |
| 7561 | 10년 전 | 711 | ||
| 7560 |
leeleeleelee
|
10년 전 | 899 | |
| 7559 | 10년 전 | 5043 | ||
| 7558 |
RinaP
|
10년 전 | 779 | |
| 7557 |
|
10년 전 | 1240 | |
| 7556 | 10년 전 | 1191 | ||
| 7555 |
hyohyojj1234
|
10년 전 | 1659 | |
| 7554 | 10년 전 | 1090 | ||
| 7553 |
senseme
|
10년 전 | 1335 | |
| 7552 |
ehdltdoit
|
10년 전 | 1433 | |
| 7551 |
|
10년 전 | 1819 | |
| 7550 |
leeleeleelee
|
10년 전 | 1585 | |
| 7549 | 10년 전 | 2418 | ||
| 7548 | 10년 전 | 1838 | ||
| 7547 |
멋진남자임
|
10년 전 | 1958 | |
| 7546 | 10년 전 | 999 | ||
| 7545 |
ILMare1003
|
10년 전 | 1279 | |
| 7544 |
|
10년 전 | 1249 | |
| 7543 | 10년 전 | 881 | ||
| 7542 | 10년 전 | 654 | ||
| 7541 |
울라라라우
|
10년 전 | 862 | |
| 7540 | 10년 전 | 1597 | ||
| 7539 | 10년 전 | 930 | ||
| 7538 |
|
10년 전 | 1829 | |
| 7537 | 10년 전 | 3609 | ||
| 7536 |
Gaumi
|
10년 전 | 1410 | |
| 7535 |
프로그램은어려워
|
10년 전 | 1266 | |
| 7534 |
senseme
|
10년 전 | 1205 | |
| 7533 | 10년 전 | 1190 | ||
| 7532 | 10년 전 | 855 | ||
| 7531 | 10년 전 | 2048 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기