Visualizzazione dei risultati da 1 a 3 su 3

Discussione: php e db mysql

  1. #1
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,805

    php e db mysql

    ragazzi scusate mi potete dire cosa c e di sbagliato non riesco ad inviare i dati al database il database si chiama marik e la tabella si chiama form ci potreste dare un occhiata?

    Codice PHP:
    <? 

    $adminaddress 
    "info@xxxxxx.com"
    $siteaddress ="http://www.xxxxx.com"
    $sitename "xxxxxx"

    //No need to change anything below ... 
    // Gets the date and time from your server
    $date date("m/d/Y H:i:s");

    // Gets the IP Address
    if ($REMOTE_ADDR == ""$ip "no ip";
    else 
    $ip getHostByAddr($REMOTE_ADDR);

    // Gets the POST Headers - the Flash variables
    $action $HTTP_POST_VARS['action'] ;
    $email $HTTP_POST_VARS['email'] ;
    $name $HTTP_POST_VARS['name'] ;
    $comments $HTTP_POST_VARS['comments'] ;
    $telefono $HTTP_POST_VARS['telefono'] ;
    $oggetto $HTTP_POST_VARS['oggetto'] ;

    //Process the form data!
    // and send the information collected in the Flash form to Your nominated email address

    if ($action == "send") {
        
    //
        
    mail ("$adminaddress","informazioni",
        
    "Il visitatore ha lasciato le seguenti informazioni \n
        Name: 
    $name 
        Email: 
    $email\n
        Telefono: 
    $telefono 
        Messaggio:
        ------------------------------
        
    $comments
        
        Logged Info :
        ------------------------------
        Using: 
    $HTTP_USER_AGENT
        Hostname: 
    $ip
        IP address: 
    $REMOTE_ADDR
        Date/Time:  
    $date","FROM:$email) ; 
        
        
    //This sends a confirmation to your visitor
        
    mail ("$email","Re:"
        
    "Salve $name,\n
    abbiamo ricevuto il suo messaggio e presto sarà contattato.\n
         By,
        
    $sitename
        
    $siteaddress","FROM:$adminaddress") ; 
        
        
    //Confirmation is sent back to the Flash form that the process is complete
        
    $sendresult "Thank you. You will receive a confirmation email shortly.";
        
    $send_answer "answer=";
        
    $send_answer .= rawurlencode($sendresult);
        echo 
    $send_answer;
    //

    $db$user="rocco.mo"

        
    $psw="maurizio"
        
    $database="marik"
        
    mysql_select_db($database); 
     = 
    mysql_connect($dbhost$dbuser$dbpassword); 
        if (
    $db == FALSE) die ("Errore nella connessione."); 
        
    mysql_select_db($dbname$db) or die ("Errore nella selezione del database."); 
        
    $query "INSERT INTO form (name, email, telefono, oggetto, comments, Date) VALUES   ('{$$_GET['name']}', '{$$_GET['email']}', '{$$_GET['telefono']}', '{$$_GET['oggetto']}', '{$$_GET['comments']}', '{$$_GET['Date']}')"
        
    $result mysql_query($query,$db); 
        
    mysql_close($db); 



    ?>

  2. #2
    Utente di HTML.it L'avatar di polinet
    Registrato dal
    Nov 2000
    Messaggi
    993
    Prova a rinominare la tua tabella != (diverso) da "form"


    ¿Hasta la pasta?

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,805
    grazie per la risp ma dimmi lo script e giusto?

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 © 2026 vBulletin Solutions, Inc. All rights reserved.