<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog de Sergio Álvarez Fernández &#187; Flash &amp; BackEnd</title>
	<atom:link href="http://blog.sergioalvarez.net/category/flash-backend/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sergioalvarez.net</link>
	<description>Blog de Sergio Álvarez Fernández</description>
	<lastBuildDate>Thu, 01 Apr 2010 11:11:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Libro de Visitas: Flash + Php + MySql</title>
		<link>http://blog.sergioalvarez.net/libro-de-visitas-flash-php-mysql/</link>
		<comments>http://blog.sergioalvarez.net/libro-de-visitas-flash-php-mysql/#comments</comments>
		<pubDate>Tue, 14 Mar 2006 14:58:54 +0000</pubDate>
		<dc:creator>...sErGiO...</dc:creator>
				<category><![CDATA[Flash & BackEnd]]></category>

		<guid isPermaLink="false">http://blog.sergioalvarez.net/?p=10</guid>
		<description><![CDATA[    	.titulo_tabla { 		font-size: 12px; 		font-weight: bold; 	} 	 	.resaltar {color: #754F00} 	 	.codigo { 		background: #EEEEEE;  		border: 1px solid #E0DEDE; 		font-size:11px; 		font-family:Arial, Helvetica, sans-serif; 		padding: 5px 10px 5px 10px; 		margin: 1em; 	} 	.cod{ 		font-size:11px; 		font-family:Arial, Helvetica, sans-serif; 	} 
1.- Introducción
El objetivo de este tutorial es la creación de un pequeño [...]]]></description>
			<content:encoded><![CDATA[<style>    	.titulo_tabla { 		font-size: 12px; 		font-weight: bold; 	} 	 	.resaltar {color: #754F00} 	 	.codigo { 		background: #EEEEEE;  		border: 1px solid #E0DEDE; 		font-size:11px; 		font-family:Arial, Helvetica, sans-serif; 		padding: 5px 10px 5px 10px; 		margin: 1em; 	} 	.cod{ 		font-size:11px; 		font-family:Arial, Helvetica, sans-serif; 	} </style>
<p><strong>1.- Introducción</strong></p>
<p>El objetivo de este tutorial es la creación de un pequeño sistema que desde flash permita la lectura e insercción de datos en una tabla de una Base de datos. Para ello intentaremos crear un pequeño libro de visitas en el cual podamos insertar comentarios y leer los ya existentes.</p>
<p>La idea de este tutorial, no es otra que la de ser un recurso didactico más para aprender a combinar php y mysql con actionscript. En ningún momento tengo como objetivo el de proporcionar un libro de visitas ya hecho a medida, y para que este tutorial sirva de guía se recomienda tener unos conocimientos mínimos de php y actionscript. Además se recomienda tener unas nociones básicas de sql, o por lo menos saber lo que es.</p>
<p>Para poder hacer pruebas y realizar el libro de visitas, es necesario disponer de un servidor que tenga php y mysql instalado.</p>
<p>Un ejemplo final adaptado de este tutorial podría ser este: <a title="Libro Visitas: Flash + Php + mySql" target="_blank" href="http://blog.sergioalvarez.net/tutoriales/libro_visitas/">Libro Visitas</a></p>
<p><span id="more-10"></span><strong>2.- Creación de la Base de datos (MySql)</strong></p>
<p>En este caso tan sólo voy a utilizar una tabla y contendrá la siguiente estructura:</p>
<table width="536" cellspacing="0" border="1">
<tr bgcolor="#84929f">
<td style="width: 53px"><span class="titulo_tabla">TABLA</span></td>
<td bgcolor="#84929f" style="width: 473px"><span class="titulo_tabla">SQL</span></td>
</tr>
<tr>
<td><img src="http://blog.sergioalvarez.net/wp-content/uploads/2006/03/bd_libro_visitas.gif" /></td>
<td class="cod">CREATE TABLE libro_visitas (<br />
id INT(11) NOT NULL AUTO_INCREMENT,<br />
nombre VARCHAR(100) NULL,<br />
email VARCHAR(250) NULL,<br />
mensaje TEXT NULL,<br />
fecha DATETIME NULL,<br />
PRIMARY KEY(id)<br />
);</td>
</tr>
</table>
<p>Para la creación de la única tabla que necesitamos, utilizaremos phpMyAdmin que no debería de suponer ninguna compliación, ya que podremos crear nuestra tabla mediante el script sql que hay más arriba o mediante las funciones que ofrece el interface de phpMyAdmin..</p>
<p>Sí se piensa utilizar los scripts php que se encuentran más abajo, es importante que se mantenga la estructura de la tabla tal como se indica arriba, con los mismos nombres de columnas y tipos..</p>
<p><strong>3.-Operaciones con la Base de datos (Php)</strong></p>
<p>Para recuperar los datos se optará por obtener los datos mediante php, y generando un archivo xml que más tarde se leerá desde flash mediante los métodos predefinidos del objeto LoadVars que incorpora Flash.</p>
<p>En cuanto a la insercción tendremos un archivo php que recibirá una serie de variables y mediante una consulta sql realizará la insercción de dichas variables en nuestra tabla de la base de datos.</p>
<p><strong>3.1.-Lectura de registros</strong></p>
<p>Para la lectura de los datos, lanzaremos la siguiente consulta sql:</p>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-7">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> * <span style="color: #993333; font-weight: bold;">FROM</span> libro_visitas <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> fecha <span style="color: #993333; font-weight: bold;">ASC</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Con esta consulta obtendremos todos los registros que haya en la tabla <span class="resaltar">libro_visitas</span> ordenados por el campo <span class="resaltar">fecha</span> y generaremos dinámicamente mediante php un archivo xml que luego leeremos desde flash.</p>
<p>Este podría ser el código fuente para nuestro archivo <span class="resaltar">obtener_datos.php</span>:</p>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-8">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/ob_start"><span style="color:#000066;">ob_start</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Nos conectamos con la base de datos</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$conexion</span> = <a href="http://www.php.net/mysql_connect"><span style="color:#000066;">mysql_connect</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"host"</span>,<span style="color:#FF0000;">"usuario,"</span>contraseña<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">or <a href="http://www.php.net/die"><span style="color:#000066;">die</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'No pudo conectarse : '</span> . <a href="http://www.php.net/mysql_error"><span style="color:#000066;">mysql_error</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/mysql_select_db"><span style="color:#000066;">mysql_select_db</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"nombre_bd"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Hacemos la consulta para obtener los datos</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sql</span> = <span style="color:#FF0000;">'select * from libro_visitas order by fecha asc'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$consulta</span> = <a href="http://www.php.net/mysql_query"><span style="color:#000066;">mysql_query</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$sql</span>,<span style="color:#0000FF;">$conexion</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$n</span> = <a href="http://www.php.net/mysql_num_rows"><span style="color:#000066;">mysql_num_rows</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$consulta</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// Empezamos a generar el archivo xml</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Por cada fila de la base de datos generaremos una fila en el xml</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">for</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$i</span>=<span style="color:#CC66CC;color:#800000;">0</span>; <span style="color:#0000FF;">$i</span>&lt;<span style="color:#0000FF;">$n</span>; <span style="color:#0000FF;">$i</span>++<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$id</span>=<a href="http://www.php.net/mysql_result"><span style="color:#000066;">mysql_result</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$consulta</span>, <span style="color:#0000FF;">$i</span>,<span style="color:#FF0000;">'id'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$nombre</span>=<a href="http://www.php.net/mysql_result"><span style="color:#000066;">mysql_result</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$consulta</span>, <span style="color:#0000FF;">$i</span>,<span style="color:#FF0000;">'nombre'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$email</span>=<a href="http://www.php.net/mysql_result"><span style="color:#000066;">mysql_result</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$consulta</span>, <span style="color:#0000FF;">$i</span>,<span style="color:#FF0000;">'email'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mensaje</span>=<a href="http://www.php.net/mysql_result"><span style="color:#000066;">mysql_result</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$consulta</span>, <span style="color:#0000FF;">$i</span>,<span style="color:#FF0000;">'mensaje'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$fecha</span>=<a href="http://www.php.net/mysql_result"><span style="color:#000066;">mysql_result</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$consulta</span>, <span style="color:#0000FF;">$i</span>,<span style="color:#FF0000;">'fecha'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <a href="http://www.php.net/utf8_encode"><span style="color:#000066;">utf8_encode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\t</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">nombre=<span style="color:#000099; font-weight:bold;">\"</span>$nombre<span style="color:#000099; font-weight:bold;">\"</span> mensaje=<span style="color:#000099; font-weight:bold;">\"</span>$mensaje<span style="color:#000099; font-weight:bold;">\"</span> fecha=<span style="color:#000099; font-weight:bold;">\"</span>$fecha<span style="color:#000099; font-weight:bold;">\"</span> /&gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$buffersize</span> = <a href="http://www.php.net/ob_get_length"><span style="color:#000066;">ob_get_length</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Content-Length: $buffersize"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Content-type: text/xml; charset=UTF-8'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/ob_end_flush"><span style="color:#000066;">ob_end_flush</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/mysql_close"><span style="color:#000066;">mysql_close</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$conexion</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>**Nota: Sí se copia y se pega el código debes de sustituir los datos de conexión de tu base de datos.</p>
<p>Sí se ha creado la base de datos correctamente al ejecutar este php deberíamos ver la estructura de la base de datos en xml. Evidentemente si no hay datos en la base de datos, no sé verán nodos aquí, a modo de pruebas se pueden insertar registros desde phpmyadmin.</p>
<p><strong>3.2.-Insercción de registros</strong></p>
<p>Para la insercción realizaremos un pequeño script en php que reciba las varibles necesarias via get, para después lanzar el script sql.</p>
<p>Un ejemplo de insercción podría ser:</p>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-9">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> libro_visitas <span style="color: #993333; font-weight: bold;">VALUES</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">''</span>, <span style="color: #ff0000;">'..sErGiO..'</span>, <span style="color: #ff0000;">'mi_email@mi_email.com'</span><span style="color: #ff0000;">', '</span>mi comentario<span style="color: #ff0000;">', NOW()); </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Este podría ser nuestro código para <span class="resaltar">insertar_comentario.php</span>:</p>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-10">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/ob_start"><span style="color:#000066;">ob_start</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Nos conectamos con la base de datos</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$conexion</span> = <a href="http://www.php.net/mysql_connect"><span style="color:#000066;">mysql_connect</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"host"</span>,<span style="color:#FF0000;">"usuario"</span>,<span style="color:#FF0000;">"contraseña"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">or <a href="http://www.php.net/die"><span style="color:#000066;">die</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'No pudo conectarse : '</span> . <a href="http://www.php.net/mysql_error"><span style="color:#000066;">mysql_error</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//echo 'Conexión exitosa';</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/mysql_select_db"><span style="color:#000066;">mysql_select_db</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"nombe_bd"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Recogemos las variables</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$id</span>=<span style="color:#0000FF;">$HTTP_GET_VARS</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'id'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$nombre</span>=<span style="color:#0000FF;">$HTTP_GET_VARS</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'nombre'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$email</span>=<span style="color:#0000FF;">$HTTP_GET_VARS</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'email'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mensaje</span>=<span style="color:#0000FF;">$HTTP_GET_VARS</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'mensaje'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Inicializamos una variable que servirá para controlar errores</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$error</span>=<span style="color:#CC66CC;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Pequeña validación</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$mensaje</span>==<span style="color:#FF0000;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$error</span>=<span style="color:#CC66CC;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$nombre</span>==<span style="color:#FF0000;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$nombre</span>=<span style="color:#FF0000;">'Anónimo'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Si todo esta correcto lanzamos el script de insercción</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$error</span>!=<span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sql</span> = <span style="color:#FF0000;">"INSERT INTO `libro_visitas` VALUES('', '"</span>.<span style="color:#0000FF;">$nombre</span>.<span style="color:#FF0000;">"', '"</span>.<span style="color:#0000FF;">$email</span>.<span style="color:#FF0000;">"', '"</span>.<span style="color:#0000FF;">$mensaje</span>.<span style="color:#FF0000;">"', NOW());"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$consulta</span> = <a href="http://www.php.net/mysql_query"><span style="color:#000066;">mysql_query</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$sql</span>,<span style="color:#0000FF;">$conexion</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$consulta</span>==<span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&amp;resultado=1'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&amp;resultado=0'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$buffersize</span> = <a href="http://www.php.net/ob_get_length"><span style="color:#000066;">ob_get_length</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Content-Length: $buffersize"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Content-type: text/xml; charset=UTF-8'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/ob_end_flush"><span style="color:#000066;">ob_end_flush</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/mysql_close"><span style="color:#000066;">mysql_close</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$conexion</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>**Nota: Sí se copia y se pega el código,  debes de sustituir los datos de conexión de tu base de datos.</p>
<p>Sí se quiere hacer una prueba para insertar un registro bastaría con poner en el navegador:<br />
<span class="resaltar">www.tudominio.com/</span>insertar_comentario.php?&#038;mensaje='mensaje%20de%20prueba'</p>
<p>Donde: <span class="resaltar">www.tudominio.com/</span> debe sustituirse por la dirección en donde tengas los archivos.</p>
<p>Sí esta pequeña prueba muestra resultado=1 la insercción se ha realizado correctamente, sino ha habido algún error.</p>
<p><strong>4.-Comunicación con Flash.</strong></p>
<p>Hasta el momento ya tenemos creada la base de datos y la comunicacón con ella para insertar y mostrar los datos. Ahora llega el momento de comunicar flash con los archivos php. Para ello utilizaremos el objeto LoadVars junto con sus respectivos métodos...</p>
<p>Para la lectura de los datos podríamos tener algo de este tipo:</p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-11">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> datos:<span style="color: #0066CC;">XML</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">datos = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">XML</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">datos.<span style="color: #0066CC;">ignoreWhite</span> = <span style="color: #000000; font-weight: bold;">true</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// cargo &quot;libro_xml.php?timer=&quot;+new Date().getTime()</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// para evitar problemas de cache</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">datos.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"obtener_datos.php?timer="</span>+<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Date</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">getTime</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">datos.<span style="color: #0066CC;">onLoad</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>success:<span style="color: #0066CC;">Boolean</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>success<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">caja_texto.<span style="color: #0066CC;">htmlText</span> = <span style="color: #ff0000;">"&lt;font color="</span><span style="color: #808080; font-style: italic;">#ff9900&quot;&gt;Cargando datos..&lt;/ font&gt;&quot;;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> comentarios_xml = <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">firstChild</span>.<span style="color: #0066CC;">childNodes</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> s_texto:<span style="color: #0066CC;">String</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i = <span style="color: #cc66cc;color:#800000;">0</span>; i&lt;comentarios_xml.<span style="color: #0066CC;">length</span>; i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> nombre = comentarios_xml<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">attributes</span>.<span style="color: #006600;">nombre</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> mensaje = comentarios_xml<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">attributes</span>.<span style="color: #006600;">mensaje</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> fecha = comentarios_xml<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">attributes</span>.<span style="color: #006600;">fecha</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> cad = <span style="color: #ff0000;">" "</span>+nombre+<span style="color: #ff0000;">" dice: &lt;font color="</span><span style="color: #808080; font-style: italic;">#cecece&quot;&gt;&quot;+mensaje+&quot;&lt;/ font&gt; &quot;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">s_texto += cad;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>comentarios_xml.<span style="color: #006600;">length</span>&lt;<span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">caja_texto.<span style="color: #0066CC;">htmlText</span> = <span style="color: #ff0000;">" &lt;font color="</span><span style="color: #808080; font-style: italic;">#ff9900&quot;&gt; No hay mensajes que mostrar &lt;/font&gt; &quot;;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">caja_texto.<span style="color: #0066CC;">htmlText</span> = s_texto;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">caja_texto.<span style="color: #0066CC;">htmlText</span> = <span style="color: #ff0000;">"Error en la carga de datos.."</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Y para la insercción algo así:</p>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-12">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> contenedor = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">LoadVars</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">contenedor.<span style="color: #0066CC;">onLoad</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>exito<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>exito<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">resultado</span> == <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">status_txt.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">"Enviado!!"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">status_txt.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">"Error!!"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">status_txt.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">"No Enviado!!"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cont_data.<span style="color: #006600;">nombre</span> = nombre;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cont_data.<span style="color: #006600;">mail</span> = email;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cont_data.<span style="color: #006600;">mensaje</span> = msg;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cont_data.<span style="color: #0066CC;">sendAndLoad</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"insertar_comentario.php"</span>, cont_data, <span style="color: #ff0000;">"get"</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Bueno espero que este tutorial os haya servido de algo.. me sigue sin gustar como ha quedado, pero cualquier duda o aclaración, mediante los comentarios trataré de resolveroslas.</p>
<p>Un saludo <img src='http://blog.sergioalvarez.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sergioalvarez.net/libro-de-visitas-flash-php-mysql/feed/</wfw:commentRss>
		<slash:comments>116</slash:comments>
		</item>
	</channel>
</rss>
