Error in PHP form I receive the form without the information

Asked

Viewed 116 times

1

I get the email though, I don’t get the information. I need help.

<div class="formArea row m0">


    <form action="contact_process.php" class="row m0 contact_form" id="contactForm">
        <div class="col-sm-6">
            <div class="row m0">
                <label for="contact_name">Name <span>*</span></label>
                <input type="text" class="form-control" name="contact_name" id="contact_name" required>
            </div>
            <div class="row m0">
                <label for="contact_phone">Phone</label>
                <input type="tel" class="form-control" name="contact_phone" id="contact_phone">
            </div>
            <div class="row m0">
                <label for="monthly_badget">Monthly Budget</label>
                <select name="monthly_badget" id="monthly_badget" class="selectpicker form-control">
                    <option value="0" disabled selected>-(Monthly Budget)-</option>
                    <option value="200">200 USD</option>
                    <option value="300">300 USD</option>
                    <option value="400">400 USD</option>
                    <option value="500">500 USD</option>
                </select>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="row m0">
                <label for="contact_email">Email <span>*</span></label>
                <input type="email" class="form-control" name="contact_email" id="contact_email" required>
            </div>
            <div class="row m0">
                <label for="contact_url">Website <span>*</span></label>
                <input type="url" class="form-control" name="contact_url" id="contact_url" required>
            </div>
            <div class="row m0">
                <label for="learn_seowave">How did you learn about SEOWAVE</label>
                <select name="learn_seowave" id="learn_seowave" class="selectpicker form-control">
                    <option value="0" disabled selected>-(Select)-</option>
                    <option value="google">Google Search</option>
                    <option value="yahoo">Yahoo Search</option>
                    <option value="blog">Blog</option>
                    <option value="forum">Forum</option>
                </select>
            </div>
        </div>
        <div class="col-sm-12">
            <div class="row m0">
                <label for="interested_in">Which services are you interested in?</label>
                <select name="interested_in" id="interested_in" class="selectpicker form-control">
                    <option value="off_page">Off Page Optimization</option>
                    <option value="on_page">On Page Optimization</option>
                </select>
            </div>
        </div>
        <div class="col-sm-12">
            <div class="row m0">
                <label for="addInfos">Additional Information</label>
                <textarea name="addInfos" id="addInfos" class="form-control"></textarea>
            </div>
        </div>
        <div class="col-sm-12 text-center">
            <button class="borderred_link" type="submit"><span>submit details!</span></button>
        </div>                            
    </form>    

PHP

<?php

    $to = " [email protected] ";
    $from = $_REQUEST['contact_email'];
    $name = $_REQUEST['contact_name'];
    $headers = "From: $from";
    $subject = "Você tem  mensagem do seu formulário";

    $fields = array();
    $fields{"name"} = 'contact_name';
    $fields{"email"} = 'contact_email';
    $fields{"url"} = 'contact_url';
    $fields{"phone"} = 'contact_phone';
    $fields{"Monthly Budget"} = "monthly_badget";
    $fields{"How know about SEOWAVE"} = "learn_seowave";
    $fields{"Interested In"} = "interested_in";
    $fields{"Additional Information"} = "addInfos";

    $body = " Aqui está o que foi enviado:\n\n "; foreach($fields as $a => $b){   $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }

    $send = mail($to, $subject, $body, $headers);

?>
  • You get no field anymore?

  • recebo asssim: Aqui está o que foi enviado:&#xA;&#xA;contact_name: &#xA;contact_email: &#xA;contact_url: &#xA;contact_phone: &#xA;monthly_badget: &#xA;learn_seowave: &#xA;interested_in: &#xA;addInfos:

  • Give a print_r($_REQUEST) and see if the field names are being sent for the request. If not, try naming the form and put the get or post submission method "<form method="post">.

1 answer

0

In the form change the method to POST:

<?php
mail("[email protected],[email protected],[email protected],[email protected],[email protected]","Assunto","Corpo");
?>

There are each comma put a different e-mail address, being from different providers, put in 3 a gmail, in 4 an outlook/Hotmail, etc, fill with all possible emails being each from a different provider, check in all the inbox and the SPAM box (most plausible), if at least one of them receives the email the probleman is not at your provider but at the email service.

If no one receives and can not change hosting will have to use the Phpmailer for authentication (SMTP settings provided by hosting support are required), and if this doesn’t work but you don’t have to change the hosting at the moment I will pass an instruction on how to use a free third party service to send the email with or without use of AJAX (javascript) so that the user does not see the service address giving the impression that the form sent by your site.

  • Please avoid long discussions in the comments; your talk was moved to the chat

  • I give up, nothing works.

  • I’m waiting on CHAT

Browser other questions tagged

You are not signed in. Login or sign up in order to post.