ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Script-Example POST

Hello,

I would like to rewrite or start this Skipt via LV. 

But I've no idea how to realize it.

Can somebody give me a hint?




<?
$empfang = "12345;23456;777777;88888888;999999";
$request = "";
$param["id"] = "XXXXX";
$param["pw"] = "XXXX";
$param["type"] = "2";
$param["empfaenger"] = $empfang;
$param["absender"] = "testapp";
$param["befehl"] = "Temp +10";
$param["reply"] = "1";
$param["reply_email"] = "E-Mailadresse";
$param["termin"] = "TT.MM.JJJJ-SS:MM";
$param["id_status"] = "1";
$param["massen"] = "1";
foreach($param as $key=>$val){
$request.= $key."=".urlencode($val);
$request.= "&";
}
$url = "http://www.meineseite.de/app/test.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>

0 Kudos
Message 1 of 6
(4,686 Views)

Hi Wulfi,

can you explain a bit more? Where do you have problems? Which part do you want to rewrite, where do the new data come from?

 

Mike

0 Kudos
Message 2 of 6
(4,682 Views)

I want to give some values to a php site and then i get a value back..

I want to send and receive this data without the Internet exploerer becuase otherwise the logindata is displayed.

0 Kudos
Message 3 of 6
(4,669 Views)

Hi Wulfi,

you can use HTTP to send your parameters to your php page. See this link for an example

http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=324049#M324049

 

Another possibility is to use the IExplorer ActiveX Control.

 

Mike

0 Kudos
Message 4 of 6
(4,660 Views)

You may want to look at this post on the LAVA forums that dicusses using curl with LabVIEW.

 

 

0 Kudos
Message 5 of 6
(4,659 Views)

Thanks.

Now I found a variant to control the IE via ActiveX and make it invisable. So it works.

 

0 Kudos
Message 6 of 6
(4,649 Views)