Posts by Takanaue • 11 points
7 posts
-
1
votes2
answers2342
viewsA: Percentage function in PHP
$valor = 100; // valor total $porcent = 50; $totalporcent = 100; $total = $porcent / $totalporcent; $resultado = $total * $valor; echo $porcent . "% de " .…
-
1
votes2
answers649
viewsA: PHP and Mysql: Database does not update
function AtualizarDados($con){ $sql = "UPDATE academico SET nome='".$this->nome."', email='".$this->email."', data_nascimento='".$this->dataNascimento."', endereco='".$this->endereco."',…
-
-1
votes3
answers90
viewsA: Constant containing Array (matrix)
$colors = array("red","blue","green") will be just fine.
-
1
votes3
answers861
viewsA: Run php code within a variable
<?php $clazz = "class teste(){function oi(){echo 'oi';}}"; eval($clazz); $variavel = new teste; echo $variavel->show(); $variavel->show(); ?> Try this.…
-
1
votes2
answers607
viewsA: Pull data from db
<?php $link = mysqli_connect("host","usúario","senha","database") or die("Error " . mysqli_error($link)); $sql = "SELECT * FROM nome_da_tabela"; $query = mysqli_query($link, $sql) or…
-
0
votes1
answer563
viewsA: Opencart Free Shipping ZIP
<?php function busca_cep($cep){ $resultado = @file_get_contents('http://republicavirtual.com.br/web_cep.php?cep='.urlencode($cep).'&formato=query_string'); if(!$resultado){ $resultado =…
-
2
votes3
answers799
viewsA: Undefined index error: user when submitting a POST form
Like Matheus Velloso said, change the <form action="encomenda_apagar.php" method="POST"> To <form action="encomenda_apagar.php" method="GET">…