PHP Classes

File: prueba_smilies.php

Recommend this page to a friend!
  Classes of Tonacho   Tona Smileys   prueba_smilies.php   Download  
File: prueba_smilies.php
Role: Example script
Content type: text/plain
Description: An Example
Class: Tona Smileys
Replaces smiley tags with images defined in MySQL
Author: By
Last change:
Date: 20 years ago
Size: 684 bytes
 

Contents

Class file image Download
<?
/***********
* Prueba de smilies
* */
require_once ("cl_smiley.php");

$conexion = mysql_connect("localhost","username","password"); //Open new bd conection

$icon = new smiley();
$ruta = "./smileys/";
$icon->set_ruta_smilie($ruta);
$cadena = "Esto es una cadena con unos =) cuantos<br>
            Smileys ahora otro más :webos a ver si chuta"
;
echo
$icon->insertasmiley($cadena);
echo
"<br><br>";
$todos = $icon->getsmiley();
echo
"<table border=1>\n\t";
for(
$i = 0; $i < sizeof($todos); $i++) {
    echo
"<tr>\n\t\t<td>" . $todos[$i][1] . "</td><td><img src=\"".$ruta . $todos[$i][2] . "\" alt=\"".$todos[$i][3]."\"></td>\n\t</tr>";
}
echo
"</table>\n";





?>