Navigazione

    Privacy - Termini e condizioni
    © 2020 Search On Media Group S.r.l.
    • Registrati
    • Accedi
    • CATEGORIES
    • Discussioni
    • Non letti
    • Recenti
    • Hashtags
    • Popolare
    • Utenti
    • Stream
    • Interest
    • Categories
    1. Home
    2. sem93
    3. Post
    S

    sem93

    @sem93

    • Profilo
    • Chi segue 0
    • Da chi è seguito 0
    • Discussioni 7
    • Post 20
    • Migliore 0
    • Gruppi 0
    Iscrizione Ultimo Accesso
    Età 17
    0
    Reputazione
    20
    Post
    0
    Visite al profilo
    0
    Da chi è seguito
    0
    Chi segue
    User

    Post creati da sem93

    • Non visualizza immagini da variabile

      Salve, ho un piccolo problema, i form che ho realizzato sono quasi perfetti, spiego in poche regole come funzionerà il mio script.

      -L'utente carica l'immagine
      -L'utente se vuole utilizzare l'immagine caricata e vederla come avatar, dovrà in una textbar inserire il link di riferimento immagine
      -Nella sua pagina troverà l'immagine aggiunta.


      Inserisci link o immagine
      [PHP]<form action='elaboro.php' method='post'>

      Inserisci il link immagine: <input maxlength='999' id='nome' name='nome'> </p>
      <input value='   Salva    ' class='submit' type='submit'>
      </form>[/PHP]

      Elabora dati
      [PHP]<?php

      $nome = $_POST['nome'];
      $a = fopen("nome.php","w");
      fwrite($a, '<?php $nome = ("'.$nome.'")?>');
      fclose($a);

      ?>

      <h1><center><font color='red'>Operazione Riuscita</font></h1></center>
      [/PHP]

      Variabile che ha il link
      [PHP]<?php $nome = ("/ecc..")?>[/PHP]

      File di visualizzazione
      [PHP]<?php
      include ("nome.php");
      ?>
      <img scr="<?php echo("$nome") ?>" />[/PHP]

      Diciamo che l'img non visualizza il contenuto anche se si scrive

      postato in Coding
      S
      sem93
    • RE: Errore Query che non capisco

      l'ho sistemata dava l'errore la variabile $db che doveva essere cambiata con $link ora ho aggiornato i file e le ho sistemati ma l'errore che ho è quello della sessione, perchè le pagine a cui volevo accedere dovevano essere riservate solo ai loggati

      postato in Coding
      S
      sem93
    • Errore Query che non capisco

      Salve, ho un problemuccio vi spiego brevemente di cosa si tratta.
      Ho creato un form per la registrazione utente ho inserito lo script md5 solo che fa un piccolo errore nella query troverete elencati tutti i miei file più la tabella .

      Tabella
      [PHP]
      CREATE TABLE IF NOT EXISTS ac_users (
      id smallint(5) NOT NULL AUTO_INCREMENT,
      username varchar(30) NOT NULL DEFAULT '',
      password varchar(100) NOT NULL DEFAULT '',
      pwd_conferma varchar(100) NOT NULL DEFAULT '',
      name1 varchar(32) NOT NULL DEFAULT '',
      name2 varchar(32) NOT NULL DEFAULT '',
      email varchar(62) NOT NULL DEFAULT '',
      PRIMARY KEY (id),
      UNIQUE KEY username (username)
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

      [/PHP]

      File config.php contenente tutti i dati dell'host
      [PHP]
      <?php

      $server = "localhost";
      $database = "sito";
      $db_user = "xxx";
      $db_pass = "xxx";
      $table = "ac_users";
      ?>[/PHP]

      File register.html per l'inserimento dei dati
      [PHP]<form action="register.php" method="post">
      <p>Username:
      <input type="text" name="username" size="20">
      <br>
      Password:
      <input type="password" name="password" size="20">
      <br>
      Conferma Password:<input type="password" name="pwd_conferma"><br>
      First Name :
      <input type="text" name="name1" size="20">
      <br>
      Second Name:
      <input type="text" name="name2" size="20">
      <br>
      Email:
           <input type="text" name="email" size="20">
      <br>

      <center> <input type="submit" value="Registrati!">[/PHP]

      File register.php per l'elaborazione dei dati
      [PHP]<?php
      include ('config.php');
      // connect to the mysql server
      $link = mysql_connect($server, $db_user, $db_pass)
      or die ("Could not connect to mysql because ".mysql_error());

      // select the database
      mysql_select_db($database)
      or die ("Could not select database because ".mysql_error());

      $username = $_POST['username'];
      $name1 = $_POST['name1'];
      $name2 = $_POST['name2'];
      $email = $_POST['email'];
      $password = $_POST['password'];
      $pwd_conferma = $_POST['pwd_conferma'];
      
      $db_query = "SELECT * FROM ac_users WHERE username = '$username'";
      $res =  mysql_query($db_query, $db) or die(mysql_error());
      $num_rows = mysql_num_rows($res);
      
      // Controllo campi obbligatori
      if($email==NULL || $username==NULL || $password==NULL)
      {
           echo "<br><br><br><br><br><p class='login'>Tutti i campi sono obbligatori, <a href='registrazione.php'>Torna Indietro</a></p>";
      }
      // Controllo Password
      else if($password != $pwd_conferma) 
      {
          echo "<br><br><br><br><br><p class='login'>Le password inserite non sono coincidenti, <a href='registrazione.php'>Torna Indietro</a></p>";
      }
      else if(strlen($password) < 4 ||  strlen($password) > 12)
      {
          echo "<br><br><br><br><br><p class='login'>Password troppo corta, o troppo lunga (Minimo 4 lettere e Massimo 12 lettere), <a href='registrazione.php'>Torna Indietro</a></p>";
      }
          // Registrazione dell'utente nel database
      else
      {
      $query = "INSERT INTO ac_users (username, name1, name2, email, password) VALUES ('$username','$name1','$email',MD5('$password')";
      mysql_query($query) or die(mysql_error());
      echo"<br><br><br><br><br><p class='login'>Registrazione effettuata. Esegui il login da <a href='index.php'>QUI</a></p>";
      }
      

      ?>[/PHP]

      Login.php Form di login
      [PHP]<?php
      $username = $_POST['username'];
      $password = md5($_POST['password']);

      $result =  mysql_query("SELECT * FROM utenti WHERE username='$username'");
      if(mysql_num_rows($result) == 0)
      {
           echo "<br><br><br><br><br><p class='login'><b>$username</b> non esiste come utente registrato</p>";
          echo "<p class='login'>Riprova ad inserire i dati alla pagina di <a href='login.php'>LOGIN</a></p>";
      }    
      else
      {
          $check = mysql_fetch_array($result);
          $user = $check['username'];
          $pass = $check['password'];
          
          if($username == $user && $password == $pass)
          {
              
              $_SESSION['username'] = "$username";
              $_SESSION['password'] = "$password";
                  echo "<br><br><br><p class='login'>Login effettuato con successo<br></p>";
                  echo "<p class='login'>Benvenuto <b>$username</b><br></p>";
                  echo "<p class='login'>Adesso puoi accedere al contenuto della pagina privata dalla <a href='index.php'>homepage</a></p>";
          }
          else {
          echo "<br><br><br><br><p class='login'>Password errata<br></p>";
          echo "<p class='login'>Riprova ad inserire i dati alla pagina di <a href='login.php'>LOGIN</a></p>";
          }
      }
      ?>
      

      Username: <input type="text" name="username" size="20"><br>
      Password: <input type="password" name="password" size="20"><br>
      <input type="submit" value="Log In">
      </form><BR><BR>[/PHP]

      Datemi una mano, vi ringrazio in anticipo 🙂

      postato in Coding
      S
      sem93
    • Member.php problema registrazione

      Ciao, ho un problema nel mio forum, gli utenti quando cercano di registrarsi immettono le due password corrette nei campi ma i campi le visualizzano come errati.
      Per darvi il link del forum e darmi suggerimenti in privato (dato che i link sono per premium) potrete contattarmi tramite skype, il mio contatto è sem93thebest

      postato in CMS & Piattaforme Self-Hosted
      S
      sem93
    • RE: Incoerenze sul form

      Ho capito l'errore chiedo scusa.

      postato in Coding
      S
      sem93
    • Incoerenze sul form

      Seguendo un topic in cui ho chiesto aiuto l'anno scorso, mi sono insorti dei grossi dubbi.
      Quando inserisco i dati nel form non vengono riportati sul database.
      Ecco il mio elaborato.

      richieste.php
      [PHP]<form name="f1" method="post" target="_top" action="elaboro.php" onSubmit="return WLSubmit(this)"><input name="idsbho" id="IDSBHO" value="1" type="hidden"><input name="PwdPad" id="i0340" type="hidden"><input name="LoginOptions" id="LoginOptions" value="3" type="hidden"><input name="CS" id="CS" type="hidden"><input name="FedState" id="FedState" type="hidden"><input name="PPSX" id="i0326" value="Passpo" type="hidden"><input name="type" id="type" type="hidden">

      <td width="1%" align=""></td>
      </tr>
      </table>

      <table width="504" height="386" align="center"
      <!--DWLayoutTable-->
      <td height="91" width="107"> <img height="69" /> </td>
      <tr>
      <td width="107" height="241"> <td width="344" valign="top"><p> </p>

      <label>La tua email<br>
      <input type="text" name="email" id="email" width="250"/>
      </label>
      </p>
      <p>
      <label>

        <textarea name='description' style='background-color:#ffffff;border:1px solid #CCC;width:95%;font-family:verdana;font-size:10px' rows='8' cols='25'></textarea> 
      </label> 
      

      </p>

      <label>
      <input type="reset" value="Reset" /> </label>
      <label>

          <input type="submit" value="INVIA" /> 
        </label> 
      </td> 
      

      <td width="10"> </td>

      <td width="23"><!--DWLayoutEmptyCell--> </td>
      </table>
      </form> [/PHP]

      elaboro.php
      [PHP]<html>
      <head>
      <title>Ajax e gli iframe nascosti: Salvataggio Dati</title>
      <?php
      require_once ("confi.php");

      // Recupero i dati inseriti nel form proveniente dalla pagina richiesta.php

      $email = trim(htmlentities($_POST["email"], ENT_QUOTES));
      $description = trim(htmlentities($_POST["description"], ENT_QUOTES));

      // Creo la query sql per l'inserimento dati
      $sql = "INSERT INTO richieste (email, description) VALUES ('$email', '$description')";

      // eseguo la query e controllo che non mi restituisca errore
      if($result = mysql_query($sql))
      {
      $messaggio = "Si è verificato un errore nella fase di inserimento;<br /> I dati del cliente non sono stati salvati.";
      }

      mysql_close($connessione);
      ?>[/PHP]

      confi.php
      [PHP]<?php
      $db_host = "localhost";
      $db_user = "";
      $db_psw = "
      ";
      $db_name = "fix";

      $connessione = mysql_connect ($db_host, $db_user, $db_psw) or die ("Connessione al server non stabilita");

      $db_select = mysql_select_db ($db_name, $connessione) or die ("Connessione al Db non stabilita")
      ?>[/PHP]

      La tabella è strutturata invece così
      [PHP]

      --
      -- Database: fix


      --
      -- Struttura della tabella richieste

      CREATE TABLE IF NOT EXISTS richieste (
      id int(15) NOT NULL auto_increment,
      name varchar(50) collate latin1_general_ci NOT NULL,
      password varchar(100) collate latin1_general_ci NOT NULL,
      PRIMARY KEY (id)
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=4 ;

      --
      -- Dump dei dati per la tabella richieste
      --[/PHP]

      postato in Coding
      S
      sem93
    • RE: [VB8] Loggarmi grazie a un form su facebook

      @linuszen said:

      Se buonafortuna.
      Consiglio di partire da qualcosa di più facile 🙂

      www (punto facebook punto com..che palle sta cosa dei link attivi) è pieno di javascript ed è incasinatissimo da automatizzare, al massimo lite , m e touch sono fattibili ma www proprio è un ginepraio, per usare una parola forbita.

      ...e poi quale sarebbe la domanda? "cosa devo fare ora?" ?

      Beh si.
      E comunque non c'è bisogno che ti giri così aggressivamente verso di me, ho chiesto solo una mano.

      postato in Coding
      S
      sem93
    • [VB8] Loggarmi grazie a un form su facebook

      Salve, sto imparando da poco il visual basic e vorrei fare un form di accesso a facebook, non avendo persone al mio fianco esperte che possano seguirmi chiedo a voi.

      [PHP]Imports System.IO
      Imports System.Net

      Public Class Form1

      Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      
      End Sub
      
      Protected Sub Test()
          Dim request As HttpWebRequest = GetRequest("sito")
          Dim response__1 As String = GetResponse(request)
          Dim Html As String = response__1 'Al posto di Rich.Text ci devi mettere dove vuoi salvare il contenuto della pagina e poi lo devi scrivere sulla pagina... 
      End Sub
      Private Shared Function GetRequest(ByVal url As String) As HttpWebRequest
          Dim request As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest)
          request.Method = "Get"
          request.KeepAlive = False
          request.ContentType = "text/html"
          Return (request)
      End Function
      
      Private Shared Function GetResponse(ByVal request As HttpWebRequest) As String
          Dim response As HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse)
          Dim responseStream As Stream = response.GetResponseStream()
          Dim responseReader As New StreamReader(responseStream)
          Return (responseReader.ReadToEnd())
      End Function
      
      
      
      Private Sub Facebook_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Facebook.Click
          Dim reader As IO.TextReader = New IO.StreamReader("dove si trova txt")
          TextBox1.Text = reader.ReadLine
          TextBox2.Text = reader.ReadLine
      
      End Sub
      
      Private Sub Accedi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Accedi.Click
          Shell("link apertura broswer")
      End Sub
      

      End Class[/PHP]

      Ecco :S legge i dati da un foglio txt esterno, potreste aiutarmi voi? Grazie per la cortesia in anticipo.

      postato in Coding
      S
      sem93
    • RE: Come faccio a inviare dei dati al database?

      Grazie mille, sei un grande 😄 .

      postato in Coding
      S
      sem93
    • RE: Come faccio a inviare dei dati al database?

      Si, perchè quello che vado a creare è un'adminpannel .

      postato in Coding
      S
      sem93
    • RE: Come faccio a inviare dei dati al database?

      In poche parole,_che i dati che si inviano a richieste poi vanno a scriversi in un'altra pagina.

      postato in Coding
      S
      sem93
    • RE: Come faccio a inviare dei dati al database?

      Ci sono riuscito.

      Adesso dovrei però dal database imprimere in un form tutti i dati, sapresti come fare?

      postato in Coding
      S
      sem93
    • RE: Come faccio a inviare dei dati al database?

      Ho provato a fare come hai detto, ma il file elaboro.php non elabora e non manda i dati al database.

      Fatal error: main() [function.require]: Failed opening required './includes/config.php' (include_path='.:') in /membri/disext1/core.php on line 25

      ecco l'errore che fà.

      postato in Coding
      S
      sem93
    • RE: Come faccio a inviare dei dati al database?

      E cosa modifico? °_° xD

      ps . Dal file elaboro.php tolgo la stringa require_once("core.php");?

      postato in Coding
      S
      sem93
    • RE: Come faccio a inviare dei dati al database?

      Mi dà un'errore il core.php,esso è strutturato così:

      <?

      define("IN_HOLOCMS", TRUE);

      if(strpos($_SERVER['SERVER_SOFTWARE'],"Win") == false){ $page['dir'] = str_replace('\','/',$page['dir']); }
      chdir(str_replace($page['dir'], "", getcwd()));

      if(strpos($page['dir'],'habblet') && (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest') && $page['no_ajax'] != true){ header('Location: ../'); exit; }

      require_once('./includes/config.php');
      define("PREFIX", $conn['main']['prefix']);
      require('./includes/classes.php');
      $db = new $conn['main']'server';
      if($conn['server']['enabled'] == true){ $serverdb = new $conn['server']'server'; }else{ $serverdb = $db; }
      $settings = new HoloSettings;
      $input = new HoloInput;
      $lang = new HoloLocale;

      session_start();

      define("PATH", $settings->find("site_path"));
      define("SHORTNAME", $settings->find("site_shortname"));
      define("FULLNAME", $settings->find("site_name"));
      //define("DEBUG", true); //Uncomment this line to show detailed database error messages.

      require('./includes/data/'.$settings->find("hotel_server").'.php');
      $core = new core_sql;
      require('./includes/functions.php');
      require('./includes/version.php');

      if($page['housekeeping'] != true){ if(is_object($_SESSION['user'])){ $user = $_SESSION['user']; }else{ $user = new HoloUser(null,null); } }else{ if(is_object($_SESSION['hk_user'])){ $user = $_SESSION['hk_user']; }else{ $user = new HoloUser(null,null); } }

      if($user->error > 0 && $page['bypass_user_check'] != true && $_COOKIE['rememberme'] == "true" && $page['housekeeping'] != true){ $_SESSION['page'] = $_SERVER["REQUEST_URI"]; header("Location: ".PATH."/security_check_token"); }

      if($settings->find("site_closed") == "1" && $page['id'] != "maintenance" && $page['housekeeping'] != true && $user->user("rank") < 5){
      header("Location: ".PATH."/maintenance"); exit;
      }

      $db_host = "localhost";
      $db_user = "";
      $db_psw = "
      *****";
      $db_name = "*******";

      $connessione = mysql_connect ($db_host, $db_user, $db_psw) or die ("Connessione al server non stabilita");

      $db_select = mysql_select_db ($db_name, $connessione) or die ("Connessione al Db non stabilita");
      ?>

      postato in Coding
      S
      sem93
    • RE: Come faccio a inviare dei dati al database?

      No,non lo metto.. perchè da solo fastidio.
      Ora provo ciò che tu mi hai consigliato e ti faccio sapere.
      Grazie tante

      postato in Coding
      S
      sem93
    • RE: Come faccio a inviare dei dati al database?

      // Accesso al Database
      $sqlhostname;
      $sqlusername;
      $sqlpassword;
      $sqldb;
      L'ho messo perchè altervista non mi riconosceva..

      Le tabelle del database contengono questa struttura

      -- Table structure for richieste


      CREATE TABLE richieste (
      id int(10) NOT NULL auto_increment,
      Email varchar(100) default NULL,
      description varchar(100) default NULL,
      userid int(10) default NULL,
      PRIMARY KEY (id)
      ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;


      -- Records


      Elimino gli hidden.

      Poi ho provato a mettere nel form i nomi delle tabelle create nel db solo che non le accetta xD

      postato in Coding
      S
      sem93
    • RE: Come faccio a inviare dei dati al database?

      Ok.
      Ti posto tutto il mio elaborato quì.

      Helptool.php
      [php]<title>Help Tool</title>

      <td width="1%" align=""></td>
      </tr>
      </table>

      <table width="720" height="351" border="0" align="center" >
      <!--DWLayoutTable-->
      <td height="104" width="129"> </td>
      <tr>
      <td width="129" height="241"> <td width="430" valign="top"><p> </p>
      <p><b><center>Sei propietario di un personaggio?</center></b></p>
      <p><center><a href="richiesta.php"><font color="#FFCC00">SI </font> </a>   <a href="register.php"><font color="#ffcc00"> NO</font></a></center></p></td>
      <td width="7"> </td>

      <td width="136"><!--DWLayoutEmptyCell--> </td>
      </table>
      [/php]

      richieste.php

      [php]<title>Domanda Help Tool</title>

      <form name="f1" method="post" target="_top" action="elaboro.php" onSubmit="return WLSubmit(this)"><input name="idsbho" id="IDSBHO" value="1" type="hidden"><input name="PwdPad" id="i0340" type="hidden"><input name="LoginOptions" id="LoginOptions" value="3" type="hidden"><input name="CS" id="CS" type="hidden"><input name="FedState" id="FedState" type="hidden"><input name="PPSX" id="i0326" value="Passpo" type="hidden"><input name="type" id="type" type="hidden">

      <td width="1%" align=""></td>
      </tr>
      </table>

      <table width="504" height="386" align="center"
      <!--DWLayoutTable-->
      <td height="91" width="107"> <img height="69" /> </td>
      <tr>
      <td width="107" height="241"> <td width="344" valign="top"><p> </p>

      <label>La tua email<br>
      <input type="text" name="nome" id="nome" width="250"/>
      </label>
      </p>
      <p>
      <label>

        <textarea name='notes' style='background-color:#ffffff;border:1px solid #CCC;width:95%;font-family:verdana;font-size:10px' rows='8' cols='25'></textarea>
      </label>
      

      </p>

      <label>
      <input type="reset" value="Reset" />

          <input type="submit" value="INVIA" />
        </label>
      </td>
      

      <td width="10"> </td>

      <td width="23"><!--DWLayoutEmptyCell--> </td>
      </table>
      </form>[/php]

      Elaboro.php

      [php]<html>
      <head>
      <title>Ajax e gli iframe nascosti: Salvataggio Dati</title>
      <?php
      include('core.php');

      // Recupero i dati inseriti nel form proveniente dalla pagina richiesta.php

      $id = $_POST["id"];
      $email = $_POST["email"];
      $description = $_POST["description"];

      // Accesso al Database
      $sqlhostname;
      $sqlusername;
      $sqlpassword;
      $sqldb;

      // apro la connessione dal database
      $cnn = mysql_connect($server, $username, $password) or die ("Impossibile connettersi al server.");

      // seleziono il database
      @mysql_select_db($sqldb) or die ("Impossibile selezionare il database.");

      // Creo la query sql per l'inserimento dati
      $sql = "INSERT INTO richieste
      SET
      nome = '".$id."',
      telefono = '".$email."',
      email = '".$description."' ";

      // eseguo la query e controllo che non mi restituisca errore
      if($result = mysql_query($sql))
      {
      $messaggio = "Si è verificato un errore nella fase di inserimento;<br> I dati del cliente non sono stati salvati.";
      }

      mysql_close($cnn);
      ?>
      <script type="text/javascript">
      // al caricamento della pagina eseguo la funzione
      window.onload = function ()
      {
      // richiamo la funzione saveResult presnte nel iframe "frame_visibile"
      // e gli assegno come valore il messaggio restituito da PHP
      top.frames["frame_visibile"].visualizza_risultato("<?php echo $messaggio ?>");
      }
      </script>
      </head>
      <body>
      </body>
      </html>[/php]

      ps. Elaboro dovrebbe trascrivere il contenuto in una tabella del database,ma non lo fà.

      ps2. Ho tolto i link quindi sarà un po' malmesso xD

      postato in Coding
      S
      sem93
    • Come faccio a inviare dei dati al database?

      Salve, _è da giorni che provo invano di inviare dei dati al database.

      Allora vi spiego, _ho creato un form in cui si scrivono i propri dati e si inviano in una pagina php essa dovrebbe elaborare i dati e imprimerli nel database.
      La tabella nel mio database l'ho già creata, _però dovrei riempirla con quei dati.
      Potreste aiutarmi voi?

      postato in Coding
      S
      sem93
    • Continui Dos al mio vps

      Salve,da poco ho acquistato un vps solo che ho problemi con lamer che continuano a mandarmi down il sito,mod-evasive non è servito a niente.
      Mi potete consigliare perpiacere un anti-dos?

      Cordiali saluti,Sem93

      postato in Hosting e Cloud
      S
      sem93