Hello! I need some help about passing variables to another php script. In the script A i receive the variable called menu and i show it to confirm its value $menu = $_POST["menu"]; echo 'You selected ' .$menu. '</br>'; My problem is that in this script A i have a form the users fill to continue navigating through the site, and they have to select another options , and they will be directed to another script, script B. Something like this ... echo '<form action="scriptB.php?nombre_tabla=$menu" method="post">'; i know it doesn´t work, but i want to pass the variable menu to script B so i can use it in another functions ¿How can i do it? ¿How can i recover the variable´s value in script B? Any help will be well received Jber
You can probably retreive it through $_GET as it will be passed in the url. A better method, however, would be to put a hidden form element in your form containing that value. <input type="hidden" name="nombre_tabla" value="$menu">
The hidden solution does not work, because if i put : echo '<input type="hidden" name="nombre_tabla" value="$menu" >'; as you´ve told me , i receive, in script B Seleccionaste el campo identificador de la tabla $menu and not the value of the variable ¿Can you help me please? Jber