11.09.2018 Views

Aprender a desarrollar un sitio Web con PHP y MySQL

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

24/4/2014 ENI Training - Libro online<br />

4. Información complementaria<br />

a. Argumentos <strong>con</strong> el mismo nombre<br />

Si pasa en la URL dos argumentos <strong>con</strong> el mismo nombre, $_GET va a tener en cuenta el último<br />

nombre.<br />

Por ejemplo:<br />

La página get_recibe.php <strong>con</strong> la URL: http://127.0.0.1/get_recibe.php?<br />

nombre=Juan&nombre=Roberto<br />

<br />

<br />

<br />

Ejercicio <strong>con</strong> GET<br />

<br />

<br />

<br />

<br />

<br />

<br />

Da como resultado:<br />

El nombre es:Roberto<br />

b. Argumentos de tipo tabla<br />

<strong>PHP</strong> permite pasar en la URL los argumentos en forma de tabla.<br />

Es posible que no quiera introducir <strong>un</strong> índice, como en este ejemplo: http://127.0.0.1/get_recibe.php?<br />

dato[ ]=Juan&dato[ ]=Gómez<br />

En este caso, las claves de la tabla son 0 y 1 respectivamente.<br />

También puede introducir <strong>un</strong> índice, por ejemplo: http://127.0.0.1/get_recibe.php?<br />

dato[nombre]=Juan&dato[apellido]= Gómez<br />

En este caso, las claves de la tabla son nombre y apellido respectivamente.<br />

Por ejemplo:<br />

La página get_recibe.php <strong>con</strong> la URL: http://127.0.0.1/get_recibe.php?<br />

dato[nombre]=Juan&dato[apellido]= Gómez<br />

<br />

<br />

<br />

http://www.eni-training.com/client_net/mediabook.aspx?idR=87321 5/7<br />

www.FreeLibros.me

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!