Jump to content

sendRequest & php


thinkdongil
 Share

Recommended Posts

can anybody help me?it is an animal selecting system.if an user clicks their card on web, he or she will get one animal profile from our database.i do not know much about php. please help me know to make 'animal.php' in order to get match_cd and match_idx from the following scripts.images are in match_cd.birth, price, age, color and weight are in match_idx.( a.js )function openCard(objId, match_cd, match_idx) { arg="objId="+objId+"&match_cd="+match_cd+"&match_idx="+match_idx; sendRequest(on_animal,"&"+arg, "GET", 'animal.php', true, true);}function on_animal(oj){ try { result=decodeURIComponent(oj.responseText); if(result!='null') { rst = result.split('|||'); document.getElementById(rst[0]).innerHTML=rst[1]; } } catch(e) { result=oj.responseText; if(result!='null') { rst = result.split('|||'); document.getElementById(rst[0]).innerHTML=rst[1]; } }}function animalCard(objId, match_cd, match_idx) { arg="objId="+objId+"&match_cd="+match_cd+"&match_idx="+match_idx; sendRequest(on_animalCard,"&"+arg, "GET", 'animalCard.php', true, true);}function on_anymalCard(oj){ result=decodeURIComponent(oj.responseText); if(result!='') { rst = result.split('|||'); document.getElementById(rst[0]).innerHTML=rst[1]; }}function vw_profile(match_cd, match_idx){ window.open('/my_animal/profile.html?match_cd='+match_cd+'&match_idx='+match_idx , "profile","width=620, height=700, scrollbars=yes,resizable=no,copyhistory=no");}=======================================================<HTML><head></head><body>some content<script language=javascript src="js/a.js"></SCRIPT> <DIV id=card1><IMG style="CURSOR: pointer" onclick="animalCard(objId,match_cd,match_idx);"> <DIV id=card2></DIV><script>animalCard(objId,match_cd,match_idx);</SCRIPT>some content</BODY></HTML>

Edited by Tony. TP.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...