Jump to content

Problema Pagina Contact.html: Nu Se Trimite Email


AmaZinGSoul

Recommended Posts

Dupa cum spune si titlul am o problema cu o pagina .html (contact.html). Am luat de pe net o pagina: contact.html, daupa ce completez si dau trimite nu stiu unde se trimite sau nu se trimite... As vrea sa imi vina pe mail tichetul.

 

Cod:

<div class="ten columns">
    <div class="ten columns alpha">
        <form method="post" action="contact_contact.php" autocomplete="on" id="contact-forum">
       
        <label for="name">Nume si prenume</label>
        <input type="text" size="50" name="nume" id="nume" value="" class="required">
        <label for="email">Adresa de email</label>
        <input type="text" size="50" placeholder="Adresa trebuie sa fie valida." name="email" autocomplete="on" id="email" value="" class="required email">
        <label for="subject">Subiect</label>
        <input type="text" size="50" name="subiect" id="subiect" value="" class="required">
        <label for="message">Mesaj</label>
        <textarea rows="5" cols="50" name="mesaj" id="mesaj" class="required"></textarea>
        <input type="submit" value="Trimite" name="submit" class="button blue small">
      </form>
    </div>
</div>

Dovada: contact.png

Link to comment
Share on other sites

Pune linile de mai jos in fisierul php:

<?php
if(isset($_POST['submit'])) {
$to = "email-ul@tau";
$subject = "site-ul tau contact";
$name_field = $_POST['nume'];
$email_field = $_POST['email'];
$message = $_POST['mesaj'];
$body = "From: $name_fieldn E-Mail: $email_fieldn Message:n $message";
echo "Mesajul a fost trimis! Vei fi contactat(a) in cel mai scurt timp.";
mail($to, $subject, $body);
} else {
echo "Eroare! Va rugam sa verificati toate casutele!";
}
?>
  • Upvote 1

Te-ai inregistrat? Ne-ar placea sa te prezinti.

Cum pot sustine forumul?
Cumpara de la eMag folosind acest link.
--------------------
oG2BN9d.gifse1WdXd.gifQG6MtmI.gifRHYjDzD.gifG5p1wui.gif

Link to comment
Share on other sites

  • Moderators

Vezi cu

<div class="ten columns">
    <div class="ten columns alpha">
        <form method="post" action="" autocomplete="on" id="contact-forum">
       
        <label for="name">Nume si prenume</label>
        <input type="text" size="50" name="nume" id="nume" value="" class="required">
        <label for="email">Adresa de email</label>
        <input type="text" size="50" placeholder="Adresa trebuie sa fie valida." name="email" autocomplete="on" id="email" value="" class="required email">
        <label for="subject">Subiect</label>
        <input type="text" size="50" name="subiect" id="subiect" value="" class="required">
        <label for="message">Mesaj</label>
        <textarea rows="5" cols="50" name="mesaj" id="mesaj" class="required"></textarea>
        <input type="submit" value="Trimite" name="submit" class="button blue small">
      </form>
    </div>
</div>

<?php
if (isset($_POST['submit'])))
{
	//----------------------------------------------
	// Aici completezi emailul tau de contact
	//----------------------------------------------
	$email = 'blablabla@pctroubleshooting.ro';
	
	$nume = $_POST['nume'];
	$adresa_email = $_POST['email'];
	$subiect = $_POST['subiect'];
	$mesaj = $_POST['mesaj'];
	
	$continut_email = "De la: $numern
	                   Email: $adresa_emailrn
                           Mesaj: $mesajrn";
	
	if (!mail($email, $subiect, $continut_email))
	{
		echo 'A aparut o eroare.';
	}
	
}
?>

Nu mai ai nevoie de fisierul contact_Contact.php

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.