Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8351111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:31:48+00:00 2026-06-09T08:31:48+00:00

To being with, Im really bad with PHP, not my area. Sorry for any

  • 0

To being with, Im really bad with PHP, not my area. Sorry for any stupid stuff I might say

EDIT: I tried echoing the vars as you guys sayd to, and comes out I cant get any value out of it.

EDIT2: Those “class required” works for my jquery validation script. You guys think i should post it too?

Well, im facing a php contact form problem. I dont know much about php too, so this make stuff harder.

Well, I’ve tried mailtest.php to check if it was my hosting, but it is working ok. So here is the code:

<form class="validate" method="post" action="send_form_email.php">

    <span class="fill">Todos os campos são obrigatórios.</span>
    <span><label>Nome:</label><input name="nome" type="text" class="required" /></span><br />
    <span><label>E-mail:</label><input name="mail" type="text" class="required email" /></span><br />
    <span><label>Empresa:</label><input name="empresa" type="text" class="required" /></span><br />
    <span><label>Telefone:</label><input style="width: 150px;" name="phone" type="text" class="required" /></span><br />                   
    <span><label>Mensagem:</label><textarea name="mensagem" cols="38" rows="8" class="required"></textarea></span><br />
    <span><input class="btn" type="submit" name="submit" value="Enviar" /></span>

</form>

And here it is my php coding:

<?php
if(isset($_POST['submit'])) {

$to = "fernando_fleury@hotmail.com";
$subject = "Contato Website - Nicotec";
$name = $_POST['nome'];
$email = $_POST['mail'];
$empresa = $_POST['empresa'];
$phone = $_POST['phone'];
$message = $_POST['mensagem'];

$body = "De: $name_field\n E-Mail: $email\n Empresa: $empresa\n Telefone: $phone\n Mensagem:\n $message";

mail($to, $subject, $body);
}

header('Location: contato.html');

?>

It is possible to check it live too on: http://www.fernandofleury.com.br/preview/nicotec/contato.html

What am i doing wrong here? Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T08:31:50+00:00Added an answer on June 9, 2026 at 8:31 am

    Rather than if(isset($_POST['submit'])) check to make sure that all of your required fields are set along the lines of if(isset($_POST['nome']) && isset($_POST['mail']) && isset($_POST['phone']) ....

    Then if that fails, echo out the $to, $subject and $body. Comment out the header to see the results while you test it.

    Also, try this:

    if(isset($_POST['submit'])) 
    {
        $to = "fernando_fleury@hotmail.com";
        $subject = "Contato Website - Nicotec";
        $name = $_POST['nome'];
        $email = $_POST['mail'];
        $empresa = $_POST['empresa'];
        $phone = $_POST['phone'];
        $message = $_POST['mensagem'];
    
        $body = "De: $name_field\n E-Mail: $email\n Empresa: $empresa\n Telefone: $phone\n Mensagem:\n $message";
    
        mail($to, $subject, $body);
    
        header('Location: contato.html');
    }
    else
    {
        echo "Ruh ohes! Something wasn't set!";
    }
    

    edit: to echo out a var to the screen use (in the example of $to this code:

    echo $to;
    

    Edit 2:

    I had a look at your page and you use javascript to ensure that all the fields are filled in. Therefore, the problem almost certainly lies in this line:

    if(isset($_POST['submit']))
    

    Can you change it to:

    if(!empty($_POST['nome']) && !empty($_POST['mail']) && !empty($_POST['empresa']) && !empty($_POST['phone']) && !empty($_POST['mensagem']))
    

    for me please? Perhaps the $_POST['Submit'] isn’t being sent properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I dont really understand why this is not working, I am being returned to
I've got a really strange situation where my SAX ContentHandler is being handed bad
This is really two questions: Why isn't the membership operator (__contains__) ever being called?
I've being trying this for about 5 hours already, and I'm feeling really, really
Possible Duplicates: Is there any advantage of being a case-sensitive programming language? Why are
How to draw, say, a rectangle on the screen with it being proportional to
We're being really stuck here so I decided to ask your help. Yesterday I've
I am having a really bad issue where no matter what I try, the
I really am feeling bad. I have one web application that sends Emails for
I've got a really bad brain block with this. My XML file looks like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.