Skip to content

Instantly share code, notes, and snippets.

View celestecastillo0's full-sized avatar

celestecastillo0

View GitHub Profile
@celestecastillo0
celestecastillo0 / index.php
Created October 28, 2021 20:22
Deweb Act6 UII POO2
<?php
class animal {
function ladra(){
}
function cuantoladra($nladra){
$c=1;
while ($c <= $nladra)
{
@celestecastillo0
celestecastillo0 / index.php
Created November 4, 2021 12:03
Daweb Act7 Herencia
<?php
class animal
{
public $nombre = "perro";
public function ladrar(){
print " woof";
}
}
class chihuahua extends animal {
public function ladrar(){
@celestecastillo0
celestecastillo0 / index.php
Created November 4, 2021 13:36
Daweb Act7 Herencia2
<?php
class ope{
protected $n1;
protected $n2;
public function __construct($n1, $n2) {
$this->n1 = $n1;
$this->n2 = $n2;
}
public function ope() {
return $this->n1 - $this->n2;
@celestecastillo0
celestecastillo0 / index.php
Last active November 4, 2021 17:25
Daweb Act7 Herencia3
<?php
trait saludo
{
public function hola()
{
echo "Hola Celeste";
}
}
trait saludo2
@celestecastillo0
celestecastillo0 / index.php
Created November 14, 2021 01:46
DAWeb UIII act2
<?php
$miservidor = "127.0.0.1";
$miusuario = "root";
$contra = "";
$mibasededatos = "banco";
//create connection
$miconexion = new mysqli($miservidor, $miusuario, $contra, $mibasededatos);
//check connection
if ($miconexion->connect_error) {
die("Fallo la conexion revisa tus datos de conexion !!!: " .$miconexion->connect_error);