Jump to content

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

Edited by OOP
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.