Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/02/2011, 10:19
manuel2788
 
Fecha de Ingreso: enero-2011
Mensajes: 95
Antigüedad: 13 años, 3 meses
Puntos: 2
Pregunta Estilo css para varios echo php

Buenas tardes,

Les planteo mi problema a continuación, tengo un script php que inserta unos datos de registro en una bd. Cada uno de los datos que ingresa el usuario deben cumplir ciertas normas, si estas no se cumplen el sistema les arroja un mensaje de error por medio de un echo.

Hasta ahí, todo bien. La cosa es que dichos mensajes de error se mostraban en una segunda página en blanco y he querido darle estilo por medio de css. La cosa es que, cuando hay varios reglas no cumplidas por el usuario en el registro. El script muestra varios mensajes de error, pero el css se repite en cada mensaje.

Lo que quiero es que dicho css solo se muestre una vez y todos los mensajes de error, se muestren en él sin repetir dicho css.

A continuación el pedazo más importante del script php:

Código:
if(trim($_POST["nick"]) != "" && trim($_POST["email"]) != "" )
$error = 0;
						
	$sql = "SELECT id FROM registro WHERE nick='" . quitar($_POST['nick']) . "'";
	$result = mysql_query($sql);
	$row = mysql_fetch_array($result);
	if($row["id"] != "")
	{
	echo '<html>
		 <head>
		 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		 <title>Retalos: Pronósticos Deportivos</title>
		 <style type="text/css">
		 body {
		 background-image:url(imagenes/fondo.jpg);
		 background-repeat:repeat;
		 background-attachment:fixed;
		 margin-top:20px;
		 }
					  
		 #elipsis {
		 background-image:url(imagenes/elipsis_error.png);
		 background-repeat:no-repeat;
		 margin:auto auto;
		 width:615px;
		 height:400px;
		 }
			  
		 #mensaje {
		 font-family:Verdana, Geneva, sans-serif;
		 font-size:14px;
		 font-style:normal;
		 font-weight: bold;
		 color: #000;
		 text-decoration: none;
		 text-align:center;
		 }
		</style>
		</head>
		<body>
			 
		<div id="elipsis" #elipsis>
	        <div id="mensaje" #mensaje>
					 
		<br /><br /><br /><br /><br />
		Error, el nick ya se encuentra registrado en el sistema.
			
		</div>
		   
		</div> 
				
		</body>
		</html>';
$error = 1;
	}
	$sql = "SELECT id FROM registro WHERE email='" . quitar($_POST['email']) . "'";
	$result = mysql_query($sql);
	$row = mysql_fetch_array($result);
	if($row["id"] != "")
	{
	echo '<html>
		<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Retalos: Pronósticos Deportivos</title>
		<style type="text/css">
		body {
		background-image:url(imagenes/fondo.jpg);
		background-repeat:repeat;
		background-attachment:fixed;
		margin-top:20px;
		}
		  
		#elipsis {
		background-image:url(imagenes/elipsis_error.png);
		background-repeat:no-repeat;
		margin:auto auto;
		width:615px;
		height:400px;
		}
								  
		#mensaje {
		font-family:Verdana, Geneva, sans-serif;
		font-size:14px;
		font-style:normal;
		font-weight: bold;
		color: #000;
		text-decoration: none;
		text-align:center;
		}
		</style>
		</head>
		<body>
				 
		<div id="elipsis" #elipsis>
        	<div id="mensaje" #mensaje>
					 
		<br /><br /><br /><br /><br /><br /><br />
		Error, el email ya se encuentra registrado en el sistema.
				
		</div>
				   
		</div> 
					
		</body>
		</html>';
Espero puedan ayudarme, un saludo.