Underc0de - La Casa de los Informáticos

Foros Generales => Dudas y pedidos generales => Mensaje iniciado por: DanielaPalma en Mayo 03, 2023, 09:41:37 AM

Título: [SOLUCIONADO] Duda de código
Publicado por: DanielaPalma en Mayo 03, 2023, 09:41:37 AM
Buen día! alguien sería tan amable de explicarme que significa esta parte del código? en especial la parte de header (no se nada de php y esto lo tengo que pasar a js

/*$_usuario = $_POST['usuario'];*/
$_usuario = 'prueba';
if (isset($_POST["enviar"])) {
    session_start();
    $_SESSION["usuario"] = $_usuario;
    $_SESSION["inputNumero"] = htmlentities($_POST["inputNumero"]);
    $_SESSION["inputNombre"] = htmlentities($_POST["inputNombre"]);
    $_SESSION["inputGenero"] = htmlentities($_POST["inputGenero"]);
    header("Location: montos.php");
}



?>


Título: Re:Duda de código
Publicado por: DtxdF en Mayo 03, 2023, 02:57:31 PM
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

*.- isset(): https://www.php.net/manual/es/function.isset.php
*.- session_start(): https://www.php.net/manual/es/function.session-start
*.- htmlentities(): https://www.php.net/manual/es/function.htmlentities.php
*.- header(): https://www.php.net/manual/es/function.header
*.- Location header: https://www.rfc-editor.org/rfc/rfc9110#name-location
*.- $_POST: https://www.php.net/manual/en/reserved.variables.post
*.- $_SESSION: https://www.php.net/manual/en/reserved.variables.session
*.- if: https://www.php.net/manual/es/control-structures.if.php
*.- variables: https://www.php.net/manual/es/language.variables.php

~ DtxdF
Título: Re:Duda de código
Publicado por: noxonsoftwares en Mayo 03, 2023, 03:45:58 PM
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or LoginYou are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

*.- isset(): https://www.php.net/manual/es/function.isset.php
*.- session_start(): https://www.php.net/manual/es/function.session-start
*.- htmlentities(): https://www.php.net/manual/es/function.htmlentities.php
*.- header(): https://www.php.net/manual/es/function.header
*.- Location header: https://www.rfc-editor.org/rfc/rfc9110#name-location
*.- $_POST: https://www.php.net/manual/en/reserved.variables.post
*.- $_SESSION: https://www.php.net/manual/en/reserved.variables.session
*.- if: https://www.php.net/manual/es/control-structures.if.php
*.- variables: https://www.php.net/manual/es/language.variables.php

~ DtxdF

Me gusta esta respuesta.
Título: Re:Duda de código
Publicado por: blackdrake en Mayo 04, 2023, 06:12:02 AM
Increíble respuesta You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Independientemente de eso y haciendo petición a la parte en la que hace hincapié:

Citaren especial la parte de header (no se nada de php y esto lo tengo que pasar a js

Código (php) [Seleccionar]
header("Location: montos.php");
Básicamente, redirige a montos.php