UnderDoG Δημοσ. 19 Ιουνίου 2006 Δημοσ. 19 Ιουνίου 2006 Καλησπέρα σε όλους. Έχω βάλει ένα php script στη σελίδα μου για να φτάνουν τα δεδομένα της φόρμας που θα συμπληρώνει ο επισκέπτης και όλα λειτουργούν καλά. Μάλλον σχεδόν όλα αφού τα αποτελέσματα φτάνουν στο mail μου χωρίς όμως να ειναι ποτέ τίποτα συμπληρωμένο όσες φορές και αν το έχω συμπληρώσει. Και η ερώτηση ειναι:Τι φταίει?Κάνω κάτι λαθος? Μήπως χρειάζεται php compiler για να μπορώ να διαβάσω τα αποτελέσματα ή μήπως έχω κάνει κάτι λάθος εγω?
panosru Δημοσ. 19 Ιουνίου 2006 Δημοσ. 19 Ιουνίου 2006 h mhpos na edines ton kodika gia na mhn mpoume sthn diadikasia na mantepsoume to ti ftaiei?
UnderDoG Δημοσ. 19 Ιουνίου 2006 Μέλος Δημοσ. 19 Ιουνίου 2006 Ναι σωστά παιδιά έχετε δίκιο... <?php $_POST[]; ?><?php$name = $_POST['name']; $adress = $_POST['adress']; $city = $_POST['city']; $zip = $_POST['zip']; $country = $_POST['country']; $tel = $_POST['tel']; $fax = $_POST['fax']; $email = $_POST['email']; $message = $_POST['message']; $ip = $_POST['ip']; $to = "[email protected]"; $from = "From: $email"; $email_subject = $subject; $body = "Όνομα:$name\nadress:$adress\nΠόλη:$city\nzip:$zip\ncountry:$country\nIP:$ip\n\nemail:$email\nΜήνυμα\n\n$message"; if(mail($to, $subject, $body, $from)) header("Location:contact_page.html"); else echo "There was an internal mail error, please contact administrator"; ?>
panosru Δημοσ. 19 Ιουνίου 2006 Δημοσ. 19 Ιουνίου 2006 > <?php $name = $_POST['name']; $adress = $_POST['adress']; $city = $_POST['city']; $zip = $_POST['zip']; $country = $_POST['country']; $tel = $_POST['tel']; $fax = $_POST['fax']; $email = $_POST['email']; $message = $_POST['message']; $ip = $_POST['ip']; $to = "[email protected]"; $from = "From: {$email}"; $email_subject = $subject; $body = "Όνομα:{$name}\nadress:{$adress}\nΠόλη:{$city}\nzip:{$zip}\ncountry:{$country}\nIP:{$ip}\n\nemail:{$email}\nΜήνυμα\n\n{$message}"; if(mail($to, $subject, $body, $from)) { header("Location: contact_page.html"); } else { echo "There was an internal mail error, please contact administrator"; } ?> 1) to <?php $_POST[] ?> den exei logo yparkshs 2) oi metablhtes pou briskontai mesa se quotes prepei na ginontai hte escepe hte contatinate px: >echo "foo".$foobar."bar"; h kai >echo "foo{$foobar}bar"; PS: to $messae kalo tha htan na to filtrareis kapos mhn to afhneis etsi des ta parakato links addcslashes htmlspecialchars PS2: mails pou den periexoun headers me tis apetoumenes plhrofories topothetountai kata pleiopsifia sta junk mail giati anagnorizontai san spam. opote an thes xrhshmopoihse to parakato anti gia to parapano: > <?php $name = $_POST['name']; $adress = $_POST['adress']; $city = $_POST['city']; $zip = $_POST['zip']; $country = $_POST['country']; $tel = $_POST['tel']; $fax = $_POST['fax']; $email = $_POST['email']; $message = $_POST['message']; $ip = $_POST['ip']; $to = "[email protected]"; $headers = "From: \"" . addslashes(trim($email)) . "\" <{$email}>\n"; $headers .= "Reply-To: {$email}\n"; $headers .= "Return-Path: {$email}\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: text/html; charset=UTF-8\n"; $email_subject = $subject; $body = "Όνομα:{$name}\nadress:{$adress}\nΠόλη:{$city}\nzip:{$zip}\ncountry:{$country}\nIP:{$ip}\n\nemail:{$email}\nΜήνυμα\n\n{$message}"; if(mail($to, $subject, $body, $headers)) { header("Location: contact_page.html"); } else { echo "There was an internal mail error, please contact administrator"; } ?>
Προτεινόμενες αναρτήσεις
Αρχειοθετημένο
Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.