Ciao a tutti vi sarei grata in un piccolo aiuto^^ premetto che non sono molto pratica con il php ma seguendo un po' di tutorial sono riuscita a realizzare un guestbook, ora mi piacerebbe mettere degli smile, anche qui seguendo dei tutorial ho capito come mettere gli smile nella textarea del form dove si scrive il commento e funziona perchè il testo cioè il nome della faccina viene inserito, però non riesco a far visualizzare gli smile in immagini ovvero rimane il testo....
Il guest è composto da 3 file, config - insert e view
ecco il codice x il view del guest
Ovviamente c'è anche una directory che contiene gli smile,Codice:<head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Mex</title> <link rel="stylesheet" href="stile.css"type="text/css"> <script language="javascript"> <!-- function Smile(quale_faccina) { document.insert.message.value += quale_faccina; } //--> </script> </head> <body> <html> <div align="center"> <table style='text-align:center;font-family:Palatino Linotype; font-size: 8pt; color: #222812'cellpadding='0' cellspacing='0' border='0' width='620'> <tr> <td> <img border='0' src='images/titolocommenti.png' width='255' height='56'> <table class='t1' cellspacing='0' cellpadding='0' width='500'> <tr> <td><img border='0' src='images/scrivi.png' width='133' height='104'></td> <td>Spero ti sia piaciuto il telaio e abbia trovato qualcosa di utile... <img border='0' src='images/fiorellino.gif' width='25' height='25'><br> lasciami un salutino, linka il tuo spazio, ricambierò con piacere la visita^^<br> Se hai un consiglio, un credits da richiedere o... una critica scrivimi qui <br> mi aiuterai a rendere questo spazio migliore<br> Ciao Penelope <img border="0" src="images/gattopenny.gif" width="17" height="15"></td> </tr> </table> <table border='0' cellspacing='0' cellpadding='0' width='500'> <tr> <td width='36'></td> <td width="232"><?php include("totcommenti.php"); ?></td> <td> </td> </tr> </table> <table class='t1' cellpadding='0' cellspacing='0' width='550'> <tr> <td><form name='insert' method='post' ACTION='insert.php'> <table class='t2' cellpadding='0' cellspacing='0' width='98%'> <tr> <td width='111' align='right'> </td> <td><input style='display:none' name='antispam' type='text' id='antispam' value='cinque-sette-otto-uno'></td> </tr> <tr> <td width='111' align='right'> <img border='0' src='images/guest.png' width='10' height='10'> <b>Nikname:</b></td> <td> <input class='a1' type='text' name='nome' maxlength='20' size='70'></td> </tr> <tr> <td width='111' align='right'> <img border='0' src='images/home.png' width='10' height='10'> <b>Site URL:</b></td> <td> <input class='a1' type='text' name='www' maxlength='50' size='70' value='http://'></td> </tr> <tr> <td width='111' align='right'> <img border='0' src='images/email.png' width='10' height='10'> <b>E-mail:</b></td> <td> <input class='a1' type='text' name='email' maxlength='20' size='70'></td> </tr> <tr> <td width='111'> </td> <td> <table class='t2' cellpadding='0' cellspacing='0' width='429'> <tr> <td width='142'> <img border='0' src='images/penna.gif' width='20' height='20'> <b>Commento...</b></td> <td width='142'> </td> <td width='143'></td> </tr> </table> </td> </tr> <tr> <td width='111' align='center'> Puoi pubblicizzare<br> il tuo spazio<br> scrivi le tue iniziative e news varie! <img border='0' src='images/orzetti.gif' width='104' height='164'> </td> <td> <textarea class='c1' name='message' rows='14' cols='73'></textarea></td> </tr> <tr> <td width='111'></td> <td><input type='submit' value='..:: Invia commento ::.. ' name='ok'></td> </tr> </table></form> <a href="javascript:Smile('clap')"><img src="smilies/clap.gif" WIDTH=31 HEIGHT=25 border="0"></a> <a href="javascript:Smile('cool')"><img src="smilies/cool.gif" WIDTH=20 HEIGHT=20 border="0"></a> <a href="javascript:Smile('crybaby')"><img src="smilies/crybaby.gif" WIDTH=40 HEIGHT=18 border="0"></a> <a href="javascript:Smile('dry')"><img src="smilies/dry.gif" WIDTH=20 HEIGHT=20 border="0"></a> </td> </tr> </table> <?php include "config.php"; $db = mysql_connect($db_host,$db_user,$db_pass); mysql_select_db ($db_name) or die ("Cannot connect to database"); // selezione del DB mysql_select_db("Sql288738_1") or die("Selezione del DB fallita !"); $page = (!isset($_GET['page']))? 1 : $_GET['page']; $prev = ($page - 1); $next = ($page + 1); /*Setto il numero massimo di record per pagina */ $max_results = 10; /* Mi calcolo l'offset */ $from = (($page * $max_results) - $max_results); /*eseguo la query per recuperare il numero di dati presente nel mio db*/ $result = mysql_query("select * FROM dati ORDER BY id Desc"); $total_results = mysql_num_rows($result); $total_pages = ceil($total_results / $max_results); /* Creo il link "PREV" */ if($page > 1) { $pagination .="<a href=view.php?page=".$prev.">Prec </a>"; } /*Eseguo il ciclo per visualizzare tutte le pagine che mi servono. */ for($i =1; $i <= $total_pages; $i++) { if(($page) == $i) { $pagination .= $i; } else { $pagination .= "<a href=view.php?page=".$i.">| $i </a>|"; } }/*END FOR*/ /* Stampo il prossimo link */ if($page < $total_pages) { $pagination .= "<a href=view.php?page=".$next."> Next</a>"; } $result=mysql_query("select * FROM dati ORDER BY id Desc LIMIT $from, $max_results "); while ($i = mysql_fetch_array($result)) /* Visualizza commenti */ /*eseguo la query con i parametri $from e $total_results per la paginazione*/ echo "<table border=0 width=550> <tr> <td> <table style='border:1px dotted #373e24' cellpadding='2px' cellspacing='2px' width=550> <tr> <td class=row4> <table border='0' cellpadding='0px' cellspacing='0px' width='100%'> <tr> <td style='font-family:Palatino Linotype; font-size: 8pt; color: #47502c' height='10'><IMG SRC='images/denden02r.gif' WIDTH='250' HEIGHT='12' BORDER=0></td> <td style='font-family:Palatino Linotype; font-size: 8pt; color: #47502c' height='10' width='139'>Scritto il ".$i["data"]."</td> </tr> </table> </td> </tr> <tr> <td style='font-family:Palatino Linotype; font-size: 8pt; color: #47502c' class=row1><a href='".$i["www"]."' target=_blank><img border='0' src='images/home.png' width='10' height='10' alt='My homepage'></a> <a href='mailto:".$i["email"]."'><img border='0' src='images/email.png' width='10' height='10' alt='E-mail'></a> <b>« ".$i["nome"]." »</b></td> </tr> <tr> <td style='font-family:Palatino Linotype; font-size: 8pt; color: #47502c' class=row4><b>Commento...</b> <img border='0' src='images/katam-yd.gif' width='15' height='10'><br> ".$i["message"]." </td> </tr> </table> <table border=0 width=100%> <tr> <td height=3></td> </tr> </table> </td> </tr> </table>"; echo "<table class='t1' width='550'> <tr> <td align=left> <img border='0' src='images/m3.gif' width='11' height='13'> Page... $pagination</td> <td align=right width='153'> <img border='0' src='images/bouncingstar2cammina.gif' width='39' height='8'><a target='penelope' href='http://pennypenny.altervista.org/accessorisito/commenti.html'>[Vecchi Commenti]</a></td> </tr> </table>"; ?> <br><br> Grazie della visita un abbraccione Penelope<br> <a target="penelope" href="http://www.iltelaiodipenelope.it/frame.htm">Home</a><img src='images/canuccio2.gif' width='63' height='31'><br><br> </td> </tr> </table> </div> </body> </html>
e questo dovrebbe essere il codice che ne permette la visualizzazione
....non riesco a capire come integrarlo al resto del codice affinchè funzioniCodice:function faccine($message){ $message = str_replace('[clap]','<img src="smilies/clap.gif">',$message); $message = str_replace('[cool]','<img src="smilies/cool.gif">',$message); $message = str_replace('[crybaby]','<img src="smilies/crybaby.gif">',$message); $message = str_replace('[dry]','<img src="smilies/dry.gif">',$message); return $message_ok; } echo faccine($_POST['message']);
spero possiate aiutarmi
grazie

LinkBack URL
About LinkBacks

