Finalmente ho risolto.
Il problema stava nel database, è la prima volta che mi succede una cosa del genere, in pratica creando la tabella gestore come cliccavo per aprirla mi si disconnetteva.
ho dovuto cambiare nome alla tabella e tutto è andato.
sulweb
@sulweb
Post creati da sulweb
- 
    RE: [Tutorial] Area privatapostato in Coding
- 
    RE: [Tutorial] Area privatapostato in CodingNon capisco! Domani a mente fresca rifaccio tutto da capo. 
 Ti ringrazio di tutto l'aiuto che mi hai dato e scusami se son stato un rompi.
 Faccio sapere!
- 
    RE: [Tutorial] Area privatapostato in CodingProvo, ma hanno lo stesso collegamento al db. Ho fatto una prova per vedere se magari c'èra un errore in uno dei due: 
- 
    RE: [Tutorial] Area privatapostato in CodingQuesto il codice per la registrazione: 
 [PHP]<?php
 // Includo la connessione al database
 require('config1.php');// Se il modulo viene inviato... 
 if(isset($_POST['registra']))
 {// Dati Inviati dal modulo 
 $user = (isset($_POST['user'])) ? trim($_POST['user']) : ''; // Metto nella variabile 'user' il dato inviato dal modulo, se non viene inviato dò di default ''
 $pass = (isset($_POST['pass'])) ? trim($_POST['pass']) : ''; // Metto nella variabile 'pass' il dato inviato dal modulo, se non viene inviato dò di default ''
 $mail = (isset($_POST['mail'])) ? trim($_POST['mail']) : ''; // Metto nella variabile 'mail' il dato inviato dal modulo, se non viene inviato dò di default ''// Filtro i dati inviati se i magic_quotes del server sono disabilitati per motivi di sicurezza 
 if (!get_magic_quotes_gpc()) {
 $user = addslashes($user);
 $pass = addslashes($pass);
 $mail = addslashes($mail);
 }// Controllo il Nome Utente 
 if(strlen($user) < 4 || strlen($user) > 12)
 die('Nome Utente troppo corto, o troppo lungo');
 // Controllo la Password
 elseif(strlen($pass) < 4 || strlen($pass) > 12)
 die('Password troppo corta, o troppo lunga');
 // Controllo l'email
 elseif(!eregi("^[a-z0-9][_.a-z0-9-]+@([a-z0-9][0-9a-z-]+.)+([a-z]{2,4})", $mail))
 die('Email non valida');
 // Controllo il nome utente non sia già occupato
 elseif(mysql_num_rows(mysql_query("SELECT user FROM gestore WHERE user = '$user' LIMIT 1")) == 1)
 die('Nome Utente non disponibile');
 // Controllo l'indirizzo email non sia già registrato
 elseif(mysql_num_rows(mysql_query("SELECT mail FROM gestore WHERE mail = '$mail' LIMIT 1")) == 1)
 die('Questo indirizzo email risulta già registrato ad un altro utente');
 // Registrazione dell'utente nel database
 else
 {// Crypt della password per garantire una miglior sicurezza 
 $pass = md5($pass);// Query per l'inserimento dell'utente nel database 
 $strSQL = "INSERT INTO gestore (user,pass,mail)";
 $strSQL .= "VALUES('$user', '$pass', '$mail')";
 mysql_query($strSQL) OR die("Errore 003, contattare l'amministratore ".mysql_error());// Reindirizzo l'utente ad una pagina di conferma della registrazione 
 header('Location: registrato.php');
 exit;
 }
 }
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "://.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="://.w3./1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>Registrazione</title>
 </head>
 <body>
 <form action="" method="post">
 <input name="user" type="text" id="user" value="Nome Utente" onfocus="if(this.value=='Nome Utente') this.value='';" /><br />
 <input name="pass" type="password" id="pass" value="Password" onfocus="if(this.value=='Password') this.value='';" /><br />
 <input name="mail" type="text" id="mail" value="Emil" onfocus="if(this.value=='Emil') this.value='';" /><br />
 <input name="registra" type="submit" value="Registrati" /><br />
 </form>
 </body>
 </html>[/PHP]
- 
    RE: [Tutorial] Area privatapostato in CodingQuesto l'errore: No database selected. 
 Non capisco la registrazione è andata bene, il login no!
- 
    RE: [Tutorial] Area privatapostato in CodingNel codice ho modificato solo il collegamento alla tabella. 
 Questo il codice:
 [PHP]<?php
 // Includo la connessione al database
 require('config.php');// Se il modulo viene inviato... 
 if(isset($_POST['login']))
 {// Dati Inviati dal modulo 
 $user = (isset($_POST['user'])) ? trim($_POST['user']) : ''; // Metto nella variabile 'user' il dato inviato dal modulo, se non viene inviato dò di default ''
 $pass = (isset($_POST['pass'])) ? trim($_POST['pass']) : ''; // Metto nella variabile 'pass' il dato inviato dal modulo, se non viene inviato dò di default ''// Filtro i dati inviati se i magic_quotes del server sono disabilitati per motivi di sicurezza 
 if (!get_magic_quotes_gpc()) {
 $user = addslashes($user);
 $pass = addslashes($pass);
 }// Crypto la password e la confronto con quella nel database 
 $pass = md5($pass);// Controllo l'utente esiste 
 $query = mysql_query("SELECT id FROM gestore WHERE user = '$user' AND pass = '$pass' LIMIT 1");// Se ha trovato un record 
 if(mysql_num_rows($query) == 1)
 {
 // prelevo l'id dal database
 $login = mysql_fetch_array($query);// Creo una variabile di sessione 
 $_SESSION['login'] = $login['id'];// reindirizzo l'utente 
 header('Location: privata.php');
 exit;
 }
 // se non esiste da l'errore
 else
 die('Nome Utente o Password errati');
 }
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ".w3./TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="..o*/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>Login</title>
 </head>
 <body>
 <form action="" method="post">
 <input name="user" type="text" id="user" value="Nome Utente" onfocus="if(this.value=='Nome Utente') this.value='';" /><br />
 <input name="pass" type="password" id="pass" value="Password" onfocus="if(this.value=='Password') this.value='';" /><br />
 <input name="login" type="submit" value="Login" /><br />
 </form>
 </body>
 </html>[/PHP]
- 
    RE: [Tutorial] Area privatapostato in CodingFinalmente sono riuscito a capire il problema, mettevo una password di 4 caratteri e non mi segnalava che inserivo un numero inferiori di caratteri richiesti. Adesso ho un'altro problema con il login, l'errore che ricevo è: 
 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/web/../www/admin/login.php on line 27
 Nome Utente o Password errati
- 
    RE: [Tutorial] Area privatapostato in CodingHo già controllato diverse volte, proprio per questo mi sto rivolgendo qui. [PHP]<?php 
 session_start();
 $db_host = 'localhost';
 $db_utente = 'user accesso db';
 $db_password = 'lpassword accesso db';
 $db_nomedb = 'nome db';
 $dbh=mysql_connect ($db_host, $db_utente, $db_password) or die ('Errore nella stringa di connessione al database: '.mysql_error());
 mysql_select_db($db_nomedb);
 ?>[/PHP]con questa stesso script faccio funzionare altre pagine e tutto va bene, solo con questo ho problemi. 
- 
    RE: [Tutorial] Area privatapostato in CodingCiao ragazzi, non so più cosa fare. 
 Ho scaricato lo script login e quando tento di la registrazione mi da i seguenti errori.Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/web/../www/admin/registrati.php* on line 33 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/web/../www/admin/registrati.php* on line 36 
 Errore 003, contattare l'amministratore No database selected
- 
    RE: Scorrimento Immaginipostato in CodingE' diversa perchè ho dovuto togliere http per inviare il post, io non sono autorizzato ad inviare link e questo lo prende come un link. 
- 
    RE: Scorrimento Immaginipostato in CodingIl sito lo sto provando il locale e come errore mi da 
 Dettagli errore pagina Web
 Agente utente: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
 Timestamp: Thu, 10 Dec 2009 13:50:05 UTCMessaggio: Proprietà o metodo non supportati dall'oggetto 
 Linea: 32
 Carattere: 25
 Codice: 0il codice che utilizzo è questo 
 errore che mi da si trova nella parentesi gaffafunction() 
 {
 $("#viewer").removeClass("js-disabled");[html] 
 <?php
 $lentezza=4000;
 $da_destra_a_sinistra="rtl";
 $da_sinistra_a_destra="ltr";
 $direzione_iniziale=$da_destra_a_sinistra;
 $directory_delle_immagini="logos";
 function getFileFromCartella($path)
 {
 $stringa_immagini="";
 $dir_handle=@opendir($path);
 $indicetemp=1;
 while($file=readdir($dir_handle))
 {
 if($file!="." && $file!="..")
 {
 $stringa_immagini=$stringa_immagini."<a class="wrapper" href="#" title="Immagine$indicetemp"><img class="logo" id="immagine$indicetemp" src="".$path."/".$file. "" alt="immagine$indicetemp"></a>".chr(10);
 $indicetemp=$indicetemp+1;
 }
 }
 closedir($dir_handle);
 return $stringa_immagini;
 }
 ?>
 <head>
 <link rel="stylesheet" type="text/css" href="imageScroller.css">
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title>imageScroller Image Carousel</title>
 <script type="text/javascript" src="jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>
 <script type="text/javascript">
 $(
 function()
 {
 $("#viewer").removeClass("js-disabled");
 $("<div>").attr("id", "container").css({ position:"absolute"}).width($(".wrapper").length * 170).height(170).appendTo("div#viewer");
 $(".wrapper").each
 (
 function()
 {
 $(this).appendTo("div#container");
 }
 );
 var duration = $(".wrapper").length * <?php echo $lentezza?>;
 var speed = (parseInt($("div#container").width()) + parseInt($("div#viewer").width())) / duration;
 var direction = "<?php echo $direzione_iniziale?>";
 (direction == "rtl") ? $("div#container").css("left", $("div#viewer").width()).addClass("rtl") : $("div#container").css("left", 0 - $("div#container").width()).addClass("ltr") ;
 var animator = function(el, time, dir)
 {
 if(dir == "rtl")
 {
 el.removeClass("ltr").addClass("rtl");
 el.animate
 (
 { left:"-" + el.width() + "px" }, time, "linear", function()
 {
 $(this).css({ left:$("div#imageScroller").width(), right:"" });
 animator($(this), duration, "rtl");
 ($("div#controls").length > 0) ? $("div#controls").slideUp("slow").remove() : null ;
 }
 );
 }
 else
 {
 el.removeClass("rtl").addClass("ltr");
 el.animate
 (
 { left:$("div#viewer").width() + "px" }, time, "linear", function()
 {
 $(this).css({ left:0 - $("div#container").width() });
 animator($(this), duration, "ltr");
 ($("div#controls").length > 0) ? $("div#controls").slideUp("slow").remove() : null ;
 }
 );
 }
 }
 animator($("div#container"), duration, direction);
 $("a.wrapper").live
 (
 "mouseover", function()
 {
 $("div#container").stop(true);
 ($("div#controls").length == 0) ? $("<div>").attr("id", "controls").appendTo("div#outerContainer").css({ opacity:0.7 }).slideDown("slow") : null ;
 ($("a#rtl").length == 0) ? $("<a>").attr({ id:"rtl", href:"#", title:"rtl" }).appendTo("#controls") : null ;
 ($("a#ltr").length == 0) ? $("<a>").attr({ id:"ltr", href:"#", title:"ltr" }).appendTo("#controls") : null ;
 var title = $(this).attr("title");
 ($("p#title").length == 0) ? $("<p>").attr("id", "title").text(title).appendTo("div#controls") : $("p#title").text(title) ;
 }
 );
 $("a.wrapper").live
 (
 "mouseout", function(e)
 {
 (e.relatedTarget == null) ? null : (e.relatedTarget.id != "controls") ? $("div#controls").slideUp("slow").remove() : null ;
 var totalDistance = parseInt($("div#container").width()) + parseInt($("div#viewer").width());
 var distanceLeft = ($("div#container").hasClass("ltr")) ? totalDistance - (parseInt($("div#container").css("left")) + parseInt($("div#container").width())) : totalDistance - (parseInt($("div#viewer").width()) - (parseInt($("div#container").css("left")))) ;
 var newDuration = distanceLeft / speed;
 animator($("div#container"), newDuration, $("div#container").attr("class"));
 }
 );
 $("#ltr").live
 (
 "click", function()
 {
 $("div#container").stop(true);
 $("div#container").removeClass("rtl").addClass("ltr");
 var totalDistance = parseInt($("div#container").width()) + parseInt($("div#viewer").width());
 var distanceLeft = totalDistance - (parseInt($("div#container").css("left")) + parseInt($("div#container").width()));
 var newDuration = distanceLeft / speed;
 animator($("div#container"), newDuration, "ltr");
 }
 );
 $("#rtl").live
 (
 "click", function()
 {
 $("div#container").stop(true);
 $("div#container").removeClass("ltr").addClass("rtl");
 var totalDistance = parseInt($("div#container").width()) + parseInt($("div#viewer").width());
 var distanceLeft = totalDistance - (parseInt($("div#viewer").width()) - (parseInt($("div#container").css("left"))));
 var newDuration = distanceLeft / speed;
 animator($("div#container"), newDuration, "rtl");
 }
 );
 }
 );
 </script>
 <script language="JavaScript" type="text/javascript">
 <!-- Begin
 var message = new Array();
 // Set your messages you want typed into the title bar below.
 // To add more messages, just add more elements to the array.
 message[0] = "Benvenuti";
 message[1] = "real_unione";
 message[2] = "Sito Ufficiale della squadra di calcio Real Unione";
 message[3] = "tutto sul campionato F.I.G.C - L.N.D Prima Categoria ...";
 message[4] = "risultati, cronache degli incontri...";
 message[5] = "curiosità, news e tanto altro...";// Set the number of repetitions (how many times a given message is typed out 
 // before moving onto the next message).
 var reps = 1;
 var speed = 200;// Set the overall typing speed (larger number = slower action).
 var hold = 8 // set the length of time to display the whole phrase before retyping (larger number = longer)// DO NOT EDIT BELOW THIS LINE. 
 var p = message.length;
 var q = 0;
 var r = 0;
 var C = 0;
 var mC = 0;
 var s = 0;
 var sT = null;if (reps < 1) { 
 reps = 1;
 }
 function setMessage() {
 typing = message;
 q = typing.length;
 r = q + hold;
 typeMessage();
 }
 function typeMessage() {
 if (s > r) {
 s = 0;
 }
 if (s > q) {
 document.title = '|- '+ typing +' - - -';
 }
 else {
 document.title = '|- '+ typing.substr(0,s)+' - - -';
 }
 if (C < (r * reps)) {
 sT = setTimeout("typeMessage()", speed);
 C++;
 s++;
 }
 else {
 C = 0;
 s = 0;
 mC++;
 if(mC > p - 1) {mC = 0;}
 sT = null;
 setMessage();
 }
 }
 setMessage();
 // End -->
 </script>
 <style type="text/css">
 <!--
 body {
 background-color: #425194;
 }
 .Stile1 {
 color: #29166F;
 font-size: 14px;
 font-weight: bold; ;
 }
 .Stile2 {
 color: #FFFFFF;
 font-size: 15px;
 font-weight: bold;
 }
 }
 .Stile4 {
 color:;
 font-size: 18px;
 font-weight: bold;
 }
 .Stile7 {font-size: 24px;color:;}
 #Layer1 {
 position:absolute;
 left:172px;
 top:392px;
 width:79px;
 height:100px;
 z-index:1;
 }
 div#news_box{width: 250px; height: 150px; border-color: #CC0202;border-width: 1px; border-style: solid; }
 div#news_top{text-align: center; border-style: solid; border-color:;border-width: 0px 0px 1px 0px;}
 img{border:0;margin:0px;}
 </style></head> 
 <body>
 <table width="897" border="8" align="center" cellpadding="5" bordercolor="#29166F" bgcolor="#FFFFFF">
 <tr>
 <td><img src="image/logo_usdreal2.png" alt="logo asd real unuone" />
 <?php require("menu.php"); ?>
 <img src="image/k34.gif" alt="barra" width="100%" height="13" />
 <table width="100%" border="0">
 <tr bgcolor="#D9DAEC">
 <th scope="col"><marquee> <div align="right"> <span class="Stile4">*A.S.D. REAL UNIONE* Campionato Regionale di Calcio 2009/2010 - Sicilia - I^ Categoria girone H</span> </marquee> </th></tr> 
 </table>
 <img src="image/k34.gif" alt="barra" width="100%" height="13" /><table width="660" border="1" align="center" cellpadding="0" bordercolor="#29166F"> 
 <tr>
 <td width="731"><div align="center"><img src="image/regionesiciliana.png" alt="regione" width="135" height="95" hspace="23" /> <img src="image/unione_comuni.png" alt="Unione Comuni Alto Verdura e Gebbia" width="150" height="150" hspace="55" /><img src="image/pr_reg_ag.png" alt="provincia agrigento" width="194" height="100" hspace="0" /></div></td>
 </tr>
 </table>
 <table width="531" border="0" align="center" cellpadding="0">
 <tr>
 <td width="81" align="left" valign="top"><img src="image/FIGC.jpg" width="81" height="91" align="top" /></td>
 <td width="360" align="center" valign="top"><span class="Stile4">Federazione Italiana Giuoco Calcio <br />
 Lega Nazionale Dilettanti <br />
 COMITATO REGIONALE SICILIA <br />
 Campionato di Prima Categoria Girone H</span></td>
 <td width="82" align="left" valign="top"><span class="Stile4"><img src="image/stadio.png" alt="lnd" width="82" height="91" /></span></td>
 </tr>
 </table>
 <table width="85%" border="0" align="center" cellpadding="0">
 <tr>
 <td align="center" valign="top"><div align="center">
 <br /><img src="image/asd_real_unione_news.png" width="134" height="16" alt="asd real unione news" /><br /><iframe src="news/include.php" style="border:0px;" width="250" height="130" scrolling="auto"> </iframe></div></td>
 <td align="center" valign="top"><div align="center"><br /><a href="newcalcio.org/" title="pronostici calcio"><img src="newcalcio.org/pronostici/news.png" /></a><br /><iframe src="newcalcio.org/iframe.php?news=10" style="border:0px;" width="250" height="130" scrolling="auto">
 </iframe></div></td>
 </tr>
 </table>
 <img src="image/k34.gif" alt="barra" width="100%" height="13" /><br />
 <table width="100%" border="0" cellpadding="0">
 <tr>
 <td width="51%" align="left" valign="top"><table height="178" border="0" cellpadding="0">
 <tr>
 <td width="444" align="left" valign="top"><div align="center"><a href="img/squadra.jpg"><img src="admin/uploads/squadra.jpg" alt="squadra" width="444" height="173" border="0" align="top"></a></div></td>
 </tr>
 </table>
 <table width="99%" border="0" cellpadding="0">
 <tr>
 <td width="48%" align="left" valign="top"><p align="center" class="Stile7"><img src="admin/uploads/stadio.gif" alt="stadio" width="211" height="324" /></p> </td>
 <td width="52%" align="left" valign="top">
 <table width="100%" border="1" cellpadding="0" cellspacing="2" bordercolor="#000066">
 <tr style="background-color: #000066;">
 <th align="center" valign="middle"><span class="Stile2">Classifica</span></th>
 <td><div align="center"><img src="image/pallone.gif" alt="pallone" /></div></td>
 </tr>
 <?php
 include('config.inc.php');
 $sql = "SELECT * FROM squadre ORDER BY pt DESC;";
 $result = mysql_query ($sql,$link);
 $num=mysql_num_rows($result);
 $i=0;
 while($i<$num)
 {
 $nomesquadra=mysql_result($result, $i, "nomesquadra");
 $pt=mysql_result($result, $i, "pt");
 if(($i%2)==0) $colore="#E1E1E1";
 else $colore="#F1F1F1";
 echo " <tr style="background-color: $colore;">\n"
 ." <td><span class="Stile1">$nomesquadra</span></td>\n"
 ." <td><div align="center"><span class="Stile1">$pt</span></div></td>\n"
 ." </tr>\n";
 $i++;
 }
 ?>
 <!? chiudiamo la tabella aperta all?inizio dello script ?>
 </table> </td>
 </tr>
 </table> </td>
 <td width="49%" align="left" valign="top"><div align="center">
 <img src="image/risultati.png" alt="risultati" width="276" height="58" />
 <?php require("risultato.php"); ?>
 <br />
 </div>
 <div align="center"><img src="image/prossimoturno.png" alt="prossimo turno" width="320" height="60" /> </div>
 <?php require("prossimo_turno.php"); ?></td>
 </tr>
 </table><div id="outerContainer"> <div id="imageScroller"> <div id="viewer" class="js-disabled"> <?php echo getFileFromCartella($directory_delle_immagini) ?> </div></div> 
 </div> </td>
 </tr>
 </table>
 </body>
 </html>[/html]
