Jump to content

total newbie cant get head around contact form


shaun_469

Recommended Posts

hi all!, im trying to set up a website for myself using a free template from os templates..

 

the contact form code is ..

 
<div id="contact" class="clear" ><br="">
   <h2>Contact Us</h2>
        <div class="fl_left">
          <form method="post" action="#"&>
            <label for="fullname">Name:</label>
            <input type="text" name="fullname" id="fullname" value="">
            <label for="validemail">Email:</label>
            <input type="text" name="validemail" id="validemail" value="">
            <label for="message">Message:</label>
            <textarea name="message" id="message" cols="45" rows="10"></textarea>
            <button type="submit" value="submit"><span>Submit[/u]</button>
          
        </div>
 
from what i gather the action needs to be a php file to email me the comments.. so i used a free one from formtoemail.com and i just get a server error message when i press submit, ive tried changing the label names to one which match the php file, but it just wont work for me, i changed the action from # to the name of the php file, but i just cant figure out what im doing wrong
 
thanks in advance to any help or advice you can give me,
 
completely new to websites etc so please dont be to harsh on me!
 
cheers, shaun 

Hi there,

The action attribute specifies where to send the form-data when a form is submitted so you need to replace the '#' with your target file. Now, I don't know what you are doing in your PHP file but the global array $_POST will have the value of all of your form inputs fields which can be used in order to process your contact form. For example, in order to get the value of the input field "fullname" you can do something like this

 

$fullName = $_POST['fullname];

 

Not to forget to say that you must not trust any inputs and must clean all before using in your script 

 

Hope this is easy to understand

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.