CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   HTML & CSS (http://www.codingforums.com/forumdisplay.php?f=13)
-   -   Need help with HTML5 & PHP coding (http://www.codingforums.com/showthread.php?t=275735)

colourflow 10-08-2012 01:15 PM

Need help with HTML5 & PHP coding
 
Desperately need help with my website coding. The 'contact form' and 'site search' facility not working properly.
Contact form works i.e. I get the email but it does not show the message that has been written by the sender.
The site search facility just does not work.

website is colourflow-images.co.uk

Really need help with this one:eek:

sunfighter 10-08-2012 03:03 PM

form on contact page
Code:

<form id="ContactForm" form action="contact.php" method="post" id="form" class="ContactForm">
form action="contact.php" S/B action="contact.php". No form.

You have two IDs.can only have one.

Your search form doesn't seem to have a file or function it is submitted to. So no processing.

colourflow 10-08-2012 10:27 PM

Hi sunfighter, I have absolutely no idea what you are talking about. I am new to coding!

sunfighter 10-09-2012 02:59 AM

This is your contact form:
Code:

<form id="ContactForm" form action="contact.php" method="post" id="form" class="ContactForm">
  <div>
        <div class="wrapper">
                <span>Your Name:</span><input type="text" class="input" >
        </div>
        <div class="wrapper">
                <span>Your E-mail:</span><input type="text" class="input" >
        </div>
        <div class="textarea_box">
                <span>Your Message:</span><textarea name="textarea" cols="1" rows="1"></textarea>
        </div>
        <span>&nbsp;</span>
        <a href="#" class="button" onClick="document.getElementById('ContactForm').reset()">Clear</a>
        <a href="#" class="button" onClick="document.getElementById('ContactForm').submit()">Send</a>
  </div>
</form>

You have two ID's (the dark green) You can not have more than one ID for the entire html page. Remove the ID="form".

The dark red attribute reads "form action". Remove the word form so that it is just action="contact.php".

Your contact email should be generated by contact.php. It should be in the same folder as the Contact.html file.
---------------------------------------
Instead of
Code:

<a href="#" class="button" onClick="document.getElementById('ContactForm').reset()">Clear</a>
<a href="#" class="button" onClick="document.getElementById('ContactForm').submit()">Send</a>

You could use
Code:

<input type="submit" value="Submit">
<input type="reset">

Better presentation.
======================================================================
Your search form is:
Code:

<form id="search" method="post">
  <div>
        <input type="submit" class="submit" value="">
        <input class="input" type="text" value="Site Search" onblur="if(this.value=='') this.value='Site Search'" onfocus="if(this.value =='Site Search' ) this.value=''">
  </div>
</form>

As you can see the form tag does not have the action attribute and that's where the info in the form is sent. You are not submitting the form to any thing. Add the action attribute and give it a file to process the information.

colourflow 10-09-2012 09:47 PM

Sunfighter

Many thanks I really appreciate your guidance.

Unfortunately having made the changes you suggested the email did not even go through, whereas before the email went through but no test arrived.

colourflow 10-09-2012 09:57 PM

Hi Sunfighter

Apologies - double checked and noticed that in the Contact.php I had made an error in the email address. Have put your coding back in and although the email arrives it still does not show the text.

sunfighter 10-10-2012 04:02 PM

Think your email problem is in the Contact.php file. post that.


All times are GMT +1. The time now is 07:09 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.