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 | |
//receives the form data | |
$unome = $_POST["unome"]; | |
//conects to the database | |
$conecta = mysql_connect("localhost","user","pass"); | |
$db = mysql_select_db("database"); | |
//updates the selected field | |
$sql = mysql_query("UPDATE table SET columm='value' |
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 | |
//connecting to the database | |
$conecta = mysql_connect("localhost","user","pass"); | |
$db = mysql_select_db("database"); | |
//the query gets only rows where the column is null. | |
$sql = mysql_query("SELECT column FROM table WHERE column!=''"); | |
//gets the rows quantity | |
$totalRows = $num_rows = mysql_num_rows($sql); |
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 | |
//declares the funcion | |
function insertUser($nome, $sobrenome, $usuario, $senha, $visita, $data, $valor, $idade, $peso, $telefone, $email, $indicacao, $clinica, $queixa, $medida1, $medida2, $medida3, $medida4, $medida5, $medida6, $medida7, $medida8) { | |
conecta(); | |
if (!empty($nome)) { $nome_value = $nome.','; $nome_insert = 'nome,';} | |
if (!empty($sobrenome)) { $sobrenome_value = $sobrenome.','; $sobrenome_insert = 'sobrenome,';} | |
if (!empty($usuario)) { $usuario_value = $usuario.','; $usuario_insert = 'usuario,';} | |
if (!empty($senha)) { $senha_value = $senha.','; $senha_insert = 'senha,';} | |
if (!empty($visita)) { $visita_value = $visita.','; $visita_insert = 'visita,';} | |
if (!empty($data)) { $data_value = $data.','; $data_insert = 'data,';} |
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 | |
//connects do wordpress database | |
$conecta = mysql_connect("localhost","user","pass"); | |
$db = mysql_select_db("database"); | |
$sql = mysql_query("select * from wp_posts "); | |
//fetch the array with the query above | |
while($linha = mysql_fetch_array($sql)){ | |
$ID[$i] = $linha['ID']; | |
$i++; |
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 | |
//write your do-while loop below | |
$f = 1; | |
do { | |
if ($f == 1){ | |
echo "the loop is ru"; | |
} | |
if else ($f > 1) { | |
echo "n"; | |
} else { |
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
var cont = 20; // guardo os segundos na variavel cont | |
function contador(){ //inicio a function | |
document.getElementById('tempo').innerHTML=cont; // pego a div de id tempo e com o inner html coloco o valor da variavel cont dentro da div | |
if(cont == 0) { //se variavel cont que vale 20 for igual a 0 executo uma função | |
document.getElementById('link').style.display="block"; // quando a variavel cont chegar a zero mudo o style do link de none para block | |
document.getElementById('tempo').style.display="none"; // escondo o time dou display none para ele | |
} | |
if (cont != 0){ // se variavel cont que vale 20 for diferente de 0 executo uma função | |
cont = cont-1; //aqui acontece a magina enquanto cont for diferente de zero ele vai repetir e diminui 1 | |
setTimeout("contador()", 1000); // aqui o tempo que diminui cada segundo no caso de 1 em 1 segundo |
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 | |
//get tht ip from the user | |
$ip=$_SERVER['REMOTE_ADDR']; | |
//open or create the file | |
$arquivo = fopen($filename, "a"); | |
if ($arquivo == false) { | |
die('Error message creating or opening the file.');} | |
//write to the file the IP from the user | |
if (!fwrite($arquivo, $ip."\n")) die('Error updating the file.');{ | |
echo 'Sucess.'; |
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
$(function() { | |
var contactForm = $('#contact-form'); | |
contactForm.submit(function() | |
{ | |
if(contactForm.valid()) | |
{ | |
contactForm.find('.submit-area').addClass('loading'); | |
var formValues = $(this).serialize(); |
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 | |
$horas = '43200'; | |
$tempo_anuncio = '20'; | |
$tempo_n = '35'; | |
$link_protetor = $_POST['link_final']; | |
if(isset($_POST['link_final']) and !empty($link_protetor)){ | |
$display = "none"; | |
$referer = $_SERVER['HTTP_REFERER']; | |
if($_COOKIE['protetor'] == '1'){ | |
setcookie("protetor", "2"); |
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
jQuery(document).ready(function($) { | |
var hrefs = []; | |
$('[rel^=prettyPhoto]').each(function() { | |
hrefs.push(this.href); | |
}); | |
$.prettyPhoto.open(hrefs); | |
}); |
OlderNewer