Jump to content


phew

Member Since 10/05/2006
Offline Last Active 13/06/2008, 10:45
-----

Topics I've Started

Session Erro...

17/07/2006, 10:36

Estou usando login com session + iframe... E todas as paginas que abrem no ifram dão o seguinte erro:
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:\bin\easyphp1-8\www\admin\home_not.php:5) in c:\bin\easyphp1-8\www\admin\verifica.php on line 3

Verifica.php
<?php

session_start();
if( !$_SESSION['authorized'] ){
   header("Location: index.php");
}

?>

Unlink, Problema...

17/07/2006, 08:39

unlink('../'.$row['foto']);

Usando desa maneira da o seguinte erro : Parse error: syntax error, unexpected T_STRING in /home/phelen/public_html/admin/excluir.php on line 12, Porem se eu tirar as ' ou " da ele tenta dividir, como fazer ele subir 1 diretoria e assim deletar?

Erro...

16/07/2006, 09:41

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style2 {
	color: #000000;
	font-size: 18px;
}
-->
</style>
</head>
<link rel="stylesheet" href="iCGstation.css" type="text/css" -="">

<body bgcolor="#CCCCCC">
<?
$sql = "select *,DATE_FORMAT(data, '%d/%m/%Y') as databr from noticias order by id DESC";

	$conexao = mysql_connect("$host","$user","$pass");
	mysql_select_db("$db");

	$query = mysql_query($sql);

	while($linha = mysql_fetch_array($query))
	{
	echo '
	<img src="admin_im/nova_no.gif" width="99" height="23">
	<table class="forumline" border="0" cellpadding="2" cellspacing="1" width="100%">
	  <tbody>
   	 <tr>
		  <td class="navpic" height="25"><span class="genmed">
			<center>
			  <b>Not&iacute;cia:'. $linha["titulo"] .' </b>
			</center>
	 	 </span></td>
		</tr>
		<tr>
		  <td class="row2" align="left" height="24"><span class="gensmall">' .	 $linha["databr"] .'-'. $linha["hora"].'  </span></td>
		</tr>
		<tr>
		  <td class="row1" align="left"><div align="center">
			<p><span class="gensmall" style="line-height: 150%;"><span class="style2">'. $linha["corpo"] .' </span></span></p>
			<p>&nbsp;</p>
			<p><span class="gensmall" style="line-height: 150%;"><br>
				<br>
				</span></p>
		  </div></td>
		</tr>
		<tr>
		  <td class="row3" align="left" height="24"><span class="gensmall"> (Escrito por: <a href="mailto:"' . $linha["email"] . '">' . $linha["nick"] . '</a>) </span></td>
		</tr>
	  </tbody>
	</table>
	<img src="admin_im/edit_no.gif" width="99" height="23">
	<img src="admin_im/delet_no.gif" width="99" height="23">'; ?>

</body>
</html>


Parse error: parse error in c:\bin\easyphp1-8\www\admin\home_not.php on line 59
Seria a ultima linha, após o </html>, não seio q pode ser...

Paginação

15/07/2006, 10:57

while ($row = mysql_fetch_assoc($result))
{
  echo (($X%$Col) == 0) ? "<tr align='center' height='100'><td width='120'>" : "<td width='120'>";

// -- ALTERE DAQUI PRA BAIXO !!!

  $id = $row['id'];

  echo "<img src='{$row['miniatura']}' border='1' height='94' width='117'><br>";

  if ($row['nome']<"8") {
  $nome=$row['nome'];
  }
  else{
  $nome=substr($row['nome'], 0,8)."...";
  }

  echo "<strong><a href='".$row['foto']."'>".$nome."</a></strong>";

// -- ALTERE DAQUI PRA CIMA !!!

  echo (($X%$Col) == ($Col-1)) ? "</td></tr>" : "</td>";
  $X++;
}

Como alterar esse código para quando não tiver mais imagens a tabela fique normal, se não a tabela fica pequena e as imagens ficam centralizadas...

Posted Image
Fica assim quando tem somente 2 imagens, ficam centralizadas...
Posted Image
mas como fazer para quando tiver apenas 2 ou 3, elas ficarem a direita... ao invez de centralizadas...

Valida User!

12/07/2006, 13:52

<?
session_start();

$user = $_POST['username'];
$sql = SELECT * FROM login WHERE login ='$user';
$ver=mysql_fetch_array($busca);
if (!$ver['login'] == "") {
$login=$ver['login'];
$pwd=$ver['pwd'];
if ($_POST['username'] == '$ver['login']' and
	 $_POST['password'] == '$ver['pwd']'){
   $_SESSION['authorized'] = true;
   header("Location: administra.php"); 
}else
   header("Location: login.php");
}
else
header("Location: login.php");

?>

Estava tentando fazer um login, que pegasse o login e pwd de um BD, só que esta dando erro na linha 5 que eh a linha do Select, alguem tem ideia do que esta errado?

Erro:

Parse error: parse error in c:\bin\easyphp1-8\www\admin\valida_user.php on line 5


Resolvido

IPB Skin By Virteq