Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
ae galera to com outro problema aqui concerteza tem algo a ver com a inserção porem tem o sistem online pra voces verem: o que ocorre é qua a hora dos registros estao com o memso minutos que é 4
vejam os codigos
inserir_noticia.php
<?php
require("confere.php");
include('conexao.php');
date_default_timezone_set('America/Sao_Paulo');
$titulo=$_POST['titulo'];
$resumo=$_POST['resumo'];
$texto=$_POST['texto'];
$dono=$_SESSION['usuario'];
$data=date("Y-m-d, H:m:s");
if($titulo!="" && $resumo!="" && $texto!=""){
$sql="INSERT INTO noticias (titulo,resumo,texto,dono,data) VALUES ('$titulo','$resumo','$texto','$dono','$data')";
$query=mysql_query($sql);
if($query){
header("Location:todas_noticias.php");
}
}else{
header("Location:cadastrar_noticia.php");
}
?>
e o meu index.php
<?php
require("admin/conexao.php");
$sql="SELECT * FROM noticias ORDER BY id DESC LIMIT 3";
$query=mysql_query($sql);
$sql2="SELECT * FROM artigos ORDER BY id DESC LIMIT 15";
$query2=mysql_query($sql2);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="js/data.js"> </script>
<link href="css/stilo.css" rel="stylesheet" type="text/css" />
<title>Clinica X</title></head>
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
</head>
<body>
<table align="center" class="topo" width="900">
<tr>
<th width="108" scope="col" bgcolor="#ffffff" onmouseover="javascript:style.background='#999999'" onmouseout="javascript:style.background='#ffffff'"><a href="index.php">Inicio</a></th>
<th width="144" scope="col" bgcolor="#ffffff" onmouseover="javascript:style.background='#999999'" onmouseout="javascript:style.background='#ffffff'"><a href="galeria.php">Galeria</a></th>
<th width="92" scope="col" bgcolor="#ffffff" onmouseover="javascript:style.background='#999999'" onmouseout="javascript:style.background='#ffffff'"><a href="blog.php">Blog</a></th>
<th width="114" scope="col" bgcolor="#ffffff" onmouseover="javascript:style.background='#999999'" onmouseout="javascript:style.background='#ffffff'"><a href="sobre.php">Sobre</a></th>
<th width="108" scope="col" bgcolor="#ffffff" onmouseover="javascript:style.background='#999999'" onmouseout="javascript:style.background='#ffffff'"><a href="local.php">Local</a></th>
<th width="199" scope="col" bgcolor="#ffffff" onmouseover="javascript:style.background='#999999'" onmouseout="javascript:style.background='#ffffff'"><a href="institucional.php">Institucional</a></th>
<th width="111" scope="col" bgcolor="#999999" onmouseover="javascript:style.background='#999999'" onmouseout="javascript:style.background='#999999'"><a href="contato.php">Contato<img src="imagens/carta.jpg" alt="carta" width="22" height="14" border="0" /></a></th>
</tr>
<tr>
<td colspan="7"><img src="imagens/logo.jpg" alt="clinica x" width="900" height="200" /></td>
</tr>
<tr>
<td colspan="6" bgcolor="#2C6483"><script type="text/javascript">
dataExtensa();
</script></td>
<td bgcolor="#627885" onmouseover="javascript:style.background='#999999'" onmouseout="javascript:style.background='#627885'"><div align="center"><a href="admin/login.php"><strong>Login</strong></a></div></td>
</tr>
</table>
<!-- TemplateBeginEditable name="conteudo" -->
<div align="center"><table width="899" align="center">
<tr class="menu">
<td width="511">Noticias</td>
<td width="3" rowspan="2" bgcolor="#999999"> </td>
<td width="200">Artigos</td>
<td width="3" rowspan="2" bgcolor="#999999"> </td>
<td width="150">Serviços</td>
</tr>
<tr class="menutexto">
<td height="237" align="left" valign="top">
<?php
while ($linha = mysql_fetch_array($query, MYSQL_ASSOC)){
$id=$linha['id'];
$titulo=$linha['titulo'];
$resumo=$linha['resumo'];
$data=date('d/m/Y'."-".'H:m:s', strtotime($linha['data']));
echo "<table class='menutexto' width='100%'>
<tr><td><strong>$titulo</strong><br><small>$data</small><br></td></tr>
<tr><td>$resumo</td></tr>
<tr><td align='right'><a href='ver_noticia.php?id=$id'>Leia mais...</a></td>
</tr></table>";
}
?> <div align="center" class="menutexto"><a href="todas_noticias.php">Ver todas as noticias</a></div></td>
</td>
<td align="left" valign="top">
por que isso ta acontecendo?
Carregando comentários...