Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

213
Visualizações
Is it possible to run PHP with JavaScript?

They say that It is not possible, but what about it? I was working on project to improve my skills and found a trick to run PHP from JS.

async function runphp() {
    const response = await fetch('phpfile.php');
    const data = await response.json(); //optional
  }

So we just make a request and all the code inside PHP will run. Also for eg. if we want just one function from PHP to run it is possible to make cookie in javascript, read it in php and run only some functions based on cookie value. I don't know anything about security and I'm working on localhost so the question is: Is it good if I add project with this on my website?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda