- Fórum WMO
- → Viewing Profile: Posts: Loi
Community Stats
- Group Usuários
- Active Posts 128
- Profile Views 2886
- Member Title 12 Horas
- Age Age Unknown
- Birthday Birthday Unknown
-
Sexo
Não informado
1
Neutral
User Tools
Friends
Loi hasn't added any friends yet.
Latest Visitors
Posts I've Made
In Topic: Como Inserir Endereço De E-Mail No Form?
05/06/2013, 05:57
Agora deu certo! Brigadão
In Topic: Como Inserir Endereço De E-Mail No Form?
04/06/2013, 07:46
Antes de mais nada, muito obrigado pela atenção! Esse site q vc indicou é bem mais legal. Peguei lá um script que vai resolver a minha vida, mas ao abrir, não vi como colocar o meu endereço de e-mail nem o subject definido. Como disse, não programo em PHP. Será que vc me ajuda? Segue o código:
<?php
//Retrieve form data.
//GET - user submitted data using AJAX
//POST - in case user does not support javascript, we'll use POST instead
$name = ($_GET['name']) ? $_GET['name'] : $_POST['name'];
$email = ($_GET['email']) ?$_GET['email'] : $_POST['email'];
$website = ($_GET['website']) ?$_GET['website'] : $_POST['website'];
$comment = ($_GET['comment']) ?$_GET['comment'] : $_POST['comment'];
//flag to indicate which method it uses. If POST set it to 1
if ($_POST) $post=1;
//Simple server side validation for POST data, of course, you should validate the email
if (!$name) $errors[count($errors)] = 'Digite seu nome.';
if (!$email) $errors[count($errors)] = 'Digite um e-mail válido.';
if (!$comment) $errors[count($errors)] = 'Digite sua mensagem.';
//if the errors array is empty, send the mail / no errors found
if (!$errors) {
//if POST was used, display the message straight away
if ($_POST) {
echo 'Mensagem enviada com sucesso.';
//This one for ajax
//1 means success, 0 means failed
} else {
echo '1';
}
} else {
//display the errors message
for ($i=0; $i<count($errors); $i++) echo $errors[$i] . '<br/>';
echo '<a href="jquery-ajaxform.php">Back</a>';
exit;
}
?>
- Fórum WMO
- → Viewing Profile: Posts: Loi
- Privacy Policy
- Regras ·



Postagens