How to write contactus.php for my html website..

Discussion in 'HTML & Website Design' started by kamleshnishad, Nov 18, 2013.

  1. #1
    Hello everyone..
    Me and my collage friends have developed the website for our collage event and we are unable to do contact us form.. According to my website design i am facing problem how to create a contact_us.php for for this site so that design should also maintained..

    Please let me know if anyone knows about it..
    http://digitalwebweaver.com/projections/#contact

    Code is also here
    <form>
                     
                      <div class="letterContent">
                        <div class="dearBoyCoy handwrittenFont"></div>
                        <div class="lineWrapper mailNameContainer handwrittenFont">
                          <div class="line">
                            <div class="text">My name is&nbsp;</div>
                            <div class="text textFillWidth">
                              <div class="textContentWrapper">
                                <input class="handwrittenFont" spellcheck="false" type="text" name="name" value=""/>
                                <div class="underline"></div><div class="exclamationMark"><img src="images/page4/exclamation_mark.png"/></div>
                              </div>
                            </div>
                            <div class="text">, u can mail</div>
                          </div>
                        </div>
                        <div class="lineWrapper mailFromContainer handwrittenFont">
                          <div class="line">
                            <div class="text">me back at&nbsp;</div>
                            <div class="text textFillWidth">
                              <div class="textContentWrapper">
                                <input class="handwrittenFont" spellcheck="false" type="text" name="name" value=""/>
                                <div class="underline"></div><div class="exclamationMark"><img src="images/page4/exclamation_mark.png"/></div>
                              </div>
                            </div>
                            <div class="text">. I would like to:</div>
                          </div>
                        </div>
                        <div class="mailContentContainer handwrittenFont">
                          <textarea class="handwrittenFont" spellcheck="false" name="content"></textarea>
    
                          <div class="underline"></div><div class="exclamationMark"><img src="images/page4/exclamation_mark.png"/></div>
                          <br/>
    
                          <div class="underline"></div>
                        </div>
                      </div>
                     
                      </form>
                     
                      <div class="letterForeground">
                        <div class="mailSendWrapper centerText">
                          <div class="mailContainer mailSendContainer">
                            <button><span class="text">SEND</span><img src="images/arrow_white.png"/>
                            </button>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                  <div class="letterSending letterStatus centerText">
                  <span class="info handwrittenFont">
                    Sending
                  </span>
                  </div>
                  <div class="letterSent letterStatus centerText">
                  <span class="info handwrittenFont">
                  Thanks for contacting us<br/>
                  We'll back to you soon..
                  </span>
                    <br/>
    
                    <div class="linkifyForm goBack">
                      <span class="text">Back</span>
                    <span class="image">
                      <img class="out" src="images/page4/go_back_green.png"/><img class="over"
                                                                                  src="images/page4/go_back_white.png"/>
                    </span>
                    </div>
                  </div>
                  <div class="letterError letterStatus centerText">
                  <span class="info handwrittenFont">
                    Sorry. There was an error.<br/>
                    Our server is not responding currently. :D
                  </span>
                    <br/>
    
                    <div class="linkifyForm goBack">
                      <span class="text">Come Again</span>
                    <span class="image">
                            <img class="out" src="images/page4/go_back_green.png"/><img class="over"
                                                                                        src="images/page4/go_back_white.png"/>
                    </span>
                    </div>
    HTML:
    If this contact form have input type text element the i would have done it bit consfused with this one..

    Please help.
     
    kamleshnishad, Nov 18, 2013 IP
  2. Abiolas Gabriel

    Abiolas Gabriel Member

    Messages:
    73
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    Use this,if you need more help reply back to me,use CSS to beautify it )))
    I used this at nsu-d dot com,go there and see the contact form if you want. create two script,one contact.php and contacts.php. Add email where you will like the message sent for you to read.

    In the contact.php add this
    <form action='contacts.php' method='post'>
    <div class="box">
    <h1>Contact:</h1>
    <label>
    <span>Full name</span>
    <input type="text" class="input_tex" name="name" id="name"/>
    </label>
    <label>
    <span>Email</span>
    <input type="text" class="input_tex" name="email" id="email"/>
    </label>
    <label>
    <span>Subject</span>
    <input type="text" class="input_tex" name="contact" id="contact"/>
    </label>
    <label>
    <span>Message</span>
    <textarea class="message" name="message" id="message"></textarea>
    <p>
    <input type="submit" class="butto" value="Submit" name="submit" />
    </p>
    </label>
    
    
    </div>
    </form>
    Code (markup):

    In the contacts.php add this
    <?php
    if(isset($_POST['submit'])) {
    $to = 'put your website email here' ; //put your email address on which you want to receive the information
    $subject = 'Hello'; //set the subject of email.
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $message = "<table><tr><td>Your Name: </td><td>".$_POST['name']."</td></tr>
    <tr><td>E-Mail: </td><td>".$_POST['email']."</td></tr>
    <tr><td>Subject: </td><td>".$_POST['contact']."</td></tr>
    <tr><td>Message: </td><td>".$_POST['message']."</td>
    </tr></table>" ;
    mail($to, $subject, $message, $headers);
    if(mail){
    echo "We've recived your message,we will contact you back soon.";
    }
    else {
    echo "There is a error in your message";
    }
    }
    ?>
    Code (markup):
     
    Abiolas Gabriel, Nov 18, 2013 IP
  3. kamleshnishad

    kamleshnishad Well-Known Member

    Messages:
    689
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    138
    Digital Goods:
    1
    Articles:
    3
    #3
    I know about this.. but i don't want to add new form to this site i just want to create php file associated to that main contact us form.. Kindly visit the site that i have mentioned in my thread..

    Fill the contact us form and you will get the error i want to fix that error only..
     
    kamleshnishad, Nov 18, 2013 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    There's a contact form on that train wreck of "how not to build a website?!?" As if the endless pointless DIV for nothing and scripttard "Gee ain't it neat" garbage wasn't bad enough, the complete /FAIL/ at accessibility pretty much means that entire site belongs in the trash.

    I mean... ever heard of fieldsets? Labels? LEGEND?!? Not throwing 50 div into an area that needs maybe TWO at MOST?!?

    Step one, throw that design away -- step two, learn some more HTML and CSS as well as accessibility norms before crapping out that type of "Everything wrong with drawing goofy paintings of websites in photoshop" layout. Hardly a shock it's blowing 45k of markup on 2k of actual content; anywhere from four to eight times what should have been used. Ever notice you don't see most of these goofy tricks or layout garbage on REAL websites? There's a reason for that!

    Of course, also notice that you have two input with the SAME NAME? Not helping.

    Wow, if that's what you're learning in college for web design/development, sue to get your tuition money back.
     
    deathshadow, Nov 18, 2013 IP
    rahahm33 likes this.
  5. kamleshnishad

    kamleshnishad Well-Known Member

    Messages:
    689
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    138
    Digital Goods:
    1
    Articles:
    3
    #5
    Thanks for the valuable suggestion. I am aware of the excessive use of div tags and there is not a single input or label element.. i even told to the head about this but they told us work on this design only. I am also aware of the the input with the same but i was waiting to get email function that's why i kept it pending..

    I appreciate your suggestion. but if you can help me with the same design please let me know..
     
    kamleshnishad, Nov 18, 2013 IP
  6. Abiolas Gabriel

    Abiolas Gabriel Member

    Messages:
    73
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #6
    I tried it and got a error message,OK send the whole script to me by message. I will try solve it for you,i need to look at it. But still i will advice you use the script i posted,forget about the design contact form you have,it's even load to slow....
     
    Abiolas Gabriel, Nov 18, 2013 IP
  7. rahahm33

    rahahm33 Well-Known Member

    Messages:
    197
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    125
    #7
    Jesus what an abomination. I hope you don't call that garbage "code"
     
    rahahm33, Nov 18, 2013 IP
  8. kamleshnishad

    kamleshnishad Well-Known Member

    Messages:
    689
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    138
    Digital Goods:
    1
    Articles:
    3
    #8
    Error solved.. Thank you everyone...
     
    kamleshnishad, Nov 18, 2013 IP