Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file_get_contents("php://input") #20

Open
antongospod opened this issue Aug 19, 2020 · 6 comments
Open

file_get_contents("php://input") #20

antongospod opened this issue Aug 19, 2020 · 6 comments

Comments

@antongospod
Copy link

antongospod commented Aug 19, 2020

hi i am trying to use your dependency in my project but when trying to call Yii :: $ app-> telegram-> sendMessage ([
'chat_id' => $ chat_id,
'text' => 'test',
]);
after which I get a 500 error, because the data from my form goes into your constructor:

public function __construct ($ config = [])
{

    parent :: __ construct ($ config);

    $ input = file_get_contents ("php: // input");
    $ array = json_decode ($ input, true);
    $ this-> input = new Input ($ array);

}

namely in $ input = file_get_contents ("php: // input")
your script can work fine and error-free without
$ input = file_get_contents ("php: // input");
$ array = json_decode ($ input, true);
$ this-> input = new Input ($ array);

@akbarjoudi
Copy link
Owner

Hi I could not handle your error. Please indicate the circumstances in which the error occurs.

@antongospod
Copy link
Author

i am trying to use this code: $ res = Yii :: $ app-> telegram-> sendMessage ([
'chat_id' => $ chat_id,
'text' => 'hello world !!'
]);
In my controller, in which a post request sends a notification to mail with data from my form, I wanted to make the notifications arrive in telegram, but the data from my form goes into this piece of code: $ input = file_get_contents ("php: / / input "); in TelegramBase
After which I get a 500 error.

@akbarjoudi
Copy link
Owner

My dear friend, in a part of the explanation, I said that you should get an answer from Telegram
enableCsrfValidation
Turn off. Probably a problem with this part.
https://github.com/akbarjoudi/yii2-bot-telegram#usage-in-controller

@Vashkatsi
Copy link

My dear friend, in a part of the explanation, I said that you should get an answer from Telegram
enableCsrfValidation
Turn off. Probably a problem with this part.
https://github.com/akbarjoudi/yii2-bot-telegram#usage-in-controller

No, the problem is that I cant use telegram in my usual controllers.

@Rafinol
Copy link

Rafinol commented Dec 7, 2020

hi i am trying to use your dependency in my project but when trying to call Yii :: $ app-> telegram-> sendMessage ([
'chat_id' => $ chat_id,
'text' => 'test',
]);
after which I get a 500 error, because the data from my form goes into your constructor:

public function __construct ($ config = [])
{

    parent :: __ construct ($ config);

    $ input = file_get_contents ("php: // input");
    $ array = json_decode ($ input, true);
    $ this-> input = new Input ($ array);

}

namely in $ input = file_get_contents ("php: // input")
your script can work fine and error-free without
$ input = file_get_contents ("php: // input");
$ array = json_decode ($ input, true);
$ this-> input = new Input ($ array);

Сould you solve this problem?

@akbarjoudi
Copy link
Owner

Dear friend @Rafinol
I can not see the result of your error and in this case I can not recognize the desired error. Please show me the error that occurs in php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants