This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" href="css/font-awesome.min.css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- phpMyAdmin SQL Dump | |
-- version 5.0.2 | |
-- https://www.phpmyadmin.net/ | |
-- | |
-- Host: 127.0.0.1:3306 | |
-- Tempo de geração: 09-Set-2022 às 11:08 | |
-- Versão do servidor: 5.7.31 | |
-- versão do PHP: 7.3.21 | |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Sua Página</title> | |
<link href="//cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css" rel="stylesheet"> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$hostname = "localhost"; | |
$bancodedados = "bancodedados"; | |
$usuario = "usuario"; | |
$senha = "senha"; | |
$mysqli = new mysqli($hostname, $usuario, $senha, $bancodedados); | |
if ($mysqli->connect_errno) { | |
echo "Falha ao conectar: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include("conexao.php"); | |
$msg = false; | |
if(isset($_FILES['arquivo'])){ | |
$extensao = strtolower(substr($_FILES['arquivo']['name'], -4)); //pega a extensao do arquivo | |
$novo_nome = md5(time()) . $extensao; //define o nome do arquivo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$host = "localhost"; | |
$usuario = "USUARIO"; | |
$senha = "SENHA"; | |
$bd = "BANCODEDADOS"; | |
$mysqli = new mysqli($host, $usuario, $senha, $bd); | |
if($mysqli->connect_errno) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include("conexao.php"); // caminho do seu arquivo de conexão ao banco de dados $consulta = "SELECT * FROM usuario"; $con = $mysqli->query($consulta) or die($mysqli->error); | |
?> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Tutorial</title> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div itemscope itemtype="http://schema.org/Product"> | |
<a itemprop="url" href="url-do-produto"> | |
<div itemprop="name"> | |
<strong>Nome do Produto</strong> | |
</div> | |
</a> | |
<div itemprop="description">Descricao do Produto</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_endereco($cep){ | |
// formatar o cep removendo caracteres nao numericos | |
$cep = preg_replace("/[^0-9]/", "", $cep); | |
$url = "http://viacep.com.br/ws/$cep/xml/"; | |
$xml = simplexml_load_file($url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function deletar($pasta){ | |
$iterator = new RecursiveDirectoryIterator($pasta,FilesystemIterator::SKIP_DOTS); | |
$rec_iterator = new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST); | |
foreach($rec_iterator as $file){ | |
$file->isFile() ? unlink($file->getPathname()) : rmdir($file->getPathname()); | |
} |