Entradas

OCULTAR MOSTRAR OBJETOS

Al final lo mejor es usar dos funciones así que oculten un DIV que a su vez ocultará/mostrar lo que haya dentro: function ocultar(){ document.getElementById('principal').style.display = 'none'; } function mostrar(){ document.getElementById('div2').style.display = 'block'; }

CSS variados

.inputcabecera{ position: absolute; background-color: #1f88d700; color: #d71f9a00 ; font-size: 20px; text-align:center; font-family: 'Slabo 27px', serif; } .input1{ position: absolute; background-color: #E9E9E900; color: red ; font-size: 30px; text-align:center; font-family: 'Slabo 27px', serif; } .input2{ position: absolute; background-color: #E9E9E900; color: green ; font-size: 30px; text-align:center; font-family: 'Slabo 27px', serif; } .input3{ position: absolute; background-color: #E9E9E900; color: #d3ba55 ; font-size: 30px; text-align:center; font-family: 'Slabo 27px', serif; } .input4{ position: absolute; background-color: #E9E9E900; color: red ; font-size: 30px; text-align:center; font-family: 'Slabo 27px', serif; } .input5{ position: absolute; background-color: #E9E9E900; color: #b0baf5 ; font-size: 38px; text-align:center; font-family: 'Slabo 27px', serif; } .input6{ position: absolute; background-color: #E9E9E900; color: #905d2...

PHP hacer un enlace

Se coloca el código: <? php echo '<a href="https://datoweb.com">Datoweb</a>' ;?>

SUBMIT evento sin botón

   En este ejemplo se envía un formulario usando:   formulario.submit();    function enviar(){ var formulario = document.getElementById("myform"); formulario.submit(); alert("Enviando formulario"); }      

PHP llevar datos desde la base al html

Ver la web https://disenowebakus.net/llevando-datos-de-la-base-mysql-a-las-paginas-php.php

PHP mostra mensajes con "echo"

Ver en la web https://www.php.net/manual/es/function.echo.php Este código en php es un ejemplo de cómo usar ECHO <?php echo  "Hola mundo" ; echo  "Esto abarca multiple líneas. Los saltos de línea también se mostrarán" ; echo  "Esto abarca\nmúltiples líneas. Los saltos de línea también\nse mostrarán." ; echo  "Para escapar caracteres se hace \"así\"." ; // Se pueden usar variables dentro de una sentencia echo $foo  =  "foobar" ; $bar  =  "barbaz" ; echo  "foo es  $foo " ;  // foo es foobar // También se pueden usar arrays $baz  = array( "valor"  =>  "foo" ); echo  "Esto es  { $baz [ 'valor' ]}  !" ;  // Esto es foo ! // Si se utilizan com...

Conectar con base de datos

Este sería el código que propone la web  https://www.hostinger.es/tutoriales/como-usar-php-para-insertar-datos-en-mysql/ <?php $servername = "mysql.hostinger.co.uk" ; $database = "u266072517_name" ; $username = "u266072517_user" ; $password = "buystuffpwd" ; // Create connection $conn = mysqli_connect ( $servername, $username, $password, $database ) ; // Check connection if ( !$conn ) { die ( "Connection failed: " . mysqli_connect_error ( ) ) ; } echo "Connected successfully" ; $sql = "INSERT INTO Students (name, lastname, email) VALUES ('Thom', 'Vial', 'thom.v@some.com')" ; if ( mysqli_query ( $conn, $sql ) ) { echo "New record created successfully" ; } else { echo "Error: " . $sql . "<br>" . mysqli_error ( $conn ) ; } mysqli_close ( $conn ) ; ?> El código que yo he metido ha sido: <?php ...