Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Pf2g

  1. #1
    New Coder
    Join Date
    Sep 2011
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pf2g

    Hi everybody!!

    I'm creating a website for a Music School and i'm working on a 'Contact' page, where the user can say anything and when the message is submited, it's automatically send to my email.

    But i'm having problems:

    PHP Code:
    <?php

    include 'topo.php';

    //Verifica como é que o envio é feito

    if(isset($hidSubmit))

    {

    //Declarar variáveis

    $mail_to "paulo.devil92@gmail.com";

    $name $_POST['nome'];

    $mail_from $_POST['email'];

    $mail_sub "EMInfante";

    $mail_mesg $_POST['mensagem'];

    $head 'From: ' $name ' - ' $email_from;

    //Entregue com sucesso/falhado

    if(mail($name,$mail_from,$mail_sub,$mail_msg))

    {

      echo 
    "<span class='red'>E-mail has been sent successfully from $mail_sub to $mail_to</span>";

    }

    else

    {

      echo 
    "<span class='red'>Failed to send the E-mail from $mail_sub to $mail_to</span>";

    }

    }

    ?>
    But i don't recieve the message that is suppose to appear:
    PHP Code:
    echo "<span class='red'>E-mail has been sent successfully from $mail_sub to $mail_to</span>";
     }
    else
     {
      echo 
    "<span class='red'>Failed to send the E-mail from $mail_sub to $mail_to</span>"
    Can someone help me?

    PLEASE I NEED IT AS SOON AS POSSIBLE

    Thank you
    Last edited by PF2G; 09-10-2011 at 06:25 PM.

  • #2
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    Set up an else for your if(isset($hidSubmit)). I can't see any assignment to $hidSubmit in your script unless it's in the included topo.php, or this script is included somewhere else that assigns the variable.

    In other words, verify the value of $hidSumbit as I have a feeling it isn't set.

  • #3
    New Coder
    Join Date
    Sep 2011
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    After several day of hard work i now can send email 8)

    But message doen't show

    PHP Code:
    if (isset($_REQUEST['email']))
    {
    //send email
    $to 'paulo.devil92@gmail.com' ;
    $subject "Dúvida/Comentário Escola Música VNG" ;
    $email $_REQUEST['email'] ;
    $nome $_REQUEST['nome'] ;
    $msg $_REQUEST['mensagem'] ;

    if (
    mail($to$subject"From: " $nome$email$msg))
    {
    echo 
    "Mensagem enviada com sucesso. Obriagado!!";
    header("Location: http://escolamusicavng.net16.net/contact.php");
    }
    else
    {
    echo 
    "Envio falhado. Tente mais tarde."


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •