Send variable value from an external php page to a field in an external html

Asked

Viewed 61 times

0

I’m having trouble sending the value of a variable that is in PHP to an external HTML page.

I have the page executes.php and I have the page call html..

call html. sends to executes.php, that sends to follows html. the information below follows my code:

First page call.html

<form method=post name="formulario" action="executa.php">
   <!-- Telefone -->
   <input type="text" name="numerotelefone">
   <p class="tamanho">*Preenchimento Obrigat&oacute;rio</p><BR>
   <input type="submit" value="Pesquisar" align="right" width="48" height="48">
</form>

Second page runs.php

<?php
#Campo de Busca Telefone
$telefone = $_POST['numerotelefone'];
echo "Telefone Informado: <pre>$telefone</pre>";  
header('refresh:3;url=ativar.html?&numerotelefone='.$telefone);
?>

Third page follows.html

<!-- Aqui recebo o telefone da página executa.php -->
<input id="field_1" type="text" name="field_1" value="<?php echo $telefone ?>" />

After the page executes.php is displayed, it calls the page follows html. at that point I cannot send the variable value $telefone which was received in executes.php for follows html.

  • 1

    The page follows.html will not run PHP code in value="<?php echo $telefone ?>" because it’s a common . html page. You’ll have to use Javascript to get the phone number from the URL. Why not use a PHP page to follow.php instead of follow.html?

  • because within the following.html I use the form with radiobutton among other elements.. would have to change the whole project, in java script I am searching now that informed me, I thought it was possible to keep in html even so thanks for the tip

  • 1

    Dude, changing the . html page to . php doesn’t change anything in HTML and you can still use PHP code inside it, which is even better.

  • I’ll try it here and

  • funcionouuu man!! VALEUUU

No answers

Browser other questions tagged

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