0
I’m having Difficulty/Problem requesting a function in PHP:
The function below is located in a class inside the Folder lib.
Language.php
<?php
namespace app\lib;
class Language {
public function setLingCookie(){
if(isset($linguagem)){
setcookie("IDIOMA", $linguagem, time()+3600, "/", "localhost/");
echo 1;
}else{
echo 0;
}
}
.
.
.
}
My difficulty is to trigger this function on my page, and I will trigger it from a Link.
Leaving registered here that I have tried some functions by Ajax but I was not successful because I am not able to handle the request or I am not able to send.
Edit: I’m using the Composer only for the Autoload.
So, I’m using Composer only for Autoload. I can create a Cookie by Js nothing complicated but wanted to do all structure by PHP. I thought about what you told me by passing a parameter but it would have to be a POST in this new file through Ajax right? It would also be possible for me to click on the link for that route by passing a parameter and a redirect back. Well, thank you very much for the Help!
– PyramiDy
That, the way would be that same! You’re welcome!
– Flávio Santos