Salta al contenuto
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • 0 Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.
Collassa
Connect.gt
Il network Search On
Connect.gt WMF AI Festival Accademia Advanced SEO Tool AgentCy Social Media Strategies Search Tech
Registrati Accedi
Connect.gt
Stream Interest Categorie Hashtag
V

vicotrduval

@vicotrduval
Non seguire Segui
Informazioni
Post
4
Discussioni
1
Condivisioni
0
Gruppi
0
Da chi è seguito
0
Chi segue
0

Post

Recenti Migliore Controverso

  • Problemi con Invio E-Mail degli ordini effettuati
    V vicotrduval
    Coding

    non so come venirci a capo!!!


  • Problemi con Invio E-Mail degli ordini effettuati
    V vicotrduval
    Coding

    il fatto è che non so come fargli entrare il carrello con il post mi servirebbe sapere come mi da solo gli id prodotti


  • Problemi con Invio E-Mail degli ordini effettuati
    V vicotrduval
    Coding

    Ho provato con diversi script tipo questo:

    require_once('inc/mysql.class.php');
    // Include database connection
    require_once('inc/global.inc.php');
    // Include functions
    require_once('inc/functions.inc.php');
    // Start the session
    session_start();
    // Process actions
    
    $cart = $_SESSION['cart'];
    $action = $_GET['action'];
    
    ?>
    
    
    <?php  
    $to = "mioaccount@diposta";  
    $subject = "Ordine ";  
    
    $body = "Ordine:\n\n"; 
    $body =  "tipo: " . trim(stripslashes($total)) . "\r \n"; 
    $body .= "cart: " . trim(stripslashes($cart)) . "\r \n"; 
    $body .= "Nome: " . trim(stripslashes($_POST["nomeutente"])) . "\r \n"; 
    $body .= "Cognome: " . trim(stripslashes($_POST["cognome"])) . "\r \n"; 
    $body .= "Indirizzo: " . trim(stripslashes($_POST["indirizzo"])) . "\r \n"; 
    $body .= "Città: " . trim(stripslashes($_POST["citta"])) . "\r \n"; 
    $body .= "Provincia: " . trim(stripslashes($_POST["provincia"])) . "\r \n"; 
    $body .= "Telefono: " . trim(stripslashes($_POST["telefono"])) . "\r \n"; 
    $body .= "E-mail: " . trim(stripslashes($_POST["email"])) . "\r \n";  
    
    $headers = "From: " . trim(stripslashes($_POST["email"])) . "\r \n"; 
    $headers .= "<" . $_POST["email"] . ">\r\n"; 
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; 
    $headers .= "Return-Path: " . $_POST["email"];  
    
    if(@mail($to, $subject, $body, $headers)) 
    { 
    echo "La mail contenente i dettagli dell'ordine è stata inoltrata con successo."; 
    } 
    else 
    {
    echo "Si sono verificati dei problemi nell'invio della mail."; 
    }  
    ?>
    

  • Problemi con Invio E-Mail degli ordini effettuati
    V vicotrduval
    Coding

    Salve amici spero di risolvere il mio problema .Ho creato da vari sript un modulo ordini con carrello della spesa perfettamente funzionante, i prodotti vengono estratti da un database MySql.
    Una volta arrivato all'invio dell'ordine, mi arriva una mail vuota o quantomeno riesco solo a vedere gli ID dei prodotti (1,5,8,5,3 e cosi via)
    come posso fare per inviare il carrello della spesa completo di totale?
    Vi ringrazio anticipatamente per il vostro supporto

    questi i file:

    questa è la pagina dove risiede il carrello:

    ?php 
    // Include MySQL class 
    require_once('inc/mysql.class.php'); 
    // Include database connection 
    require_once('inc/global.inc.php'); 
    // Include functions 
    require_once('inc/functions.inc.php'); 
    // Start the session 
    session_start(); 
    // Process actions 
    $cart = $_SESSION['cart']; 
    $action = $_GET['action']; 
    switch ($action) { 
        case 'add': 
            if ($cart) { 
                $cart .= ','.$_GET['id']; 
            } else { 
                $cart = $_GET['id']; 
            } 
            break; 
        case 'delete': 
            if ($cart) { 
                $items = explode(',',$cart); 
                $newcart = ''; 
                foreach ($items as $item) { 
                    if ($_GET['id'] != $item) { 
                        if ($newcart != '') { 
                            $newcart .= ','.$item; 
                        } else { 
                            $newcart = $item; 
                        } 
                    } 
                } 
                $cart = $newcart; 
            } 
            break; 
        case 'update': 
        if ($cart) { 
            $newcart = ''; 
            foreach ($_POST as $key=>$value) { 
                if (stristr($key,'qty')) { 
                    $id = str_replace('qty','',$key); 
                    $items = ($newcart != '') ? explode(',',$newcart) : explode(',',$cart); 
                    $newcart = ''; 
                    foreach ($items as $item) { 
                        if ($id != $item) { 
                            if ($newcart != '') { 
                                $newcart .= ','.$item; 
                            } else { 
                                $newcart = $item; 
                            } 
                        } 
                    } 
                    for ($i=1;$i<=$value;$i++) { 
                        if ($newcart != '') { 
                            $newcart .= ','.$id; 
                        } else { 
                            $newcart = $id; 
                        } 
                    } 
                } 
            } 
        } 
        $cart = $newcart; 
        break; 
    } 
    $_SESSION['cart'] = $cart; 
    ?> 
    
    <?php 
    echo writeShoppingCart(); 
    ?> 
    <?php 
    echo showCart(); 
    ?> 
    <?php 
    echo $total; 
    ?>
    

    la struttura del database:

    CREATE TABLE menu ( Id INT(11) NOT NULL PRIMARY KEY, prodotto VARCHAR(255), ingrediente VARCHAR(255), prezzo decimal(10,2)  );
    

    il file function.php

     <?php 
    function writeShoppingCart() { 
        $cart = $_SESSION['cart']; 
        if (!$cart) { 
            return '<p>Non hai nessun prodotto nel carrello</p>'; 
        } else { 
            // Parse the cart session variable 
            $items = explode(',',$cart); 
            $s = (count($items) > 1) ? '/i':''; 
            return '<p>Tu hai <a href="pagina1.php">'.count($items).' prodotto'.$s.' nel tuo carrello della spesa</a></p>'; 
        } 
    } 
    
    function showCart() { 
        global $db; 
        $cart = $_SESSION['cart']; 
        if ($cart) { 
            $items = explode(',',$cart); 
            $contents = array(); 
            foreach ($items as $item) { 
                $contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1; 
            } 
            $output[] = '<form action="?action=update" method="post" id="cart">'; 
            $output[] = '<table>'; 
            foreach ($contents as $id=>$qty) { 
                $sql = 'SELECT * FROM menu WHERE id = '.$id; 
                $result = $db->query($sql); 
                $row = $result->fetch(); 
                extract($row); 
                $output[] = '<tr>'; 
                $output[] = '<td><a href="?action=delete&id='.$id.'" class="r">Cancella</a></td>'; 
                $output[] = '<td><strong><font color="#FF00">'.$prodotto.'</font></strong><br/><font color="#8C8C8C">'.$ingredienti.'</font></td>'; 
                $output[] = '<td>&euro;'.$prezzo.'</td>'; 
                $output[] = '<td><input type="text" name="qty'.$id.'" value="'.$qty.'" size="3" maxlength="3" /></td>'; 
                $output[] = '<td>&euro;'.($prezzo * $qty).'</td>'; 
                $total += $prezzo * $qty; 
                $output[] = '</tr>'; 
            } 
            $output[] = '</table><br/>'; 
            $output[] = '<p>Somma totale: <strong>&euro;'.$total.'</strong></p>'; 
            $output[] = '<div><input type="submit" value="aggiorna carrello" /></div>'; 
            $output[] = '</form>'; 
        } else { 
            $output[] = '<p>Carrello vuoto.</p>'; 
        } 
        return join('',$output); 
    } 
    ?>
    
  • Accedi

  • Non hai un account? Registrati

  • Accedi o registrati per effettuare la ricerca.
  • Primo post
    Ultimo post
Home Accedi Registrati
Menu
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.