Tema: Color Celdas
Ver Mensaje Individual
  #6 (permalink)  
Antiguo 23/03/2008, 09:43
freskury
 
Fecha de Ingreso: septiembre-2007
Mensajes: 200
Antigüedad: 16 años, 7 meses
Puntos: 0
Re: Color Celdas

Ten go que recurrir a vosotros pq me estoy iniciando en php y todavia no me entero.

Esl codigo que tengo es el siguiente:

Cita:
<?php
// If you are using an old version of php, remove the next set of lines.
// or use $HTTP_POST_VARS["..."] instead.
$Submit = $_POST["Submit"];
$Name = $_POST["Name"];
$Email = $_POST["Email"];
$Website = $_POST["Website"];
$Comments = $_POST["Comments"];
$NumLow = $_REQUEST["NumLow"];
$NumHigh = $_REQUEST["NumHigh"];

// Replace special characters - you can remove the next 5 lines if wanted.
$Name = ereg_replace("[^A-Za-z0-9 ]", "", $Name);
$Email = ereg_replace("[^A-Za-z0-9 \@\.\-\/\']", "", $Email);
$Comments = ereg_replace("[^A-Za-z0-9 \@\.\-\/\']", "", $Comments);
$Website = eregi_replace("[^A-Za-z0-9 \@\.\-\/\']", "", $Website);
$Website = ereg_replace("[^A-Za-z0-9 \@\.\-\/\'\~\:]", "", $Website);

// Remove slashes.
$Name = stripslashes($Name);
$Email = stripslashes($Email);
$Website = stripslashes($Website);
$Comments = stripslashes($Comments);

// ################################################## #################################
// ########## Reading and Writing the new data to the GuestBook Database #############

if ($Submit == "Yes") {
// Next line tells the script which Text file to open.
$filename = "GuestBook.txt";

// Opens up the file declared above for reading

$fp = fopen( $filename,"r");
$OldData = fread($fp, 80000);
fclose( $fp );

// Gets the current Date of when the entry was submitted
//Fecha en español
$varHoy=date( "d/m/Y", time() );
function fechaesp($fecha=0,$tipofecha=1)
{

if ($fecha==0){ $fecha=$GLOBALS["varHoy"]; }
$fecha=getdate(strtotime ($fecha));
$mes=$fecha["mon"];
$ano=$fecha["year"];
$dia=$fecha["wday"];
$diam=$fecha["mday"];
$dias[0]='Domingo';
$dias[1]='Lunes';
$dias[2]='Martes';
$dias[3]='Miercoles';
$dias[4]='Jueves';
$dias[5]='Viernes';
$dias[6]='S&aacute;bado';
$meses[1]='Enero';
$meses[2]='Febrero';
$meses[3]='Marzo';
$meses[4]='Abril';
$meses[5]='Mayo';
$meses[6]='Junio';
$meses[7]='Julio';
$meses[8]='Agosto';
$meses[9]='Septiembre';
$meses[10]='Octubre';
$meses[11]='Noviembre';
$meses[12]='Diciembre';
if ($tipofecha==1)
{
$fecha=$dias[$dia].' '.$diam.' de '.$meses[$mes].' de '.$ano;
}
else
{
$fecha=$meses[$mes].'/'.$ano;
}
return $fecha;
}



// Puts the recently added data into html format that can be read into the Flash Movie.
// You can change this up and add additional html formating to this area. For a complete listing of all html tags
// you can use in flash - visit: http://www.macromedia.com/support/fl...s/htmltext.htm



$Input = "_________________________________________________ _________________<b><br><font size=\"15\"><font color =\"#000000\">Nombre: <font color =\"#FFFFFF\">$Name</c><br><font color =\"#000000\">Email: <font color =\"#FFFFFF\">$Email</a></u></b><br><font color =\"#000000\">Localidad: <b><b><\"><font color =\"#FFFFFF\">$Website</a></u></b><br><font color =\"#000000\">Comentario: </b><font color =\"#FFFFFF\">$Comments</b><br><i><font size=\"13\"><font color =\"#0000FF\">Fecha: $varHoy</font><br>.:::.";

/* This Line adds the '&GuestBook=' part to the front of the data that is stored in the text file. This is important because without this the Flash movie would not be able to assign the variable 'GuestBook' to the value that is located in this text file */

$New = "$Input$OldData";

// Opens and writes the file.

$fp = fopen( $filename,"w");
if(!$fp) die("&GuestBook=cannot write $filename ......&");
fwrite($fp, $New, 800000);
fclose( $fp );
}

// ################################################## #################################
// ######### Formatting and Printing the Data from the Guestbook to the Flash Movie ##



// Next line tells the script which Text file to open.
$filename = "GuestBook.txt";

// Opens up the file declared above for reading

$fp = fopen( $filename,"r");
$Data = fread($fp, 800000);
fclose( $fp );

// Splits the Old data into an array anytime it finds the pattern .:::.
$DataArray = split (".:::.", $Data);

// Counts the Number of entries in the GuestBook
$NumEntries = count($DataArray) - 1;

print "&TotalEntries=$NumEntries&NumLow=$NumLow&NumHigh= $NumHigh&GuestBook=";
for ($n = $NumLow; $n < $NumHigh; $n++) {
print $DataArray[$n];
if (!$DataArray[$n]) {
Print "<br><br><b><font color =\"#000000\">NO NAY MAS COMENTARIOS</b>";
exit;
}
}
?>
y ahora las preguntas:

¿que debo de modificar aparte de los colores, del codigo que hay en Faqs?

¿donde coloco el codigo?

Os juro que dia a dia trato de ir entendiendo códigos y demas pero me cuesta un poquitin.

Muchas gracias