• 0
Sign in to follow this  
Diogo Freitas

formulário de recomendação

Question

Boa tarde,

este formulário de recomendação simplesmente não está funcionando. Mas aparentemente está tudo ok.

Dá para dar uma chekada?

agradeço desde já.

<?PHP
error_reporting(134);
# Script name : el8.recommend
# Version     : 1.0
# Description : Inform someone about page you are currently on
# Extra info  : This script uses JavaScript to pop up a window with the form.
#
# Read readme.txt
# 
# -[ hr.el8.web
#     -[ made by Slaven Bacelic
#         -[ e-mail: [email protected]
#
# Edit variables below:
#
# Title of the "poped" page:
    $GLOBALS["title"]="Recomendar esta página a um colega";
# Path to mailto.php script:
    $GLOBALS["path"]="mailto.php";
# Site name:
    $GLOBALS["site_name"]="Uttil.com";
# webmaster's email:
    $GLOBALS["your_email"]="[email protected]";

# Last words: You can distribute this script freely as long as my name and email are in header!

############################ DO NOT EDIT BELOW ################################

function show_form() {
?>
<html>
<head>
<title><?PHP echo $GLOBALS["title"]; ?></title>
</head>
<body>
Recomendar <b><?PHP echo $GLOBALS["url"]; ?></b> a um amigo...
<form method="post" action="<?PHP echo $GLOBALS["../../../../../../DOCUME~1/BRINCO~1/DEFINI~1/Temp/Rar$DI00.766/path"]; ?>">
<input type=hidden name="url" value="<?PHP echo $GLOBALS["url"]; ?>">
  <table width="90%" border="0" cellspacing="0" cellpadding="0">
    <tr align="left" valign="top"> 
      <td width="50%"> Nome: </td>
      <td> 
        <input type="text" name="form[from]" size="30">
      </td>
    </tr>
    <tr align="left" valign="top"> 
      <td> <small>*</small> Email: </td>
      <td> 
        <input type="text" name="form[from_email]" maxlength="40" size="30">
      </td>
    </tr>
    <tr align="left" valign="top"> 
      <td> <small>*</small> Email do colega:</td>
      <td> 
        <input type="text" name="form[to_email]" size="30">
      </td>
    </tr>
    <tr align="left" valign="top"> 
      <td> Comentário acerca do uttil.com: </td>
      <td> 
        <textarea name="form[comment]" rows="5" cols="30"></textarea>
      </td>
    </tr>
    <tr align="left" valign="top">
      <td>
        <input type="submit" name="submit" value="Send">
        <input type="reset" name="Reset" value="Reset">
      </td>
      <td>&nbsp;</td>
    </tr>
  </table>
<p><small>* - obrigatório!</small></p>
</form>
</body>
</html>

<?PHP
}

function error($string) {
    print ("<div align=center valign=center><b>Atenção:</b> $string<br><br>
 |
        [ <a href=\"java script:window.close()\">Fechar esta janela</a> ]
        </div>");
    exit;
}

function check_email ($address) {
# this function was copied from PHP mailing list
    return (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$',$address));
}
if (isset($submit)) {

    if (! check_email ($form["from_email"]) || ! check_email ($form["to_email"]) ) error ("Endereço de email inválido!");
        $date=date( "D, j M Y H:i:s -0600");
    $to_email=$form["to_email"];
    $from=$form["from"];
    $from_email=$form["from_email"];
    $comment=$form["comment"];
    $site_name=$GLOBALS["site_name"];
    $your_email=$GLOBALS["your_email"];
    $message="Hi!\n\n$from ($from_email) invited you to visit $site_name!\nCheck out this URL: $url";
        if ($form["comment"] != "") {
            $message.="\n\n$from left you a note:\n$comment";
        }
    $message.="\n\n\n-------------------------------------------------------------------\nSend
    script!";
    $subject="Foi convidado por $from a visitar ".$GLOBALS["site_name"]."!";
    $add="From: $site_name <$your_email>\nReply-To: $from_email\nDate: $date\n";
    if (@mail ("$to_email","$subject","$message","$add")) {
        echo "<center>Mensagem enviada com sucesso!<br>Obrigado!<br><br>[ <a href=\"java script:window.close()\">Close this window</a> ]</center>";
    } else error ("Neste momento foi impossível enviar o email. Por favor tente mais tarde!");

} else show_form();

?>

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Antes de mais obrigado pela outra dica.

Bem, o mal é mesmo esse,é que não aparece erro nenhum.. Simplesmente não funciona.

Não dá echo nenhum. Nem quando o mail tá errado

Share this post


Link to post
Share on other sites
  • 0

Troque a primeira linha (segunda, na verdade) de:

error_reporting(134);
Para:
error_reporting(6143);

Isto vai "obrigar" a mostrar os erros (contanto que não tenham o "operador" @).

E_ALL = 6143.

Abraços.

Share this post


Link to post
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
Answer this question...

×   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.

Sign in to follow this