How can I make a link from my site open only when clicked on the same page? [closed]

2

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

    
asked by anonymous 24.11.2015 / 22:41

2 answers

1

You can split 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
}

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

    
24.11.2015 / 23:32
0

Well you can use Frameset in html much easier. Or you can create a schematic 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 edit form.

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