Pagina 1 din 1

Ce are?

Scris: 10-Mai-2008, 19:23:58
de esperar
Deci,am facut rost de niste coduri html si un cod php.
Adica, contact.html si handle_contact.php.
Bun,bagati cfbraila.ro/contact.html si completati la vrajeala campurile de acolo si dati pe "send".Nu stiu de ce dar va arata ca nu ati pus nici un subiect la mesaj deci ati completat toate campurile.
Pote fi de la:

Cod: Selectaţi tot

/*In the code below 2 variables are set, one is the email address the mail will be sent 
to, and the other who to CC.*/

$sendTo = 'office@cfbraila.ro';
$Bcc = 'example@example.com';
Am facut si acel ultim fisier,contact_done.html,in fine uitati tot codul:

Cod: Selectaţi tot

<?php
/**
 * this script accompanies the tutorial available at www.stefashwell.com
 *
 * @author     Stefan Ashwell <stef@stefashwell.com>
 * @copyright  stefashwell.com
 * @written    December 8th 2005
 */

/*The following will get the value entered into the "name" box on the contact form
as the form uses method="post" we use $_POST['name'] to get the value the code puts 
it into a variable called 'name' for use later*/

$name = $_POST['name'];

/*The following "if" statement checks if there is a value in the variable $name, if 
not it means nothing was entered into the box on the form, and so it will echo out 
an error message and stop.

This isn't really necessary, and on some things you wont want to check.*/

if ( empty($name) ) {
echo 'You did not enter your name, please <a href="contact.html">go back</a> and make sure you enter it';
die();
}

/*Now lets capture the rest of the form elements and provide error checking for each 
in the same way as above:*/

$company = $_POST['company'];

if ( empty($company) ) {
echo 'You did not enter your company, please <a href="contact.html">go back</a> and make sure you enter it';
die();
}

$email = $_POST['email'];

if ( empty($email) ) {
echo 'You did not enter your email address, please <a href="contact.html">go back</a> and make sure you enter it';
die();
}

$tel = $_POST['tel']; // for tel and fax it might not be necessary for it to be entered and so can be left blank
$fax = $_POST['fax'];

$subject = $_POST['subject'];

if ( empty($subject) ) {
echo 'You did not enter a subject, please <a href="contact.html">go back</a> and make sure you enter it';
die();
}

$comments = $_POST['comments'];

if ( empty($comments) ) {
echo 'You did not enter any comments, please <a href="contact.html">go back</a> and make sure you enter it';
die();
}

/*Ok now the boring bit is over we can start putting together the email message that 
will be sent ready for sending.

The following code creates a variable called $message and all of the variables from the 
form are added, along with extra text to go in the mail. carriage returns are created 
with "\n".*/

$message = 'Someone has filled out the contact form on your website' . "\n\n";
$message .= 'Name: ' . $name . "\n";
$message .= 'Company: ' . $company . "\n";
$message .= 'Email: ' . $email . "\n";
$message .= 'Tel: ' . $tel . "\n";
$message .= 'Fax: ' . $fax . "\n\n";
$message .= 'Comments: ' . "\n";
$message .= $comments;

/*In the code below 2 variables are set, one is the email address the mail will be sent 
to, and the other who to CC.*/

$sendTo = 'office@cfbraila.ro';
$Bcc = 'example@example.com';

/*The code below sets message headers - from, reply to and bcc addresses.*/

$headers = 'From: Contact Form <' . $email . '>' . "\r\n" . 'Reply-To: ' . $email . "\r\n" . 'Bcc: ' . $Bcc . "\r\n";

/*Ok now we can send the mail! which is really simple in php:*/

mail($sendTo, $subject, $message, $headers);

/*Now the mail has been sent we can forward the browser to a confirmation page letting the 
user know their mail has been sent.*/

header ("Location: contact_done.html");

/*And that's about it! All that is left to do is create the HTML file called contact_done.html.*/

?>
Sper sa ma ajutati,:*

Scris: 10-Mai-2008, 21:02:32
de CaTaNhA
Adauga in codul HTML un input pentru subiect
EX:

Cod: Selectaţi tot

   <input type="text" name="subject" value="" size="20" /><br />

Scris: 10-Mai-2008, 21:07:48
de esperar
Merci mult acum nu mai apare eroarea aceea si imi zice ca mesajul a fost trimis cu succes..doar ca nu il primesc. :oops:
Ce vrea sa spuna asta,totusi:

Cod: Selectaţi tot

*In the code below 2 variables are set, one is the email address the mail will be sent
to, and the other who to CC.*/

$sendTo = 'office@cfbraila.ro';
$Bcc = 'example@example.com'

Scris: 11-Mai-2008, 00:59:44
de flowers
In codul de mai jos 2 variabile sunt setate: una este adresa de e-mail la care va fi trimis mailul, iar cealalta la care va fi trimis CC (carbon copy, adica o copie).

Scris: 17-Mai-2008, 20:19:40
de esperar
Nu am reusit cum ai zis tu dar un prieten mi-a dat niste scripturi.Merg perfect pe ej.am si sunt copatibile cu idiotenia de mail.ilive.ro
Dar,cand le-am pus pe ilive nu merg.
Nu fac reclama, www.test.cfbraila.ro
Cum am spus,comopletati la misto camputile alea si sa vedeti ca va da alta eroare.Desi zice ca se primite,eu nu il primesc.

Scris: 17-Mai-2008, 21:59:28
de dorin
Functia mail() e dezactivata pe server.

Scris: 18-Mai-2008, 09:08:15
de esperar
Si cum o activez?Este ciudat ca de pe ej.am cand am trimis pe o adresa de email de pe ilive.ro am primit mailul.
Deci,cum se activeaza?

Scris: 18-Mai-2008, 15:03:44
de Myky
Nu o poti activa tu, trebuie sa o activeze cei ce detin host'ul.

Scris: 18-Mai-2008, 15:12:20
de esperar
Stai ca m-am enervat.Asta inseamna ca POP si SMT nu au mers pana acum!? :evil: