View Full Version : نحوه ارسال یک کوری PHP بوسیله آجاکس
boysilent
شنبه 07 بهمن 1391, 09:57 صبح
سلام دوستان :
میخواستم مقدار $ID رو بفرستم توسط aJAX به این شکل عمل کردم نشد
params='id='+<? echo $id ?>
boysilent
جمعه 13 بهمن 1391, 11:17 صبح
ابینم از کد کامل برنامه
params='matn='+$('comment2').value+'&sub='+$('author2').value+'&email='+$('email2').value+'&url='+$('url2').value+'&id=<?php $id=$_GET[id];?>';
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("POST",url, true);
//Send the proper header information along with the request
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(params);
}
Variable
جمعه 13 بهمن 1391, 23:56 عصر
خب میتونید. دستور echo تو پی چی پی رو بکار ببرید .
<?php echo $_GET[id];?>
یا اینکه فکر میکنم . این جوری استفاده کنید.
<?=$_GET[id];?>
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.