How to make a link on my site open only when clicked on the same page?

Asked

Viewed 65 times

2

I’m trying to make a plugin html file editor, css, js and php, my problem comes that after it reads all the files it creates a link to edit my created file and goes to another page only I want that when the link is clicked it instead of redirecting the editor it opens on the same page.

  • 2

    Friend, I don’t understand what you’re trying to do, could you explain better? Without seeing the code of what your plugin is doing, it’s also hard to guess where the problem might be in it.

2 answers

1

You can divide parts of the code by if/Else, for example:

if(isset($_POST['formulario']))
{
   // código após formulário ou link ser submetido
}
else               
{
    // código do formulário ou link
}

This way you control the flow of code and consequently what appears on the same page.

0

Well you can use Frameset in html much easier. Or you can create a schema in php type:

$ac = 1;

When you click the edit button, your page will add $ac + 1 and you will continue on the same page only in the form of editing.

if($ac == 1){
  //ler ou inserir dados;
} else if ($ac == 2){
  //editar dados;
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.