Jump to content

Beginner PHP email submit form


Recommended Posts

Hi guys. I am very new to PHP and have little or no knowledge at the moment. Currently I have a live site but would like to add a email submit form that would send the users information to a certain email and number of emails. A file submit option would be handy too.

I have tried a few pre made scripts and templates but just cant figure out how to make any of them work. I use Dreamweaver to code and manage my live site.

Below is a picture of the message I am getting in Dreamweaver and a link to the script I am using.

http://www.freecontactform.com/email_form.php

 

scripyt.jpg

Link to comment
Share on other sites

For real simple, try something like the following.

<?php
if(!empty($_POST['subject']) || (!empty($_POST['message'])) ) {
    mail('youremail@example.com', $_POST['subject'], $_POST['message']);
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>ContactForm</title>
    </head>
    <body>
        <form method="post">
            <input type="text" name="subject" />
            <textarea rows="4" cols="50" name="message"></textarea>
            <button type="submit">Submit</button>
        </form>
    </body>
</html>

 

Link to comment
Share on other sites

Your DreamWeaver error message is telling that the site definition is incorrect. Go to Site > Manage Sites, select your site definition in the list, and click the edit button. You'll want to select the 'Servers' panel, select your server in that list, and click the edit button once again. There, update your server location, default path, username, and password, and click 'Test'. This will let you know whether or not the information you entered is valid and able to be used by DW.

Link to comment
Share on other sites

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.