- 
    RE: Scorrimento Immaginipostato in CodingCiao Marco, sei un grande! 
 Funziona benissimo, ho solo il problema nell'inserirlo nella home.
 secondo me il problema è dovuto alla presenta altri script.
- 
    RE: Scorrimento Immaginipostato in CodingHo fatto in questo modo ma ricevo un errore 'stack overflow at line: 12' proprio dove c'è <?php sinceramente non so come venirne a capo. Questo il codice: 
 [html]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "w3.org/TR/html4/strict.dtd">
 <html>
 <head>
 <link rel="stylesheet" type="text/css" href="imageScroller.css">
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title>imageScroller Image Carousel</title>
 </head>
 <body>
 <div id="outerContainer">
 <div id="imageScroller">
 <div id="viewer" class="js-disabled">
 <?php
 function dir_list($directory = FALSE)
 {
 $dirs= array();
 $files = array();
 if ($handle = opendir("./" . $directory))
 {
 while ($file = readdir($handle))
 {
 if (is_dir("./{$directory}/{$file}"))
 {
 if ($file != "." & $file != "..") $dirs[] = $file;
 }
 else
 {
 if ($file != "." & $file != "..") $files[] = $file;
 }
 }
 }
 closedir($handle);
 reset($dirs);
 sort($dirs);
 reset($dirs);
 reset($files);
 sort($files);
 reset($files);while(list($key, $value) = each($dirs)) 
 {
 $d++;
 echo "<td><img src="{$value}"></td>";
 }
 echo "</ul>\n";
 while(list($key, $value) = each($files))
 {
 echo "<td><img src="{$directory}{$value}"></td>";
 }
 echo "</ul>";} 
 dir_list("../img/");
 ?>
 </div>
 </div>
 </div>
 <script type="text/javascript" src="jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>
 <script type="text/javascript">
 $(function() {//remove js-disabled class $("#viewer").removeClass("js-disabled"); //create new container for images $("<div>").attr("id", "container").css({ position:"absolute"}).width($(".wrapper").length * 170).height(170).appendTo("div#viewer"); //add images to container $(".wrapper").each(function() { $(this).appendTo("div#container"); }); //work out duration of anim based on number of images (1 second for each image) var duration = $(".wrapper").length * 1000; //store speed for later (distance / time) var speed = (parseInt($("div#container").width()) + parseInt($("div#viewer").width())) / duration; //set direction var direction = "rtl"; //set initial position and class based on direction (direction == "rtl") ? $("div#container").css("left", $("div#viewer").width()).addClass("rtl") : $("div#container").css("left", 0 - $("div#container").width()).addClass("ltr") ; //animator function var animator = function(el, time, dir) { //which direction to scroll if(dir == "rtl") { //add direction class el.removeClass("ltr").addClass("rtl"); //animate the el el.animate({ left:"-" + el.width() + "px" }, time, "linear", function() { //reset container position $(this).css({ left:$("div#imageScroller").width(), right:"" }); //restart animation animator($(this), duration, "rtl"); //hide controls if visible ($("div#controls").length > 0) ? $("div#controls").slideUp("slow").remove() : null ; }); } else { //add direction class el.removeClass("rtl").addClass("ltr"); //animate the el el.animate({ left:$("div#viewer").width() + "px" }, time, "linear", function() { //reset container position $(this).css({ left:0 - $("div#container").width() }); //restart animation animator($(this), duration, "ltr"); //hide controls if visible ($("div#controls").length > 0) ? $("div#controls").slideUp("slow").remove() : null ; }); } } //start anim animator($("div#container"), duration, direction); //pause on mouseover $("a.wrapper").live("mouseover", function() { //stop anim $("div#container").stop(true); //show controls ($("div#controls").length == 0) ? $("<div>").attr("id", "controls").appendTo("div#outerContainer").css({ opacity:0.7 }).slideDown("slow") : null ; ($("a#rtl").length == 0) ? $("<a>").attr({ id:"rtl", href:"#", title:"rtl" }).appendTo("#controls") : null ; ($("a#ltr").length == 0) ? $("<a>").attr({ id:"ltr", href:"#", title:"ltr" }).appendTo("#controls") : null ; //variable to hold trigger element var title = $(this).attr("title"); //add p if doesn't exist, update it if it does ($("p#title").length == 0) ? $("<p>").attr("id", "title").text(title).appendTo("div#controls") : $("p#title").text(title) ; }); //restart on mouseout $("a.wrapper").live("mouseout", function(e) { //hide controls if not hovering on them (e.relatedTarget == null) ? null : (e.relatedTarget.id != "controls") ? $("div#controls").slideUp("slow").remove() : null ; //work out total travel distance var totalDistance = parseInt($("div#container").width()) + parseInt($("div#viewer").width()); //work out distance left to travel var distanceLeft = ($("div#container").hasClass("ltr")) ? totalDistance - (parseInt($("div#container").css("left")) + parseInt($("div#container").width())) : totalDistance - (parseInt($("div#viewer").width()) - (parseInt($("div#container").css("left")))) ; //new duration is distance left / speed) var newDuration = distanceLeft / speed; //restart anim animator($("div#container"), newDuration, $("div#container").attr("class")); }); //handler for ltr button $("#ltr").live("click", function() { //stop anim $("div#container").stop(true); //swap class names $("div#container").removeClass("rtl").addClass("ltr"); //work out total travel distance var totalDistance = parseInt($("div#container").width()) + parseInt($("div#viewer").width()); //work out remaining distance var distanceLeft = totalDistance - (parseInt($("div#container").css("left")) + parseInt($("div#container").width())); //new duration is distance left / speed) var newDuration = distanceLeft / speed; //restart anim animator($("div#container"), newDuration, "ltr"); }); //handler for rtl button $("#rtl").live("click", function() { //stop anim $("div#container").stop(true); //swap class names $("div#container").removeClass("ltr").addClass("rtl"); //work out total travel distance var totalDistance = parseInt($("div#container").width()) + parseInt($("div#viewer").width()); //work out remaining distance var distanceLeft = totalDistance - (parseInt($("div#viewer").width()) - (parseInt($("div#container").css("left")))); //new duration is distance left / speed) var newDuration = distanceLeft / speed; //restart anim animator($("div#container"), newDuration, "rtl"); });}); 
 </script>
 </body>
 </html>[/html]
- 
    RE: Scorrimento Immaginipostato in CodingSapete se esiste una guida in italiano? 
 non riesco ad integrarlo.
- 
    RE: Scorrimento Immaginipostato in CodingA primo impatto sembra ottimo, spero solo che il codice non dovrà essere modificato tutte le volte che voglio visualizzare una nuova foto dandogli il percorso. 
- 
    RE: Scorrimento Immaginipostato in CodingCiao marinski, 
 Grazie per la tua risposta.La galleria è uno script pronto ma credo che non centra niente con quello che voglio fare. Della galleria a me interessa solo la cartella dove vengono caricate le immagini, questo per implementare nella home un div dove tutto il contenuto venga visualizzato in modo scorrevole. In poche parole, le immagini che vengono caricate dentro la cartella gallery, dovranno scorrere nella home da destra verso sinistra. 
- 
    Scorrimento Immaginipostato in CodingCiao Ragazzi, 
 spero che la sezione sia quella giusta per questo topic.
 Nel sito ho una sezione galleria immagini dove gli utenti possono inserire le immagini.
 Ciò che voglio fare è:
 inserire in homepage un tag div che in automatico visualizza le immagini caricate nella galleria in modalità scorrevole e continuo, il tutto dovrà avvenire senza di volta in volta andare a modificare lo script.
 Esiste qualcosa di pronto o qualche guida?
- 
    RE: Impaginazione automatica aiutopostato in CodingCiaoThedarkita. 
 Non credo sia un problema di query
 vediamo se mi spiego meglio di ciò che voglio creare.Creo una pagina con nome "sezione 1" che preleva i dati dalla tabella sezione del database, in questa pagina "sezione 1" metto una tabella con 4 righe e 5 colonne 
 quindi 20 celle,
 all'interno di queste celle deve apparire il nome e la descrizione dei prodotti seguendo la numerazione indicata nel database.nell'esempio sotto si può notare ciò che voglio fare: pagina nome "sezione1.php" 
 [HTML]<table width="767" border="1">
 <tr>
 <td>(Cella 1) Nome prodotto e descrizione </td>
 <td>(Cella 2) Llibero</td>
 <td>(Cella 3) Libero</td>
 <td>(Cella 4) Libero</td>
 <td>(Cella 5) Libero</td>
 </tr>
 <tr>
 <td>(Cella 6) Libero</td>
 <td>(Cella 7) Libero</td>
 <td>(Cella Libero</td> Libero</td>
 <td>(Cella 9) Libero</td>
 <td>(Cella 10) Libero</td>
 </tr>
 <tr>
 <td>(Cella 11) Libero</td>
 <td>(Cella 12) Libero</td>
 <td>(Cella 13) Libero</td>
 <td>(Cella 14) Nome prodotto e descrizione </td>
 <td>(Cella 15) Libero</td>
 </tr>
 <tr>
 <td>(Cella 16) Libero</td>
 <td>(Cella 17) Libero</td>
 <td>(Cella 18) Libero</td>
 <td>(Cella 19) Libero</td>
 <td>(Cella 20) Libero</td>
 </tr>
 </table>[/HTML]in questo esempio io ho la cella 1 e la 14 che riportano i dati inseriti nel database, mentre tutti gli altri riportano libero in quanto nel db non'è presente nessun prodotto. 
 Dal momento che io inserisco un nuovo prodotto nel db es. batteria, descrizione batteria, sezione 1, numero 20 questa automaticamente deve caricarsi nella pagina sezione 1 alla cella numero 20.Spero di averlo spiegato bene, non so più come spiegarlo.