Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Mar 2005
    Messaggi
    188

    [ajax] modifica istantanea

    ciao a tutti,

    sapete dove posso trovare un esempio di codice per fare questo:
    http://www.ideasfreelance.com/lab/instant_edit/

    qua, c'è solo il js... io avrei bisogno di un esempio con anche la parte PHP, perchè confesso che da li poi non so come far passare i dati in una pagina php :-(

    grazie mille per l'aiuto

  2. #2
    Utente di HTML.it
    Registrato dal
    Mar 2005
    Messaggi
    188
    ciao a tutti, ho trovato questo:

    http://www.yvoschaap.com/index.php/w...pdate_text_20/

    ora.. solo che che questa domanda non è ajax ma php... quindi potete spostare il topic nell'area php.

    il file PHP dello scriot è il seguente:

    Codice PHP:
    <?
    header
    ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
    header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT"); // always modified
    header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); // HTTP/1.1
    header("Cache-Control: post-check=0, pre-check=0"false);
    header("Pragma: no-cache"); // HTTP/1.0


    //we get 2 vars: fieldname and content. so you get: $fieldname=$content;
    //and we get the vars set in the function setVarsForm(vars). These could be used 
    //to identify a user with sending userID=1 
    //you also can use $_COOKIE['someID'] in the file.


    //THIS UPDATES A DATABASE
    //create DB connection

    //update from table set $fieldname = $content where userID = $_COOKIE['userID']


    //OR

    //THIS STARTS A FUNCTION
    //if($_GET['fieldname'] == "userName")
    //  setUserName($_GET['content']);
    //if($_GET['fieldname'] == "userCity")
    //  setUserCity($_GET['content']);
    //
    //

    //OR


    //THIS WRITES CONTENT TO A TEXT FILE
    //$handle = fopen($_GET['fieldname'].".txt", "w+");
    //fwrite($handle, stripslashes($_GET['content']));
    //fclose($handle);

    $fieldname $_GET['fieldname'];
    echo 
    stripslashes(strip_tags($_GET['content'],"


    <img><a>
    [b][i]"
    ));
    ?>
    il punto che non sono riuscito a capire è questo:

    io PRENDO i dati da un database, come diavolo faccio ad aggiornarli??? ho provato in 2500 modi, ma non ci sono riuscito.

    come faccio?

    grazie mille per l'aiuto.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.