הרשם שאלות ותשובות רשימת חברים לוח שנה חיפוש הודעות מהיום סמן פורומים כנקראו

   
|!|

 
 
כלים לאשכול תצורת הצגה
Prev הודעה קודמת   הודעה הבאה Next
ישן 15-04-10, 14:16   # 6
OrPol
א.פורום תוכנה
עסק רשום
 
OrPol's Avatar
 
מיני פרופיל
תאריך הצטרפות: Aug 2006
הודעות: 1,979

OrPol לא מחובר  

בPOST או בGET?
אם מדובר בGET הכל הרבה יותר קל, אתה יכול עם CURL
PHP קוד:
$url_c "http://".$host.":".$port.$path."?".$query// Generates the URL;
            
$curl curl_init($url_c);
            
curl_setopt($curlCURLOPT_HEADERfalse);
            
curl_setopt($curlCURLOPT_VERBOSEfalse);
            
curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
            
$content curl_exec($curl); //Sends the request;
          
echo $content// Echos the respond from application server; 
ואפשר גם עם FSOCKOPEN, אבל לי באופן אישי CURL עבד יותר טוב עם השרתים בארץ
PHP קוד:
$fp fsockopen("$host"$port$errno$errstr30); // Opens a socket to the Application server

if (!$fp) { // Verifies that the socket has been opened and sending the message; 
echo "$errstr ($errno)<br />\n";
} else {
$out "GET $path?$query HTTP/1.1\r\n";
$out .= "Host: $host\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp$out);
while (!
feof($fp)) {
echo 
fgets($fp128); // Echos the respond from application server (you may replace this line with an "Message has been sent" message);
}
fclose($fp);


הקודים הם מתוך קוד לדוגמא שכתבתי לחברה שמספקת WEB SERVICE של SMSים.
אם אתה צריך משהו מעבר, דבר איתי.
  Reply With Quote
 

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 

כלים לאשכול
תצורת הצגה

חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 10:30.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