10-18-2016 07:59 AM
Hi
I create a Web server on my computer
I write in the address bar:
http://127.0.0.1/denwer/index.php?NDatch=25&Sost=Oк.
The server accepts the values: 25 & Ok.
Then I created the program in LV.
The server does not accept values: 25 & Ok from LV.
Where am I wrong?
With respect.
Iskander
10-18-2016 09:07 AM
What do you mean?
It looks like the values were accepted:
<tr><td class="e">_POST["NDatch"]</td><td class="v">25</td></tr> <tr><td class="e">_POST["Sost"]</td><td class="v">Ok</td></tr>
Of course, when you write the variables into the address bar, the data goes into $_GET rather than $_POST which is what looks like is happening here.
If the server is expecting the data via $_GET, you'll need to modify the URL to include the variables (e.g. using format into string) - or you can modify your script to accept $_POST data.
10-18-2016 02:02 PM
Thanks
Pert of Index.php:
<body>
<form action="URL" method="POST">
<input type="NDatch">
<input type="Sost">
<h1> ПРОБА_1</h1>
</form>
<?php
phpinfo(32);
$Dat1=date("H:i:s d.m");
$Par1=$_POST["NDatch"];
$Par2=$_POST["Sost"];
I changed in my VI "GET" to "POST"
Don't work
Respect
10-19-2016 05:24 AM
But you can clearly see that the data is being sent in the PHPInfo() output that you get in the 'response body' from the HTTP Post VI (the part I quoted above) - which means it is being received by the server so the issue is with your PHP script, and not with the LabVIEW code.
If you do a "print_r($_POST);", what does it contain? That should write out the contents of the $_POST array to the script - you should see something like:
Array
(
[NDatch] = 25,
[Sost] = "OK"
)
10-19-2016 01:52 PM
Hi
The copy of the phpinfo(32) in the file;
Array is empty
(
[NDatch] =
[Sost] =
)
I think : the problem is in the DENWER
Thank
10-19-2016 04:38 PM
In the screenshot - the $_GET variables in the URL of the browser are empty - that is why the fields are empty.
10-21-2016 01:40 AM
Hi
My program LV is sending data.
But the web browser does not see
And so the variables are empty
I do not know what to do
With respect
10-21-2016 03:28 AM
10-24-2016 04:28 AM
Hi
Thanks
I understood
I have the question.
I have the equipment that is polled LV with intervals (10 seconds). Then this information are sent to the web server, where it (the program PHP) are stored in the database.
how can I solve this problem using the LV?
With respect.