Jump to content


Photo

Problema: Css Influenciando No Php


  • Faça o login para participar
3 replies to this topic

#1 DanielDesign

DanielDesign

    Novato no fórum

  • Usuários
  • 14 posts
  • Sexo:Masculino
  • Localidade:Santa Catarina - Criciúma
  • Interesses:Webdesign

Posted 09/04/2014, 10:57

Tenho o seguinte código

<!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=utf-8" />
<title>Edita</title>
</head>
<body>
<?php

	require("../conexao.php");


	$id=$_GET['id']; 
	$servico=$_POST['servico'];
	$cliente=$_POST['cliente'];
	$data=$_POST['data'];
	$descricao=$_POST['descricao'];

	$stringSQL = "UPDATE `walldivi_walldivi`.`portfolio` SET `servico` = '$servico', `cliente` = '$cliente', `data` = '$data', `descricao` = '$descricao' WHERE `portfolio`.`id` = $id;";	
	$ativaQuery = mysql_query($stringSQL);
		
	if ($ativaQuery) {
	echo "<div class='alerta_verde'>";
	echo "<h1>Portfolio alterado com sucesso.</h1>";
	echo '</div>';
} else {
	echo "<div class='alerta_vermelho'>";
	echo "<h1>Não foi possível alterar o portfolio, tente novamente.</h1>";
	echo '</div>';
	echo "<br />Dados sobre o erro:" . mysql_error();
}

?>
<script type="text/javascript">
	setTimeout('location.href="../../portfolio-admin.php";',2250);	
</script>
</body>
</html>

e assim ele funciona.. porém se eu adiciono o css como no exemplo abaixo ele para de funcionar..

POR QUEEEEE ?

<!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=utf-8" />
<title>Edita</title>
<style type="text/css">
	.alerta_verde{
		margin:20% auto;
		width:300px;
		height:auto;
		padding:10px;
		border:1px solid #060;
		background:#090;
		text-align:center; 
	}
	.alerta_verde h1{
		color:white;
		font-family:Verdana, Geneva, sans-serif;
		font-size:12px;
	}
	.alerta_vermelho{
		margin:20% auto;
		width:300px;
		height:auto;
		padding:10px;
		border:1px solid #900;
		background: #F00;
		text-align:center;
	}
	.alerta_vermelho h1{
		color:white;
		font-family:Verdana, Geneva, sans-serif;
		font-size:12px;
	}		
</style>
</head>
<body>
<?php

	require("../conexao.php");


	$id=$_GET['id']; 
	$servico=$_POST['servico'];
	$cliente=$_POST['cliente'];
	$data=$_POST['data'];
	$descricao=$_POST['descricao'];

	$stringSQL = "UPDATE `walldivi_walldivi`.`portfolio` SET `servico` = '$servico', `cliente` = '$cliente', `data` = '$data', `descricao` = '$descricao' WHERE `portfolio`.`id` = $id;";	
	$ativaQuery = mysql_query($stringSQL);
		
	if ($ativaQuery) {
	echo "<div class='alerta_verde'>";
	echo "<h1>Portfolio alterado com sucesso.</h1>";
	echo '</div>';
} else {
	echo "<div class='alerta_vermelho'>";
	echo "<h1>Não foi possível alterar o portfolio, tente novamente.</h1>";
	echo '</div>';
	echo "<br />Dados sobre o erro:" . mysql_error();
}

?>
<script type="text/javascript">
	setTimeout('location.href="../../portfolio-admin.php";',2250);	
</script>
</body>
</html>

Posted Image
Daniel Leal Freitas - 48 9975-9886 - Webdesigner Freelancer
www.novaz.com.br
Curta no Facebook
Siga-me no Twitter

#2 andre.m.moura

andre.m.moura

    Novato no fórum

  • Usuários
  • 14 posts
  • Sexo:Masculino
  • Localidade:SP

Posted 22/04/2014, 12:36

Olá!

Você já tentou assim:


<?php
ob_start();
require("../conexao.php");
?>

<!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=utf-8" />
<title>Edita</title>
<style type="text/css">
        .alerta_verde{
                margin:20% auto;
                width:300px;
                height:auto;
                padding:10px;
                border:1px solid #060;
                background:#090;
                text-align:center; 
        }
        .alerta_verde h1{
                color:white;
                font-family:Verdana, Geneva, sans-serif;
                font-size:12px;
        }
        .alerta_vermelho{
                margin:20% auto;
                width:300px;
                height:auto;
                padding:10px;
                border:1px solid #900;
                background: #F00;
                text-align:center;
        }
        .alerta_vermelho h1{
                color:white;
                font-family:Verdana, Geneva, sans-serif;
                font-size:12px;
        }               
