V
V
Valenso2012-05-18 02:16:06
PHP
Valenso, 2012-05-18 02:16:06

Client-server interaction

Task: send a request from the POST program (cyrillic inside) to the server and receive a response (cyrillic inside). c++ builder development environment.

c++ works like this php works like this php is written to understand cyrillic. processing takes place in the Compile class. Why var_dump($text); //returns NULL, how to pass POST data to php? Tell me what am I doing wrong?
TStringList *list = new TStringList;
TStringStream *stream = new TStringStream("");
list->Add("programm=целое один = 1, hg;"); //отправляю строчку "целое один = 1, hg;"
IdHTTP1->Post("http://localhost:51880/newfile.php",list,stream);
Memo1->Text = Utf8ToAnsi(stream->DataString);



<?php
$text = $_POST['programm'];

var_dump($text); //возвращает NULL

$text = urldecode($text);
$text = html_entity_decode($text,null,'UTF-8');
$strings = explode("\n", $text);
include_once('compile.php');
$object = new Compile();
$object->identify($strings);
?>



Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gregory, 2012-05-18
@difiso

POST data is being passed correctly, what does var_dump($_POST) say?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question