codice phpOriginariamente inviato da pezzo
cosa ti impedisce di passargli il valore? se ti va posta un po' di codice, sarà più facile aiutarti
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Stefano Tiberi-Pagina Personale</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name=keywords content=Barzellette, Stefano,Tiberi,risate, divertimento, allegria,Stefano Tiberi>
<meta name=description content= Barzellette>
<script language="JavaScript"> function MM_preloadImages() { var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}} function MM_swapImgRestore() { var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;} function MM_findObj(n, d) { var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);return x;} function MM_swapImage() { var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}} </script>
<script language="JavaScript" type="text/javascript">
function homepage() {
if(document.all)
document.body.style.behavior='url(#default#homepag e)';
document.body.setHomePage('http://barzellette.tiberistefano.altervista.org');
}
</script>
<script language="JavaScript" type="text/javascript">
function bookmarksite(title,url){
if (window.sidebar) window.sidebar.addPanel(title, url, "");
else if(document.all) window.external.AddFavorite(url, title);
}
</script>
</head>
<body>
<script type="text/javascript">var _Hasync= _Hasync|| []; _Hasync.push(['Histats.start', '1,1437659,4,0,0,0,00000000']); _Hasync.push(['Histats.fasi', '1']); _Hasync.push(['Histats.track_hits', '']); (function() { var hs = document.createElement('script'); hs.type = 'text/javascript'; hs.async = true; hs.src = ('http://s10.histats.com/js15_as.js'); (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(hs); })();</script> <noscript></noscript>
<?php
$connessione=mysql_connect("localhost", "tiberistefano", "");
$selezione_db=mysql_select_db("my_tiberistefano", $connessione);
?>
<?php
function modulo_guest(){ //attenzione all'apertura della parentesi graffa!
include("testata.htm");
?>
<table class="tabella_modulo2" border="0">
<form action="barzellette.php?azione=elabora" method="post" name="moduloGuest" id="moduloGuest" ">
<tr>
<FONT FACE="Arial Black" SIZE=2><P ALIGN="CENTER">Inserite la vostra barzelletta</P>
</tr>
<tr>
<td>Il tuo nome:</td><td><input type="text" name="nome_utente" id="nome_utente" size="30" maxlength="40" /></td>
</tr>
<tr>
<td>La tua email:</td><td><input type="text" name="email" id="email" size="30" maxlength="60" /></td>
</tr>
<tr>
<td>Il tuo sito:</td><td><input type="text" name="link" id="link" size="30" maxlength="60" /></td>
</tr>
<tr>
<td>La tua barzelletta:</td><td><textarea name="testo" id="testo" cols="60" rows="10"></textarea></td>
</tr>
<tr>
<td colspan="2"><P ALIGN="CENTER"><input type="submit" value="Invia" /><input type="reset" value="Cancella" /></P></td>
</tr>
</form>
</table>
<?php
include("piede.htm");
}// attenzione alla parentesi graffa di chiusura, }, che deve comprendere tutto, ovvero anche i normali tag html.
?>
<?php
function read_guest(){
include("testata.htm");
$lettura_risultati=mysql_query("select nome_utente, messaggio, date_format(data_ora, '%d/%m/%Y - %H:%i:%s') as data_formattata, link, email from barzellette order by data_ora desc")or(die(mysql_error()));
if(mysql_num_rows($lettura_risultati)>0){
echo "<table border \"1\">";
?>
<form action="barzellette.php?azione=leggi" method="post" name="moduloGuest" id="moduloGuest" ">";
<?php
$flag_colore=0;
while($temp=mysql_fetch_array($lettura_risultati)) {
$nome_utente=$temp['nome_utente'];
$testo_messaggio=$temp['messaggio'];
$data_inserimento=$temp['data_formattata'];
$link_messaggio=$temp['link'];
$email_messaggio=$temp['email'];
echo "<tr>";
if($flag_colore==0){
echo "<td bgcolor=\"#FFFF00\">";
}
else {
echo "<td bgcolor=\"#C0C0C0\">";
}
echo "$nome_utente
";
echo "$data_inserimento
";
echo "email: $email_messaggio
";
echo "link: <a href=\"$link_messaggio\">$link_messaggio</a>";
echo "</td>";
if($flag_colore==0){
echo "<td bgcolor=\"#FFFF00\" width=\"70%\">";
$flag_colore=1;
}
else {
echo "<td bgcolor=\"#C0C0C0\" width=\"70%\">";
$flag_colore=0;
}
echo "$testo_messaggio";
echo "</td>";
echo "</tr>";
} //fine ciclo while che scorre la query e piazza i risultati nell'array temporaneo
echo "</form>";
echo "</table>";
}
else{ //se non ha trovato record
echo "<table>";
echo "<tr>";
echo "<td>";
echo "<P ALIGN=\"CENTER\">";
echo "Barzelletta non trovata
";
echo "</P>";
echo "</td>";
echo "</tr>";
echo "</table>";
}
include("piede.htm");
}//fine function read_guest()
function elab_guest(){
$nome_utente_formattato=htmlspecialchars($_POST['nome_utente']);
$messaggio_formattato=htmlspecialchars($_POST['testo']);
$link_formattato=htmlspecialchars($_POST['link']);
$email_formattato=htmlspecialchars($_POST['email']);
$indirizzo_ip=$_SERVER['REMOTE_ADDR'];
$inserimento=mysql_query("insert into barzellette (nome_utente, messaggio, data_ora, link, email, ipaddr) values (\"$nome_utente_formattato\", \"$messaggio_formattato\", now(), \"$link_formattato\", \"$email_formattato\", \"$indirizzo_ip\")");
if($inserimento==true){
$mess="Barzellette: Utente $nome_utente_formattato\nEmail: $email_formattato\nUrl: $link_formattato\nIP: $indirizzo_ip\nMessaggio: $messaggio_formattato.\n";
mail("tiberistefano@altervista.org", "Invio email da: $nome_utente_formattato ($email_formattato)", $mess);
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'barzellette.php?azione=leggi';
header("Location: http://$host$uri/$extra");
}
else{
echo mysql_error();
}
}//fine function elab_guest()
$tipoazione = ( isset ( $_GET['azione'] ) ? $_GET['azione'] : "") ;
switch($tipoazione){
case "inserisci":
modulo_guest();
break;
case "elabora":
elab_guest();
break;
case "leggi":
read_guest();
break;
default: read_guest();
}//switch sulla variabile "azione" passata nella url
?>
</body>
</html>
codice menu
var linkList=[
[ 'javascript:homepage()' , 'IMG/home.gif' , '', 'Imposta come Homepage' ],
[ 'javascript:bookmarksite(\'Barzellette\',\'http://barzellette.tiberistefano.altervista.org/\')' , 'IMG/preferiti.gif' , '', 'Aggiungi ai Preferiti' ],
[ 'javascript:window.print()' , 'IMG/stampante.jpg' , '', 'Stampa pagina...' ],
[ 'barzellette.php?azione=inserisci' , 'IMG/scrivi.jpg' , '', 'Inserisci' ],
[ 'barzellette.php?azione=indietro' , 'IMG/sx.jpg' , '', 'Indietro' ],
[ 'barzellette.php?azione=avanti' , 'IMG/dx.jpg' , '', 'Avanti' ],
[ 'barzellette.php?azione=leggi' , 'IMG/refresh.png' , '', 'Ricarica pagina' ],
[ 'index.html' , 'IMG/info.gif' , '', 'Informazioni su questo sito' ]
]
.....