posta ai como esta sua url?
http://www.meusite.c...r/quemsomos.php
Era pra ficar assim:
http://www.meusite.com.br/quemsomos/
There have been 26 items by claytonprog (Search limited from 28/04/2023)
Posted by claytonprog on 28/01/2013, 18:08 in PHP
posta ai como esta sua url?
Posted by claytonprog on 28/01/2013, 17:35 in PHP
Ola boa tarde tenta tirar isto
<IfModule mod_rewrite.c>
e
</IfModule>
e ve se funciona
Posted by claytonprog on 28/01/2013, 16:04 in PHP
<IfModule mod_rewrite.c> RewriteEngine On # Página de contato RewriteRule ^contato/?$ /contato.php [NC,L] # Página de Quem Somos RewriteRule ^quemsomos/?$ /quemsomos.php [NC,L] # Página de clientes RewriteRule ^clientes/?$ /clientes.php [NC,L] # Página de servicos RewriteRule ^servicos/?$ /servicos.php [NC,L] # Página de servicos RewriteRule ^sistemas/?$ /sistemas.php [NC,L] # Página de portfolio RewriteRule ^portfolio/?$ /portfolio.php [NC,L] # Página de exibição de um portfolio RewriteRule ^portfolio/([a-z0-9-]+)/([0-9]+)/?$ /portfolio.php?id=$2&titulo=$1 [NC] </IfModule>
Posted by claytonprog on 06/01/2013, 09:11 in PHP
Posted by claytonprog on 13/10/2012, 15:07 in PHP
<form action="agenda-telefonica-resultado.php" method="post" id="form" class="listacidade"> <span> <select id="cidade" name="cidade"> <option>Arapiraca</option> <option>Grande Maceió</option> <option selected>Maceió</option> <option>Paripueira</option> </select> </span> </form>
Posted by claytonprog on 13/10/2012, 14:53 in PHP
Valew! Funcionou!!!
<?php require_once("connections/conexao.php"); $filtrar = $_POST["busca"]; $hoje = date("Y-m-d"); $query = "SELECT * FROM estabelecimentos WHERE nome LIKE '%".$filtrar."%' OR categoria LIKE '%".$filtrar."%' OR subcategoria LIKE '%".$filtrar."%' OR item LIKE '%".$filtrar."%' OR sub_item LIKE '%".$filtrar."%' OR chaves LIKE '%".$filtrar."%' and status='ativo' and dt_insc_fin >= '".$hoje."' AND dt_insc_fin != '0000-00-00'"; $result = mysql_query($query) or die("Error: " . mysql_error()); if (@mysql_num_rows($result) == 0 ) { echo "<br>"; echo "<font size=2 color=#000066 face=Verdana>"; echo("Não existem registro para esta busca!") ."<p>"; echo "</font>"; echo "<font size=2 color=#000066 face=Verdana>"; } else { while ($row = mysql_fetch_assoc($result)) { $id = $row['id']; $id_plano = $row['idplano']; $nome = $row['nome']; $foto = $row['banner']; $largura = $row['largura']; $altura = $row['altura']; ?> <h1><?php echo $row['nome']; ?></h1> <a href="estabelecimento.php?id=<? echo $id;?>" class="menuheader"><img src="painel/<?php echo $row['banner']; ?>" width=<? echo $largura ?> height=<? echo $altura ?> border="0" alt="<?php echo $row['nome']; ?>" /> </a> <?php } } ?>
Posted by claytonprog on 08/10/2012, 09:54 in PHP
Posted by claytonprog on 07/10/2012, 09:11 in PHP
Posted by claytonprog on 22/08/2012, 21:48 in PHP
<link type="text/css" href="menu.css" rel="Stylesheet" /> <div id="nav"> <ul> <li><a href="#">Selecione a Categoria</a> <!-- Categoria 1º nível ----> <ul> <?php include "../connections/conexao.php"; $SQL = "SELECT * FROM categorias ORDER BY categoria asc limit 80"; $query = mysql_query($SQL); while($row = mysql_fetch_array($query)) { $categoria = $row['categoria']; $id = $row['id']; ?> <li><a href="#"><? echo $categoria; ?></a> <!-- Início Sub-Categoria 2º nível ----> <ul> <?php $SQL9 = "SELECT * FROM sub_categorias where id_categoria='$id' ORDER BY subcategoria asc"; $query9 = mysql_query($SQL9); while($row9 = mysql_fetch_array($query9)) { $sub_categoria = $row9['subcategoria']; $id_sub_categoria = $row9['id']; ?> <li><a href="#"><? echo $sub_categoria; ?></a> <!-- Início dos Itens 3º nível ----> <ul> <?php $SQL8 = "SELECT * FROM sub_sub_categorias where id_sub_categoria='$id_sub_categoria' ORDER BY sub_sub_categoria asc"; $query8 = mysql_query($SQL8); while($row8 = mysql_fetch_array($query8)) { $sub_sub_categoria = $row8['sub_sub_categoria']; $id_sub_sub_categoria = $row8['id']; ?> <li><a href="#"><? echo $sub_sub_categoria; ?></a> <!-- Início do Sub-Itens 4º nível ----> <ul> <?php $SQL7 = "SELECT * FROM sub_itens where id_sub_sub_categoria='$id_sub_sub_categoria' ORDER BY sub_item asc"; $query7 = mysql_query($SQL7); while($row7 = mysql_fetch_array($query7)) { $sub_item = $row7['sub_item']; $id_sub_sub_categoria = $row7['id']; ?> <li><a href="#"><? echo $sub_item; ?></a></li> <? } ?> </ul> <!-- Final do Sub-Itens 4º nível ----> </li> <? } ?> </ul> <!-- Final dos Itens 3º nível ----> </li> <? } ?> </ul> <!-- Final Sub-Categoria 2º nível ----> <? } ?> </li> </ul> <!-- Final Categoria 1º nível ----> </li> </ul> </div>
#nav { float: left; width:auto; font: bold 12px Arial, Helvetica, Sans-serif; border: 1px solid #121314; border-top: 1px solid #2b2e30; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; overflow: hidden; } #nav ul { width:auto; margin:0; padding:0; list-style:none; } #nav ul li { float:left; } #nav ul li a { float: left; color:#d4d4d4; padding: 10px 20px; text-decoration:none; background:#3C4042; background: -webkit-gradient( linear, left bottom, left top, color-stop(0.09, rgb(59,63,65)), color-stop(0.55, rgb(72,76,77)), color-stop(0.78, rgb(75,77,77)) ); background: -moz-linear-gradient( center bottom, rgb(59,63,65) 9%, rgb(72,76,77) 55%, rgb(75,77,77) 78% ); background: -o-linear-gradient( center bottom, rgb(59,63,65) 9%, rgb(72,76,77) 55%, rgb(75,77,77) 78% ); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 0 5px rgba(0, 0, 0, 0.1) inset; border-left: 1px solid rgba(255, 255, 255, 0.05); border-right: 1px solid rgba(0,0,0,0.2); text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.6); } #nav ul li a:hover, #nav ul li:hover > a { color: #252525; background:#3C4042; background: -webkit-gradient( linear, left bottom, left top, color-stop(0.09, rgb(77,79,79)), color-stop(0.55, rgb(67,70,71)), color-stop(0.78, rgb(69,70,71)) ); background: -moz-linear-gradient( center bottom, rgb(77,79,79) 9%, rgb(67,70,71) 55%, rgb(69,70,71) 78% ); background: -o-linear-gradient( center bottom, rgb(77,79,79) 9%, rgb(67,70,71) 55%, rgb(69,70,71) 78% ); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), 0 -1px #000; } #nav li ul a:hover, #nav ul li li:hover > a { color: #2c2c2c; background: #5C9ACD; background: -webkit-gradient( linear, left bottom, left top, color-stop(0.17, rgb(61,111,177)), color-stop(0.51, rgb(80,136,199)), color-stop(1, rgb(92,154,205)) ); background: -moz-linear-gradient( center bottom, rgb(61,111,177) 17%, rgb(80,136,199) 51%, rgb(92,154,205) 100% ); background: -o-linear-gradient( center bottom, rgb(61,111,177) 17%, rgb(80,136,199) 51%, rgb(92,154,205) 100% ); border-bottom: 1px solid rgba(0,0,0,0.6); border-top: 1px solid #7BAED9; text-shadow: 0 1px rgba(255, 255, 255, 0.3); } #nav li ul { background:#3C4042; background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0.09, rgb(77,79,79)), color-stop(0.55, rgb(67,70,71)), color-stop(0.78, rgb(69,70,71)) ); background-image: -moz-linear-gradient( center bottom, rgb(77,79,79) 9%, rgb(67,70,71) 55%, rgb(69,70,71) 78% ); background-image: -o-linear-gradient( center bottom, rgb(77,79,79) 9%, rgb(67,70,71) 55%, rgb(69,70,71) 78% ); border-radius: 0 0 10px 10px; -moz-border-radius: 0 0 10px 10px; -webkit-border-radius: 0 0 10px 10px; left: -999em; margin: 35px 0 0; position: absolute; width: 160px; z-index: 9999; box-shadow: 0 0 15px rgba(0, 0, 0, 0.4) inset; -moz-box-shadow: 0 0 15px rgba(0, 0, 0, 0.4) inset; -webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.4) inset; border: 1px solid rgba(0, 0, 0, 0.5); } #nav li:hover ul { left: auto; } #nav li ul a { background: none; border: 0 none; margin-right: 0; width: 120px; box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; border-bottom: 1px solid transparent; border-top: 1px solid transparent; } #nav li li ul { margin: -1px 0 0 160px; -webkit-border-radius: 0 10px 10px 10px; -moz-border-radius: 0 10px 10px 10px; border-radius: 0 10px 10px 10px; visibility:hidden; } #nav li li:hover ul { visibility:visible; } #nav ul ul li:last-child > a { -moz-border-radius:0 0 10px 10px; -webkit-border-radius:0 0 10px 10px; border-radius:0 0 10px 10px; } #nav ul ul ul li:first-child > a { -moz-border-radius:0 10px 0 0; -webkit-border-radius:0 10px 0 0; border-radius:0 10px 0 0; }
Posted by claytonprog on 10/08/2012, 12:35 in PHP
Basta concatenar ambos os valores na resposta do json :
$json .= '{"value":"'.$row['nome'].$row['nome'].'"}';
Abraços
Posted by claytonprog on 09/08/2012, 14:41 in PHP
<?php $text = $mysqli->real_escape_string($_GET['term']); $query = "SELECT nome FROM estabelecimentos WHERE nome LIKE '%$text%' ORDER BY nome ASC"; $result = $mysqli->query($query); $json = '['; $first = true; while($row = $result->fetch_assoc()) { if (!$first) { $json .= ','; } else { $first = false; } $json .= '{"value":"'.$row['nome'].'"}'; } $json .= ']'; echo $json; ?>
Posted by claytonprog on 22/06/2012, 13:36 in PHP
pessoal!
Estou precisando fazer um select em varias tabelas e trazer o último registro de cada uma delas.
segue abaixo como está o código:<? include("connections/conexao.php"); $sql1 = "select * from politica order by data desc limit 6"; $query1 = @mysql_query($sql1); while ($coluna1 = @mysql_fetch_array($query1)){ $id = $coluna1["id"]; $titulo = $coluna1["titulo"]; $texto = $coluna1["texto"]; $foto = $coluna1["foto"]; $link = $coluna1["id"]; ?>
Da forma que está está só pegando de uma tebela preciso que pegue de 4 tabelas.
obs: os campos tem o mesmo nome só muda o nome da tabela.
utilize o INNET JOIN ou LEFT JOIN ou RIGHT JOIN ou UNION, mas depende muito do contexto e o que vc quer retornar na Query... explique melhor pra eu poder te dar uma luz ai e diga tb o nome das tabelas
Posted by claytonprog on 22/06/2012, 11:17 in PHP
<? include("connections/conexao.php"); $sql1 = "select * from politica order by data desc limit 6"; $query1 = @mysql_query($sql1); while ($coluna1 = @mysql_fetch_array($query1)){ $id = $coluna1["id"]; $titulo = $coluna1["titulo"]; $texto = $coluna1["texto"]; $foto = $coluna1["foto"]; $link = $coluna1["id"]; ?>
Posted by claytonprog on 12/05/2012, 09:22 in PHP
<div class="content-box"> <div class="box-body"> <div class="box-header clear"> <h2>Listagem de Arquivos</h2> </div> <div class="box-wrap clear"> <div class="page clear"> <div class="columns clear"> <?php include "../connections/conexao.php"; $id_projeto = $_GET["id_projeto"]; $id_cliente = $_GET["id_cliente"]; $strSQL = mysql_query("SELECT * FROM upload_projetos where id_projeto='$id_projeto' and id_cliente='$id_cliente' GROUP BY data asc"); while ($aux = mysql_fetch_array($strSQL)) { $id = $aux['id']; $_dt_not= $aux['data']; list( $date, $time ) = explode( ' ', $_dt_not ); $data = explode("-",$date); $_dt_not = "$data[2]/$data[1]/$data[0]"; $dt_not = "$data[1]"; switch($dt_not) // acha o mês em português { case "1": $mes_port = "Janeiro"; break; case "2": $mes_port = "Fevereiro"; break; case "3": $mes_port = "Março"; break; case "4": $mes_port = "Abril"; break; case "5": $mes_port = "Maio"; break; case "6": $mes_port = "Junho"; break; case "7": $mes_port = "Julho"; break; case "8": $mes_port = "Agosto"; break; case "9": $mes_port = "Setembro"; break; case "10": $mes_port = "Outubro"; break; case "11": $mes_port = "Novembro"; break; case "12": $mes_port = "Dezembro"; break; } ?> <div class="col1-3"> <div class="content-box"> <div class="box-body"> <div class="box-header clear"> </div> <div class="box-wrap clear"> <div align="center"><img src="images/calendario.png" alt="" /> </div> <div align="center"><a href="ver_obra.php?id=<? echo $dt_not;?>"><?= $mes_port;?></a></div> </div> </div> </div> </div> <?php } ?> </div> <div class="box-wrap clear"></div> </div> </div> <!-- end of content-box --> </div> <p> <div class="tab-footer clear"></div> </div>
Posted by claytonprog on 08/05/2012, 20:48 in PHP
voce vai fazer a consulta normalmente das imagens do projeto organizando por data, pronto assim ja vamos ter as datas agrupadas.
so deixa eu pensar um pouco na separação dos meses
Posted by claytonprog on 07/05/2012, 22:03 in PHP
<table class="style1"> <thead> <tr> <th>Obra</th> <th>Nome da Obra</th> <th><div align="center">Status da Obra</div></th> <th><div align="center">Mês</div></th> </tr> </thead> <tbody> <?php include "../connections/conexao.php"; $id_projeto = $_GET["id_projeto"]; $id_cliente = $_GET["id_cliente"]; $strSQL = mysql_query("SELECT * FROM upload_projetos where id_projeto='$id_projeto' and id_cliente='$id_cliente' order by data desc"); while ($aux = mysql_fetch_array($strSQL)) { $id = $aux['id']; $_dt_not= $aux['data']; $data = explode("-",$_dt_not); $_dt_not = "$data[2]/$data[1]/$data[0]"; ?> <?php include "../connections/conexao.php"; $id_projeto = $_GET["id_projeto"]; $id_cliente = $_GET["id_cliente"]; $strSQL1 = mysql_query("SELECT * FROM projetos where id='$id_projeto' and id_cliente='$id_cliente' order by data desc"); while ($aux1 = mysql_fetch_array($strSQL1)) { $nome_projeto= $aux1['nome']; $foto = $aux1["foto"]; $status_projeto= $aux1['status']; $id_cliente= $aux1['id_cliente']; } ?> <!-- INICIO DO BOX MÊS ----> <tr class="box-slide-head"> <td><img src="../painel/<? echo $foto; ?>" alt="" class="thumb size48 clickable" /></td> <td> <p class="description"><h4><? echo $nome_projeto; ?></h4></p> </td> <td class="center vcenter"><? echo $status_projeto; ?></td> <td class="vcenter slide-but"><div align="center"><span></span>JANEIRO</div></td> </tr> <tr> <td colspan="4" class="box-slide-body ln-normal"> <h5>Fotos da Obra</h5> <div class="gallery gal-small"> <ul class="clear"> <?php $id_projeto = $_GET["id_projeto"]; $id_cliente = $_GET["id_cliente"]; $strSQL = mysql_query("SELECT * FROM upload_projetos where id_projeto='$id_projeto' and id_cliente='$id_cliente' order by data desc"); while ($aux = mysql_fetch_array($strSQL)) { $id = $aux['id']; $titulo = $aux["titulo"]; $foto = $aux["foto"]; $_dt_not= $aux['data']; $data = explode("-",$_dt_not); $_dt_not = "$data[2]/$data[1]/$data[0]"; ?> <li> <a href="../painel/<? echo $foto; ?>" rel="group2" title="<? echo $aux['titulo']; ?>"><img src="../painel/<? echo $foto; ?>" alt="" width="56" height="58" class="thumb" /></a> <br /> <p><small><strong>Data:</strong><? echo $_dt_not; ?></small></p> </li> <?php } ?> </ul> </div> </td> </tr> <!-- FINAL DO BOX MÊS DE JANEIRO ----> <?php } ?> <tr> <td colspan="4"> </td> </tr> </tbody> </table>
Posted by claytonprog on 07/05/2012, 16:06 in PHP
<!-- INICIO DO BOX MÊS ----> <table class="style1"> <thead> <tr> <th>Thumbs</th> <th>Description</th> <th>Status</th> <th>Mês</th> </tr> </thead> <tbody> <tr class="box-slide-head"> <td><a href="#" title="preview"><img src="images/tmp/thumbnail1.jpg" alt="" class="thumb size48 clickable" /></a></td> <td> <p class="description"><h4>Nome da Obra</h4></p> </td> <td class="center vcenter"><img src="images/ico_active_16.png" class="icon16 block center" title="active" alt="" /></td> <td class="vcenter slide-but"><div align="center"><span></span>JANEIRO</div></td> </tr> <tr> <td colspan="4" class="box-slide-body ln-normal"> <h5>Fotos da Obra</h5> <div class="gallery gal-small"> <ul class="clear"> <li><a href="#" rel="group2" title="Ver foto"><img src="images/tmp/thumbnail1.jpg" alt="" width="56" height="58" class="thumb" /></a></li> <li><a href="#" rel="group2" title="Ver foto"><img src="images/tmp/thumbnail1.jpg" alt="" width="56" height="58" class="thumb" /></a></li> <li><a href="#" rel="group2" title="Ver foto"><img src="images/tmp/thumbnail1.jpg" alt="" width="56" height="58" class="thumb" /></a></li> <li><a href="#" rel="group2" title="Ver foto"><img src="images/tmp/thumbnail1.jpg" alt="" width="56" height="58" class="thumb" /></a></li> </ul> </div> <p><small><strong>Postado em:</strong> by <a href="#">Arnold</a> | 20/03/2010</small></p> </td> </tr> <!-- FINAL DO BOX MÊS ----> <tr> <td colspan="4"> </td> </tr> </tbody> </table>
Posted by claytonprog on 20/04/2012, 09:04 in PHP
Posted by claytonprog on 19/04/2012, 00:03 in PHP
Posted by claytonprog on 17/04/2012, 00:03 in PHP
<?php //VERIFICA SE A SESSÃO ESTÁ ATIVA require_once("verifica.php"); //CONECTA COM O BANCO DE DADOS require_once("../connections/conexao.php"); include("helpers.php"); //mysql_connect ($sql_host, $sql_user, $sql_pass); // mysql_select_db ($sql_db); if (isset($_FILES['zipfile']['name'])) { $albumId = $_POST['album_id']; //$albumPath = mysql_result(mysql_query("SELECT FROM album_projeto WHERE id='" . $albumId . "'"),0); $zipFile = $_FILES['zipfile']['tmp_name']; $albumDir = 'fotos_album/'; //$albumDir = $root_dir . "images/" . $albumPath; $uploadDir = $albumDir . "tmp"; if (!file_exists($uploadDir)) mkdir($uploadDir); if (@is_uploaded_file($zipFile)) { $extension = getFileExtension($_FILES['zipfile']['name']); $now = time(); while(file_exists($newFile = $uploadDir.'/'.$now.'.'.$extension)) { $now++; } $uploadedFileName = $now.'.'.$extension; move_uploaded_file($_FILES['zipfile']['tmp_name'], $newFile); $zip = new ZipArchive; $handle = $zip->open($newFile); if ($handle === TRUE) { echo "<b>Fotos Enviadas com sucesso!</b>"; echo "<script language='javaScript'>window.location.href='fotos.php'</script>"; $zip->extractTo($uploadDir); $zip->close(); } else { echo 'Falha, código:' . $handle; } unlink($newFile); if ($handle = opendir($uploadDir)) { while (false !== ($file = readdir($handle))) { if ($file == "." || $file == "..") continue; $extension = getFileExtension($file); $now = time(); while(file_exists($newFile = $albumDir.'/'.$now.'.'.$extension)) { $now++; } $fileName = $now . '.' . $extension; rename($uploadDir.'/'.$file,$newFile); $arquivo = $fileName; $path_foto = $arquivo; $query = "INSERT INTO fotos (id_foto, id_album ,foto) VALUES('','$albumId','$path_foto')"; $result = mysql_query($query); } } } } ?>
Posted by claytonprog on 03/03/2012, 22:55 in PHP
<div align="justify"><font size="3" color="#000000"> </font> <?php require_once("../connections/conexao.php"); $consulta = mysql_query("SELECT * FROM inscricoes GROUP BY id_curso"); //$consulta = mysql_query("SELECT * FROM inscricoes"); while($resultado = mysql_fetch_array($consulta)) { $id_curso = $resultado["id_curso"]; // Aqui pego o id curso $aluno = $resultado["id_aluno"]; // Aqui eu pego o id do aluno $status = $resultado["status"]; // Aqui eu pego o id do aluno ?> <table align='center' width='1024' border='0' cellspacing='1' cellpadding='0' bgcolor='#FFFFFF'> <tr> <td align='left' class='imprimir2' bgcolor='#FFFFFF'></td> </tr> <tr> <td align='left' class='imprimir2' bgcolor='#FFFFFF' width='50%'> <?php $sql = "SELECT * FROM cursos WHERE id = '$id_curso' GROUP BY id"; $resultado = mysql_query($sql) or die ("Problema na Consulta"); While ($linha = mysql_fetch_array($resultado)) $nome_curso = $linha['nome']; { ?> <table width="1165" border="0"> <tr> <td colspan="9"></td> </tr> <tr> <td width="160"><strong><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">Curso</font></strong></td> <td width="130"><strong><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">Pré-Inscritos</font></strong></td> <td width="180"><strong><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">Inscritos</font></strong></td> <td width="80"><strong><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">Total</font></strong></td> </tr> <tr> <?php $somar = mysql_query("SELECT COUNT(id) as Total FROM inscricoes where status='inscrito'"); $totalid = mysql_fetch_array($somar); $somar2 = mysql_query("SELECT COUNT(id) as Total FROM inscricoes where status='preinscrito'"); $totalid2 = mysql_fetch_array($somar2); $total_geral = $totalid['Total'] + $totalid2['Total']; ?> <td> <font size="2" face="Arial, Helvetica, sans-serif"> <?= $nome_curso;?> <?= $statusr;?> </font></td> <td><font size="2" face="Arial, Helvetica, sans-serif"> ( <? echo $totalid2['Total']; ?> ) </font></td> <td><font size="2" face="Arial, Helvetica, sans-serif"> ( <? echo $totalid['Total']; ?> ) </font></td> <td><font size="2" face="Arial, Helvetica, sans-serif"> ( <? echo $total_geral; ?> ) </font></td> </tr> </table> <?php } ?> </td> </tr> <tr> </tr> </table> <table width="1024" border="0"> </table> <?php } ?> <div align="center" style="margin-top:20px"> </div> </div>
Posted by claytonprog on 21/02/2012, 20:40 in PHP
<?php require_once("../connections/conexao.php"); $id = $_GET['id']; $sql = "SELECT * FROM inscricoes WHERE id_aluno= '$id'"; $resultSet = mysql_query($sql, $conexao); $result = mysql_fetch_array($resultSet); $id_aluno = $result["id_aluno"]; if(mysql_num_rows($resultSet) <= '0'){ $id = $_GET['id']; $x = mysql_query("DELETE FROM clientes WHERE id='$id' LIMIT 1"); echo"Aluno deletado com sucesso"; echo "<script language='javaScript'>window.location.href='alunos.php'</script>"; } else { echo "Este aluno não pode ser excluído, pois está inscrito e algum curso!"; echo "<br>"; echo "<a href='alunos.php'>Clique para Voltar!</a><br> "; exit; } ?>
Posted by claytonprog on 21/02/2012, 18:34 in PHP
<?php require_once("../connections/conexao.php"); ?> <?php $id = $_GET['id']; $sql = "SELECT * FROM inscricoes WHERE id_aluno= '$id'"; $resultSet = mysql_query($sql, $conexao); $result = mysql_fetch_array($resultSet); $id_aluno = $result["id_aluno"]; echo $id_aluno; if($id_aluno <> ""){ $id = $_GET['id']; $x = mysql_query("DELETE FROM clientes WHERE id='$id' LIMIT 1"); echo"Aluno deletado com sucesso"; echo "<script language='javaScript'>window.location.href='alunos.php'</script>"; } else { echo "Este aluno não pode ser excluído, pois está inscrito e algum curso!"; echo "<br>"; echo "<a href='alunos.php'>Clique para Voltar!</a><br> "; exit; } ?>
Posted by claytonprog on 03/02/2012, 00:14 in PHP
Posted by claytonprog on 02/02/2012, 19:15 in PHP
Community Forum Software by IP.Board
Licensed to: Webmasters Online