I am a newbie trying to perform what I've been told is a simple task, but cannot seem to discover the procedures to do so.

I would like to be able to design a form on my site, a visitor completes the form and the information is stored in a database which I can access remotely and even convert to a mail out list for a newsletter.

I use DW CS3, I have a Godaddy hosting account with a database created using MYSQL. At least I set it up with a login and password and all.

Could someone give me step by step instructions on how to put all this together?

How many files with code in addition to the page including the form will I need uploaded to the server?

What code or scripts do I need and where does it go?

I realize this is alot to ask, but I have watched tutorial videos, I have two books, and made several visits to bookstores looking for the solution. This is a non-profit site if that matters 🙂

Thank you,

    If i understand correctly you need a register form with email field.

    Here how it goest...

    Here is the HTML code...
    <form action="register.php" method="post">
    Email address:<input type="text" name="email">
    <input type="submit" value="Registed">

    Here is the PHP code

    <?php

    if (isset($POST['email']) && !empty($POST['email'])){

       mysql_connect("localhost", "username", "password") or die(mysql_error());
       mysql_select_db("YourDatabase") or die(mysql_error());
    
       mysql_query("INSERT INTO MyTable
                              (email) VALUES('$_POST['email']') ") 
                              or die(mysql_error());  

    }

    ?>

    Try like this, but remember that this is just the example. You have a tones of examples on www.hotscripts.com eeg..!

    Good luck!

      Thanks tiborv

      I used the code and created the form and the register.php. I uploaded them and then tried it, but it didn't add to the database I created in Godaddy. I entered the 'user', 'password', and what I think is the 'localhost' along with the 'database name' and the 'table name'.

      I logged in to phpmyadmin through Godaddy and the info I inserted wasn't there.

      I may be using the wrong info for the "localhost". I'll speak with Godaddy and make sure I have the right info inserted.

      Thank you for taking the time to help me

        hi,

        when you use godaddy can you connect to your database via dreamweaver...if not then i would recommend a different host....

        i use siteground.com and they allow remote hosting - i.e. you can connect to the database through dreamweaver - by doing this it's a lot easier for dreamweaver to create the code... also you need to allow permissions i think to update the table - that might be an issue if you can only read from the table.

        You would set those up when you set up the database in the admin section.

          Write a Reply...