![ישן](https://static.fresh.co.il/images/vBulletin/statusicon/post_old.gif)
06-11-2010, 18:31
|
|
|
חבר מתאריך: 06.05.07
הודעות: 7
|
|
בעיה ב CURLOPT_POSTFIELDS... לא מצליח לשלוח\לקבל נתונים
אז ככה , אני מנסה לעשות את זה
קוד PHP:
<?php
$ch = curl_init();
$res= curl_setopt ($ch, CURLOPT_URL,"http://*********/2.php");
$a = "12345";
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$a);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$xyz = curl_exec ($ch);
curl_close ($ch);
echo $xyz;
if ($xyz == NULL) {
echo "Error:<br>";
echo curl_errno($ch) . " - " . curl_error($ch) . "<br>";
}
?>
ואז בדף
2.php
אני מנסה:
</FONT>
קוד PHP:
<?
$test = $_POST['a'];
echo $test;
echo "test";
?>
</SPAN>
הפלט שיוצא הוא רק test.. בלי ה 12345
ניסיתי לעשות מלא דבריםםם ופשוט לא עובד וזה משגע אותי
תודה על העזרה
|