</style>
</head>

<?php
$id        = $_GET['id']; 
$servico   = $_POST['servico'];
$cliente   = $_POST['cliente'];
$data      = $_POST['data'];
$descricao = $_POST['descricao'];

$stringSQL = "UPDATE `walldivi_walldivi`.`portfolio` 
SET `servico` = '$servico', `cliente` = '$cliente', `data` = '$data', `descricao` = '$descricao' 
WHERE `portfolio`.`id` = $id;";   

$ativaQuery = mysql_query($stringSQL);
                
if ($ativaQuery) {
 echo "<div class='alerta_verde'>";
 echo "<h1>Portfolio alterado com sucesso.</h1>";
 echo '</div>';
} else {
 echo "<div class='alerta_vermelho'>";
 echo "<h1>Não foi possível alterar o portfolio, tente novamente.</h1>";
 echo '</div>';
 echo "<br />Dados sobre o erro:" . mysql_error();
}

?>

<body>
<script type="text/javascript">
        setTimeout('location.href="../../portfolio-admin.php";',2250);
        
</script>
</body>
</html>


Poste o erro pra gente ver!
Abraço!

Edição feita por: andre.m.moura, 22/04/2014, 12:37.


#3 DanielDesign

DanielDesign

    Novato no fórum

  • Usuários
  • 14 posts
  • Sexo:Masculino
  • Localidade:Santa Catarina - Criciúma
  • Interesses:Webdesign

Posted 22/04/2014, 12:40

Olá!

Você já tentou assim:


<?php
ob_start();
require("../conexao.php");
?>

<!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=utf-8" />
<title>Edita</title>
<style type="text/css">
        .alerta_verde{
                margin:20% auto;
                width:300px;
                height:auto;
                padding:10px;
                border:1px solid #060;
                background:#090;
                text-align:center; 
        }
        .alerta_verde h1{
                color:white;
                font-family:Verdana, Geneva, sans-serif;
                font-size:12px;
        }
        .alerta_vermelho{
                margin:20% auto;
                width:300px;
                height:auto;
                padding:10px;
                border:1px solid #900;
                background: #F00;
                text-align:center;
        }
        .alerta_vermelho h1{
                color:white;
                font-family:Verdana, Geneva, sans-serif;
                font-size:12px;
        }               
</style>
</head>

<?php
$id        = $_GET['id']; 
$servico   = $_POST['servico'];
$cliente   = $_POST['cliente'];
$data      = $_POST['data'];
$descricao = $_POST['descricao'];

$stringSQL = "UPDATE `walldivi_walldivi`.`portfolio` 
SET `servico` = '$servico', `cliente` = '$cliente', `data` = '$data', `descricao` = '$descricao' 
WHERE `portfolio`.`id` = $id;";   

$ativaQuery = mysql_query($stringSQL);
                
if ($ativaQuery) {
 echo "<div class='alerta_verde'>";
 echo "<h1>Portfolio alterado com sucesso.</h1>";
 echo '</div>';
} else {
 echo "<div class='alerta_vermelho'>";
 echo "<h1>Não foi possível alterar o portfolio, tente novamente.</h1>";
 echo '</div>';
 echo "<br />Dados sobre o erro:" . mysql_error();
}

?>

<body>
<script type="text/javascript">
        setTimeout('location.href="../../portfolio-admin.php";',2250);
        
</script>
</body>
</html>


Poste o erro pra gente ver!
Abraço!


o que você mudou ? só o ob_start?
Posted Image
Daniel Leal Freitas - 48 9975-9886 - Webdesigner Freelancer
www.novaz.com.br
Curta no Facebook
Siga-me no Twitter

#4 andre.m.moura

andre.m.moura

    Novato no fórum

  • Usuários
  • 14 posts
  • Sexo:Masculino
  • Localidade:SP

Posted 22/04/2014, 12:42

Inclui o ob_start() e mudei as posições também.
Para saber mais sobre o ob_Start() PHP.net.

Mas ocorreu algum erro?

Edição feita por: andre.m.moura, 22/04/2014, 12:46.





0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq