Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-10-2011, 05:29 PM   PM User | #1
PF2G
New Coder

 
Join Date: Sep 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
PF2G is an unknown quantity at this point
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..
PF2G is offline   Reply With Quote
Old 09-10-2011, 08:23 PM   PM User | #2
BluePanther
Senior Coder

 
Join Date: Jul 2011
Posts: 1,226
Thanks: 3
Thanked 171 Times in 171 Posts
BluePanther is on a distinguished road
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.
BluePanther is offline   Reply With Quote
Old 09-23-2011, 11:10 PM   PM User | #3
PF2G
New Coder

 
Join Date: Sep 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
PF2G is an unknown quantity at this point
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."
PF2G is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:07 AM.


Advertisement
Log in to turn off these ads.