logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > General
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 01-11-2009, 05:39 PM   #1
kremo5le
kremo5le's Avatar
 
Join Date: Nov 2008
Location: San Diego, California
Posts: 112
Lightbulb Custom Form Email + Submit to db

Hello guys,

I have found posts on how to email a form and how to process it to include the fields within the database. However, I need both done, and so far I don't know what to do to how to email it (together with submitting it into the database). My form is a "registration.php" file and all the different connections to the database are done successfully.

What am I missing?

Here's the code:

Code:
<div class="lighttext" style="margin:20px">
        <h2>New Dealer Registration Form</h2>
          <form action="<?php echo $editFormAction; ?>" method="POST" name="registrationform" id="registrationform">
            <table width="560" border="0" cellspacing="5">
              <tr>
                <td width="253" class="lighttext"><div align="right">
                  <label><span class="lighttext">Business Name</span></label>
                </div></td>
                <td width="288"><div align="left">
                  <input name="businessname" type="text" id="businessname" size="25" maxlength="50">
                </div></td>
              </tr>
              <tr>
                <td class="lighttext"><div align="right">
                  <label class="lighttext">Contact Name</label>
                </div></td>
                <td><div align="left">
                <input name="username" type="text" id="username" size="25" maxlength="50">
                </div></td>
              </tr>
              <tr>
                <td class="lighttext"><div align="right">
                  <label class="lighttext">E-mail Address</label>
                </div></td>
                <td><div align="left">
                  <input name="emailaddress" type="text" id="emailaddress" size="25" maxlength="50">
</div></td>
              </tr>
              <tr>
                <td class="lighttext"><div align="right"><label>Create Password</label></div>                </td>
                <td><div align="left">
                  <input name="password" type="password" id="password" size="25" maxlength="12">
                </div></td>
              </tr>
              <tr>
                <td class="lighttext"><div align="right">
                  <label>Re-Enter Password</label>
                </div></td>
                <td><div align="left">
                  <input name="password2" type="password" id="password2" size="25" maxlength="12">
                </div></td>
              </tr>
              <tr>
                <td class="lighttext"><div align="right">
                  <label>Website Address</label>
                </div></td>
                <td><div align="left">
                  <input name="website" type="text" id="website" size="25" maxlength="50">
                </div></td>
              </tr>
              <tr>
                <td class="lighttext"><div align="right">
                  <label>Phone Number</label>
                </div></td>
                <td><div align="left">
                  <input name="phonenumber" type="text" id="phonenumber" size="25" maxlength="12">
                </div></td>
              </tr>
              <tr>
                <td class="lighttext"><div align="right">
                  <label>Fax Number</label>
                </div></td>
                <td><div align="left">
                  <input name="faxnumber" type="text" id="faxnumber" size="25" maxlength="12">
</div></td>
              </tr>
              <tr>
                <td class="lighttext"><div align="right">
                  <label>Address</label>
                </div></td>
                <td><div align="left">
                  <input name="address" type="text" id="address" size="25" maxlength="50">
</div></td>
              </tr>
              <tr>
                <td class="lighttext"><div align="right">
                  <label>City, State, Zip</label>
                </div></td>
                <td><div align="left">
                  <input name="citystatezip" type="text" id="citystatezip" size="25" maxlength="50">
</div></td>
              </tr>
              <tr>
                <td class="lighttext"><div align="right">
                  <label>Description of your business</label>
                </div></td>
                <td><div align="left">
                  <textarea name="description" cols="45" rows="10" id="description"></textarea>
</div></td>
              </tr>
              <tr>
                <td class="lighttext"><div align="right">
                  <label>How did you hear about Nutreve?</label>
                </div></td>
                <td><div align="left">
                  <textarea name="howhear" id="howhear" cols="45" rows="10"></textarea>
</div></td>
              </tr>
              <tr>
                <td class="lighttext"><div align="right">
                  <label>California Reseller Permit # (if applicable)</label>
                </div></td>
                <td><div align="left">
                  <input name="crp" type="text" id="crp" size="25" maxlength="10">
                </div></td>
              </tr>
              <tr>
                <td class="lighttext"><div align="right">
                  <label>
                  <input type="reset" name="reset" id="reset" value="Reset Form">
                  </label>
                </div></td>
                <td><div align="left">
                  <label>
                  <input type="submit" name="submit" id="submit" value="Open Account">
                  </label>
                </div></td>
              </tr>
              <tr>
                <td class="lighttext"><div align="right"></div></td>
                <td><div align="left"></div></td>
              </tr>
            </table>          
            <p>
              <input type="hidden" name="MM_insert" value="registrationform">
            </p>
          </form>
        </div>
kremo5le is offline   Reply With Quote
Old 01-12-2009, 01:10 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,176
Default

you show the action as
<?php echo $editFormAction; ?>
what ever that is of coursee I dont know, but the page that the action is pointed to must contain a mail handling script and an insert selection , it will one processed one after another. so the code for that might be better
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is online now   Reply With Quote
Old 01-12-2009, 04:13 PM   #3
kremo5le
kremo5le's Avatar
 
Join Date: Nov 2008
Location: San Diego, California
Posts: 112
Arrow Email + Submit in Database Form Problem

Quote:
Originally Posted by edbr View Post
you show the action as
<?php echo $editFormAction; ?>
what ever that is of coursee I dont know, but the page that the action is pointed to must contain a mail handling script and an insert selection , it will one processed one after another. so the code for that might be better
Hello there,

I'm using the database behaviors for this to work. I created the form and then I used this toll I'm mentioning. I don't think I need to create 2 files if one is doing the whole thing. Does that make sense?

What's the best way to add that piece of code my friend?

Thank you for your time!

kRem
kremo5le is offline   Reply With Quote
Old 01-13-2009, 12:28 AM   #4
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,176
Default

no 1 form wold do it. it will be processed from top to bottom. so if the action page should have your mail handling script which should 1st validate ,then have a mail() section for example to send the mail then collect the post vars, and use an insert statement and this will add the details you select to your database
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is online now   Reply With Quote
Old 01-14-2009, 02:56 AM   #5
kremo5le
kremo5le's Avatar
 
Join Date: Nov 2008
Location: San Diego, California
Posts: 112
Exclamation Email Form [SOLVED] + New Form Question

Quote:
Originally Posted by edbr View Post
no 1 form wold do it. it will be processed from top to bottom. so if the action page should have your mail handling script which should 1st validate ,then have a mail() section for example to send the mail then collect the post vars, and use an insert statement and this will add the details you select to your database
Hello there,

I actually had my PHP friend solve it for me. It wasn't as easy as I thought!

Moreover, I need to create a simple form in which the person using it can select product quantities from a drop down list (per product). The way it will work is having 13 areas, one for each product, where the customer will select a quantity and it will automatically start adding that to a total at the bottom to then be submitted via email.

What's be the best way to approach this new form?

kRem
kremo5le is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:20 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com