You are here: cURL firestarter help needed « PHP Programming Language « IT news, forums, messages
cURL firestarter help needed

Posted by Steffen Mutter on 05/30/07 18:05

Hi there!

I just want to get this http thing into a dynamic scipt using cURL which -
as you might have guessed - I never used before and documentation I found
so far is quite unuseful for me...

So let's get to the point:
If I put this into the browser of choice:
http://gateway.mobile-marketing-system.de/send_sms.php?username=KU-1234&password=
geheim&text=Dies+ist+ein+Test&recipient=%2B491712345678&sender=%2B491712345678

everything works fine.

Nor here's a script I got from this website, put my registration data in
and it does - nothing. cURL support is turned on - but maybe you might be
able to tell me how to use this script. (There was no further
documentation included)

<?php



$username = "XXXXX"; // hier bitte Ihre Kunden-ID eintragen

$password = "XXXXX"; // hier bitte das in den Einstellungen definierte Password



function send_sms($absender, $empfaenger, $text, $versandroute = "")

{

global $username;

global $password;



$sms_query = sprintf("http://gateway.mobile-marketing-system.de/send_sms.php?username=%s&password=%s&text=%s&recipient=%s&sender=%s&route=%s",

urlencode($username),

urlencode($password),

urlencode($text),

urlencode($empfaenger),

urlencode($absender),

urlencode($versandroute)

);



if(function_exists("curl_init"))

{

$ch = curl_init($sms_query);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$result = curl_exec($ch);

curl_close($ch);

}

else

{

$fp = fopen($sms_query, "r");

while(!feof($fp))

{

$result .= fread($fp,4096);

}



fclose($fp);

}



return $result;

}



$result = send_sms("01748882288", "01723773477", "Dies ist ein Text", "route2");



?>

All I want is to send a POST type message to a remote URL which contains
the same as in the http-request I posted above. Any help or a link to
useful dokumentation with examples hoh to use cURL highly appreciated.

Thanks,
Steffen

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация