Ce are?

Discuţii diverse, dar centrate pe subiecte IT.
Reguli forum
Aveti o problema si vreti sa primiti ajutor? Click aici ! Nu uitati si de regulamentul forumului !
esperar
Utilizator înregistrat
Mesaje: 76
Membru din: 23-Apr-2008, 14:33:23

Ce are?

Mesaj 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,:*
CaTaNhA
TraducatorTraducator
Mesaje: 1077
Membru din: 06-Feb-2007, 23:40:13
Versiune: 2
Ext: Da
Server: UNIX/Linux
Nivel phpBB: Experimentat
Localitate: Ramnicu Valcea

Mesaj de CaTaNhA »

Adauga in codul HTML un input pentru subiect
EX:

Cod: Selectaţi tot

   <input type="text" name="subject" value="" size="20" /><br />
esperar
Utilizator înregistrat
Mesaje: 76
Membru din: 23-Apr-2008, 14:33:23

Mesaj 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'
flowers
AdministratorAdministrator
Mesaje: 4641
Membru din: 03-Iun-2004, 17:50:34
Ext: Nu
Server: Windows
Nivel phpBB: Mediu
Nivel php: Mediu
Localitate: Bucureşti, România
Contact:

Mesaj 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).
esperar
Utilizator înregistrat
Mesaje: 76
Membru din: 23-Apr-2008, 14:33:23

Mesaj 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.
Avatar utilizator
dorin
Fost coleg
Mesaje: 4620
Membru din: 24-Iun-2003, 23:23:29
Versiune: 3.1.10
Ext: Da
Server: UNIX/Linux
Nivel phpBB: Mediu
Nivel php: Puţin experimentat
Contact:

Mesaj de dorin »

Functia mail() e dezactivata pe server.
esperar
Utilizator înregistrat
Mesaje: 76
Membru din: 23-Apr-2008, 14:33:23

Mesaj 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?
Avatar utilizator
Myky
Utilizator înregistrat
Mesaje: 1101
Membru din: 28-Noi-2007, 15:24:26
Ext: Nu
Server: Windows
Nivel phpBB: Mediu
Nivel php: Mediu

Mesaj de Myky »

Nu o poti activa tu, trebuie sa o activeze cei ce detin host'ul.
esperar
Utilizator înregistrat
Mesaje: 76
Membru din: 23-Apr-2008, 14:33:23

Mesaj de esperar »

Stai ca m-am enervat.Asta inseamna ca POP si SMT nu au mers pana acum!? :evil:
Scrie răspuns

Înapoi la “Diverse”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 1 vizitator