Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,210
    Thanks
    23
    Thanked 605 Times in 604 Posts
    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.
    Last edited by sunfighter; 10-08-2012 at 03:10 PM.

  • #3
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi sunfighter, I have absolutely no idea what you are talking about. I am new to coding!

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,210
    Thanks
    23
    Thanked 605 Times in 604 Posts
    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.

  • #5
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #6
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #7
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,210
    Thanks
    23
    Thanked 605 Times in 604 Posts
    Think your email problem is in the Contact.php file. post that.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •