How to get text from another page and insert into an input? [closed]

-4

I'm having a small question about a project I'm developing.

It happens as follows:

  

I have this input on a index.php page :

<input id="exibe" value="Aqui vai ficar o texto **que foi** copiado">
  

On the other page, I have this (pull.php) element:

<font id="pegar" class="campo">Aqui fica o texto **que vai ser** copiado</font>
  

What I need is when someone accesses the index.php that has input with id="exibe" , that < strong> input will have your value="" filled with the text on the other page ( pull.php ) which is in <font> with id="pegar" .

Is it possible to do this?

    
asked by anonymous 12.10.2016 / 23:33

2 answers

1

Alexander, the simplest way to do this is as follows:

index.php:

<html>
<body>  
    <form id="form1" method="post" action="puxa.php" >
        <input id="pegar" name="pegar" class="campo" value="Aqui fica o texto **que vai ser** copiado"/>
        <input type="submit" value="enviar" />
    </form>     
</body>

puxa.php:

<html>
<body>  
    <input id="exibe" value="<?=$_POST['pegar']; ?>">  
</body>
</html>    
    
13.10.2016 / 00:30
-1

Yes. send the page value through an ajax request or make a post. You can save this value to a Session object. In php would be: $ Session ['_session_name '] =' value sent ';

on the other page it would only be necessary to call the value: echo $ Session ['session_name'];

    
12.10.2016 / 23:43