1. This website uses cookies. By continuing to use this website you are giving consent to cookies being used.
    For information on cookies and how you can disable them visit our Cookie Usage page.
    Dismiss Notice

PHP Help with PHP contact form code

Discussion in 'Web Development' started by beacon, Apr 13, 2011.

  1. Richardje

    Richardje New Member


    Hi, I have the same problem and i use the same template. I would like to keep the template intact. I know I should RTFM, but I also know that it will take 2 or 3 minutes for you guru's to tell me how it must be done.

    I site will be hosted externally, but I know they support php, etc....I also have some joomla sites running there.

    I really would appreciate the help to let me form work.

    kind regards,
    Richard
     
  2. John Gross

    John Gross New Member

    Hi I have the same problem, I downloaded a template but did not come with a .php script. Below is my Form code in my contact.html. I tried all of the codes in other forums but I couldn't get my CSS to work with the codes I tried. I was wondering if someone can could create a .php script to work with my form data below. I have not done this in a while so i have forgot a lot of simple things. I have tried some other php codes and created a php script but no luck Thanks in advance. I also notice ("#" ) in (<a class="button-2" href="#">Clear</a> <a class="button-2" href="#">Send</a>) Does this need any changes?


    <h3 class="p1">Contact Form</h3>
    <form id="contact-form" action="*" method="post" enctype="multipart/form-data">
    <fieldset>
    <label><span class="text-form">Full Name:</span>
    <input type="text">
    </label>
    <label><span class="text-form">E-mail:</span>
    <input type="text">
    </label>
    <label><span class="text-form">Telephone:</span>
    <input type="text">
    </label>
    <div class="wrapper">
    <div class="text-form">Message:</div>
    <div class="extra-wrap">
    <textarea></textarea>
    </div>
    </div>
    <div class="buttons"> <a class="button-2" href="#">Clear</a> <a class="button-2" href="#">Send</a> </div>
    </fieldset>
    </form>
     
  3. ktined

    ktined New Member

    Hi I need your help guys, I purchased an html template which had the following code inserted for a contact page but dont have a PHP file to support the email notifications. Can someone help me with the PHP code? I upload the html file here. I hope someone teach me how to do the php file so i would be able to receive email notifications. Thank you :)
     

    Attached Files:

  4. Mimoun

    Mimoun Administrator Staff Member Director Verified Member

    There is no contact form code in the text you uploaded.
    You need to upload the .php file in order to get any help from the community.
     
  5. ktined

    ktined New Member

    Hello Mimoun, I purchase a theme without any php file, that's why i asked help from the community on how to create the php file for the email notifications. I only have HTML and CSS files with me.. but dont have any php file :( :(
     
  6. Mimoun

    Mimoun Administrator Staff Member Director Verified Member

    Have you ever coded in PHP? If not it's going to be hard, but certainly not impossible to help you out.
     
  7. ktined

    ktined New Member

    not yet, anyway.. thank you
     
  8. sergiobru

    sergiobru New Member

    Hello people!

    I spent two days with this problem :censored: I visited a lot of website and can't find something for fix it so I hope you can help me!
    This the contact form:

    HTML:
    <form id="ContactForm" name="ContactForm" method="post" action="send.php">
                                    <div>
                                        <div class="wrapper">
                                            <span>Nombre:</span>
                                            <input type="text" class="input" name="name" id="name">
                                        </div>
                                        <div class="wrapper">
                                            <span>E-mail:</span>
                                            <input type="text" class="input" name="email" id="email">                               
                                        </div>
                                        <div class="textarea_box">
                                            <span>Mensaje:</span>
                                            <textarea name="textarea" id="message" cols="1" rows="1"></textarea>                               
                                        </div>
                                        <a href="#" class="button1" onClick="document.getElementById('ContactForm').submit()">Enviar</a>
                                        <a href="#" class="button1" onClick="document.getElementById('ContactForm').reset()">Borrar</a>
                                    </div>
                                </form>
    When I purchased this template, the php file doesn't exist.
    I tried to learn something about it with tutorials and free contact form templates, but nothing work. Sometimes when finally can send the form to my email the message its empty and take a looong time since was sent, about 30 minutes.

    Really appreciate your help

    PS. Sorry for my english! :unsure:
     
  9. a.backer

    a.backer New Member

    Hi Everybody.

    I have a similar probelm, i downloaded the Zerotype template, but can not seem to get the contact form to work.
    Is there any PHP Guru that can help me out? it's the last part i need working before my wife's site can go live (the pressure is killing me :eek:).
     
  10. a.backer

    a.backer New Member

  11. darthpibe

    darthpibe New Member

    Hi i got this code from a template also and i don't have the pshp file, please can anyone help me with the php file?

    <form action="phpfile.php" method="POST">
    <span class="contact-label">
    <label for="name-id">Nombres:</label>
    <span class="small-text">coloque su nombre completo</span>
    </span>
    <input type="text" id="name-id" name="name-id">
    </p>
    <p class="full-row">
    <span class="contact-label">
    <label for="surname-id">Apellidos:</label>
    <span class="small-text">coloque su apellido completo</span>
    </span>
    <input type="text" id="surname-id" name="surname-id">
    </p>
    <p class="full-row">
    <span class="contact-label">
    <label for="city-id">Ciudad o Provincia:</label>
    <span class="small-text">coloque su ciudad</span>
    </span>
    <input type="text" id="city-id" name="city-id">
    </p>

    <p class="full-row">
    <span class="contact-label">
    <label for="class-id">Curso de interés:</label>
    <span class="small-text">coloque el curso de interés</span>
    </span>
    <select name="cursos">
    <option value="none" selected="selected"> -- Escoje una Opción --</option>
    <option value="Nueva Carrera de Animación 3D & Cine Digital">Nueva Carrera de Animación 3D & Cine Digital</option>
    <option value="Curso de Animación 3D (3D Studio Max)">Curso de Animación 3D (3D Studio Max)</option>
    <option value="Taller de Animación 3D para Niños y Adolescentes">Taller de Animación 3D para Niños y Adolescentes</option>
    </select>
    </p>

    <p class="full-row">
    <span class="contact-label">
    <label for="district-id">Distrito:</label>
    <span class="small-text">coloque su distrito</span>
    </span>
    <input type="text" id="district-id" name="district-id">
    </p>
    <p class="full-row">
    <span class="contact-label">
    <label for="enteraste-id">Como te enteraste:</label>
    <span class="small-text">Quien le contó?</span>
    </span>
    <select name="como">
    <option value="none" selected="selected"> -- Escoje una Opción --</option>
    <option value="Amigos y / o Familiares">Amigos y/o Familiares</option>
    <option value="Paneles">Paneles</option>
    <option value="Buscador de Google">Buscador de Google</option>
    <option value="Facebook">Facebook</option>
    <option value="Charla Informativa">Charla Informativa</option>
    <option value="Mailing">Mailing</option>
    </select>
    </p>
    <p class="full-row">
    <span class="contact-label">
    <label for="phone-id">Teléfono:</label>
    <span class="small-text">coloque su teléfono</span>
    </span>
    <input type="text" id="phone-id" name="phone-id">
    </p>
    <p class="full-row">
    <span class="contact-label">
    <label for="email-id">E-mail:</label>
    <span class="small-text">coloque su email</span>
    </span>
    <input type="text" id="email-id" name="email-id">
    </p>

    <p class="full-row">
    <span class="contact-label">
    <label for="message">Comentarios:</label>
    <span class="small-text"></span>
    </span>
    <textarea name="message" id="message" rows="6"></textarea>
    </p>
    <p class="full-row">
    <input class="mainBtn" type="submit" name="" value="Enviar Mensaje">
    </p>
    </form>
     
  12. Dafe

    Dafe New Member

    Hello

    I am having a similar problem here. I created a form in Flash but PHP is not sending all the data from the form input field. PHP is only sending the field labels but not the actual user input data. This is the email result below:

    We have received the following information:
    Customer Full Name:
    Company Name:
    E-mail Address:
    Telephone Number:
    Country:
    State:
    City and Post Code:
    Shipping Address:
    Customer Inquiry:
    And this is my PHP send mail script below:

    <?php
    $to = dafe@abcde.com ;
    $name = $_REQUEST['name'] ;
    $headers = $_REQUEST['Email'] ;
    $subject = "Quote Request Form";
    $fields = array();
    $fields{"name_field"} = "Customer Full Name";
    $fields{"company_field"} = "Company Name";
    $fields{"email_field"} = "E-mail Address";
    $fields{"phone_field"} = "Telephone Number";
    $fields{"country_field"} = "Country";
    $fields{"state_field"} = "State";
    $fields{"city_field"} = "City and Post Code";
    $fields{"address_field"} = "Shipping Address";
    $fields{"message_field"} = "Customer Inquiry";
    $body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
    $send = mail($to, $subject, $body, $headers);
    ?>

    Can someone please help me to rewrite the correct php code to send all my form field data to my email.

    Thanks!!
     
  13. itsme.subodh86

    itsme.subodh86 New Member

    Can someone help me with the php code for this. Thanks in advance.....

    <section ID="contact" class="parallax-section-8 parallax">
    <div class="parallax-ovl-6">
    <!-- heading -->
    <div class="container">
    <div class="row">
    <div class="col-md-12 pad-bottom-50 animated" data-fx="fadeInUp">
    <div class="main-heads">
    <h2>Contact Us</h2>
    </div>
    </div>
    </div>
    <!-- content -->
    <article class="row">
    <article class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
    <div id="fname" class="theme-error error">
    Name must not be empty
    </div>
    <div id="fmail" class="theme-error error">
    Please provide a valid email
    </div>
    <div id="fmsg" class="theme-error error">
    Message should not be empty
    </div>
    <div class="theme-success success">
    We have received your contact, will get back you shortly.
    </div>
    <div class="theme-error failure">
    Message sending failed!
    </div>
    </article>
    </article>

    <form name="myform" id="contactForm" action="sendcontact.php" enctype="multipart/form-data" method="post">
    <div class="row">
    <!-- name box -->
    <div class="col-md-4 animated" data-fx="fadeInLeft">
    <div class="con-in-box">
    <input placeholder="Name*" type="text" id="name" name='name'>
    </div>
    </div>
    <!-- phone box -->
    <div class="col-md-4 animated" data-fx="fadeInDown">
    <div class="con-in-box">
    <input placeholder="Phone" type="text" id="phone" name='name'>
    </div>
    </div>
    <!-- email box -->
    <div class="col-md-4 animated" data-fx="fadeInRight">
    <div class="con-in-box">
    <input placeholder="Email*" type="text" id="email" name='name'>
    </div>
    </div>
    </div> <!-- row-finished -->
    <!-- text area -->
    <div class="row">
    <div class="col-md-12 con-text-box animated" data-fx="fadeInUp">
    <textarea placeholder="Message*" id="message" name="message"></textarea>
    </div>
    </div>
    <div class="row">
    <div class='col-md-12 con-btn'>
    <a id="submit" href="mailto:Contact @ cloudgarage .in?subject=Inquiry">Send Now</a>
    </div>
    </div>
    </form>
     
    Last edited by a moderator: Dec 4, 2015