+ Reply to Thread
Results 1 to 2 of 2

Thread: Help sugestion to New PHP Form Code

  1. #1
    Bralli Records is offline New Bee
    Join Date
    Mar 2008
    Posts
    2
    WHB Points this Month
    0.00
    WHB Points
    0.00
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help sugestion to New PHP Form Code

    Hello,

    I would ask your help to adapt our e-mail form to my website.

    Everything was working perfectly until last Sunday.

    But I think that some changes was done on the server, and from yesterday, all the e-mails forms from my sites don't work anymore.

    I am sending below the PHP code of the form that I created and was using here:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <?
    //inicia o php
    $name = $_POST["name"];
    $email = $_POST["email"];
    $country = $_POST["country"];
    $affilliation = $_POST["affilliation"];
    $track = $_POST["track"];
    $note = $_POST["note"];
    $comments = $_POST["comments"];

    $ip = $_SERVER['REMOTE_ADDR']; //pega o ip de quem enviou
    $data = date("d/m/y"); //pega a data
    $hora = date("H:i"); //pega a hora

    //Campos Obrigatorios
    $name = $_REQUEST['name'];
    $email = $_REQUEST['email'];
    $country = $_REQUEST['country'];
    $affilliation = $_REQUEST['affilliation'];
    $track = $_REQUEST['track'];
    $note = $_REQUEST['note'];
    $comments = $_REQUEST['comments'];

    //Mensagem Campos Obrigatorio
    if (empty($name)) {
    echo "<script>alert('Please, provide a valide DJ Name');</script>";
    echo "<script>history.go(-1);</script>";
    }
    if (empty($email)) {
    echo "<script>alert('Please, provide a valide E-Mail');</script>";
    echo "<script>history.go(-1);</script>";
    }
    if (empty($country)) {
    echo "<script>alert('Country is Required');</script>";
    echo "<script>history.go(-1);</script>";
    }
    if (empty($affilliation)) {
    echo "<script>alert('Affiliation is Required');</script>";
    echo "<script>history.go(-1);</script>";
    }
    if (empty($track)) {
    echo "<script>alert('What is your favority track?');</script>";
    echo "<script>history.go(-1);</script>";
    }
    if (empty($note)) {
    echo "<script>alert('What is your rating to this track?');</script>";
    echo "<script>history.go(-1);</script>";
    }
    if (empty($comments)) {
    echo "<script>alert('Let us know your comment');</script>";
    echo "<script>history.go(-1);</script>";
    }
    $msg .= "<font face='Verdana' size='2'><b>Name:</b> \t$name</font><br>";
    $msg .= "<font face='Verdana' size='2'><b>Country:</b> \t$country</font><br>";
    $msg .= "<font face='Verdana' size='2'><b>Affilliation:</b> \t$affilliation</font><br>";
    $msg .= "<font face='Verdana' size='2'><b>Favourite Track:</b> \t$track</font><br>";
    $msg .= "<font face='Verdana' size='2'><b>Rating:</b> \t$note</font><br>";
    $msg .= "<font face='Verdana' size='2'><b>Comments:</b> \t$comments</font><br>";
    $msg .= "<font face='Verdana' size='2'><b>E-mail:</b> \t$email</font><br>";
    $msg .= "<font face='Verdana' size='2'><b>IP:</b> \t$ip</font><br>";
    $msg .= "<font face='Verdana' size='2'><b>Date:</b> \t$data</font><br>";
    $msg .= "<font face='Verdana' size='2'><b>Hour:</b> \t$hora</font><br>";

    // Enviando o E-mail
    $mensagem = "$msg";
    $remetente = "$email";
    $destinatario = "feedback@promotrack.com.br";
    $assunto = "Feedback Bump Strong EP";
    $headers = "From: ".$remetente."\nContent-type: text/html";

    // Caso tenha problema no envio da mensagem
    if(!mail($destinatario,$assunto,$mensagem,$headers )){
    print "problem in your feedback, please, try again";
    } else {
    //agora vamos imprimir na tela o resultado ou a resposta
    echo "Thanks your support!<br />
    If you are have problem with your download, please report to info@promotrack.com.br";
    echo "<script>window.location.href='/download/bralli_records_BR083_promo_pack.zip'</script>";
    }
    ?>
    </body>
    </html>


    Thanks in advance for any help!
    best regards
    Jason Bralli

  2. #2
    Alan B's Avatar
    Alan B is offline Super Moderator
    Join Date
    Jul 2007
    Location
    Toronto, Canada
    Posts
    1,386
    WHB Points this Month
    0.00
    WHB Points
    290.00
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default

    Does this form send mail outbound from the server? The sender address must be an address that is hosted on that same server. If it is not, then the mail sending will not work.
    I am not WHB staff and I am not paid.
    I provide help in these forums on my own time.

+ Reply to Thread

Tags for this Thread

Posting Permissions

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