Website Coding Stuck on a line of code? Find resources and ask your virtual assistant website programming questions here.
Forum Sponsor (Advertise with us)
Reply
 
Thread Tools Display Modes
    #1 (permalink)  
Old 07-08-2009
CherishR's Avatar
Contributing Member
Company name: Have Your Own Assistant
 
Join Date: Jan 2009
Location: Grand Prairie, TX
Posts: 83
Default Dreamweaver code
I have a form created in Dreamweaver. My question is: WHERE in the code do I put in where do I put my address to have the info come to me? Here is what I have. Thank you in advanced!

<tr>
<td class="bodyText">
<form id="form1" name="form1" method="post" action="">
Name:
<input type="text" name="Name" id="Name" />
<label for="Name"></label>
<br />
Email:
<input type="text" name="Email" id="Email" />
<label for="Email"></label>
<br />
Comments:
<textarea name="Comments" id="Comments"></textarea>
<label for="Comments"></label>
<p>&nbsp;</p>
<p>
<input type="submit" name="Submitt" id="Submitt" value="Submit" />
</p>
</form>
<p class="style4">&nbsp;</p> </td>
</tr>
</table>
*<br />
&nbsp;<br /> </td>
<td valign="top">&nbsp;</td>
<td width="100%">&nbsp;</td>
</tr>

<tr>
<td width="15">&nbsp;</td>
<td width="140">&nbsp;</td>
<td width="505">&nbsp;</td>
<td width="100">&nbsp;</td>
<td width="100%">&nbsp;</td>
</tr>
</table>
Reply With Quote
    #2 (permalink)  
Old 07-08-2009
Codehead's Avatar
Administrator
Company name: Codehead LLP
 
Join Date: Apr 2007
Location: WA
Posts: 173
Default Re: Dreamweaver code
You need a from processor, a server side script to send you the info, if your hosting package supports PHP then put this all the way on top of your code:

PHP Code:
<?php
if (!empty($_POST)) {
   
$email 'YOUR EMAIL ADDRESS'/* EDIT THIS */
   
$subject 'From contact form';
   
$body '';
   
$fields = array('Name''Email''Comments');
   
$valid true;
   foreach (
$fields as $field) {
       
$value trim(strip_tags($_POST[$field]));
       if (
$value == '') {
           echo 
$field .' can\'t be empty.<br />';
           
$valid false;
       }
       
$body .= $field .': ' .$value .'<br />';
   }
   if (
$valid) {
      
mail($email$subject$body);
      echo 
'Thanks, we will reply as soon as possible.';
   }
}
?>
I hope this helps
__________________
"Imagination is more important than knowledge."
Albert Einstein
Reply With Quote
    #3 (permalink)  
Old 07-08-2009
CherishR's Avatar
Contributing Member
Company name: Have Your Own Assistant
 
Join Date: Jan 2009
Location: Grand Prairie, TX
Posts: 83
Red face Re: Dreamweaver code
I will give it a TRY! Thanks! My brain is mush, so I will let you know if I get it!
Reply With Quote
    #4 (permalink)  
Old 07-08-2009
CherishR's Avatar
Contributing Member
Company name: Have Your Own Assistant
 
Join Date: Jan 2009
Location: Grand Prairie, TX
Posts: 83
Default Re: Dreamweaver code
When you say way at the top, where do I insert it?? Sorry for being such a pain.

<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>Form try</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="mm_lodging1.css" type="text/css" />
<style type="text/css">
<!--
.style1 {color: #336666}
.style3 {color: #FFFFFF}
.style4 {font-size: 12px}
.style7 { color: #FFFFFF;
font-size: 10px;
}
.style7 {font-size: 12}
.style8 {letter-spacing:.1em; font: 10px arial;}
-->
</style>
</head>
<body bgcolor="#3d5764">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15" nowrap="nowrap">&nbsp;</td>
<td height="60" colspan="3" nowrap="nowrap" class="logo style3">Have Your Own Assistant<br />
<span class="style6 style8">&quot;Let my Virtual Office take the office Administration out of your office&quot;</span><span class="style3"><span class="style7"><br/>
</span></span></td>
<td width="100%">&nbsp;</td>
</tr>

<tr bgcolor="#ffffff">
<td colspan="5"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>

<tr bgcolor="#a4c2c2">
<td width="15" nowrap="nowrap">&nbsp;</td>
<td height="36" colspan="2" id="navigation" class="navText"><span class="style1"><a href="index.html">HOME</a></span>&nbsp;&nbsp;&nbsp;&nbsp;& nbsp; <a href="What is a VA.html">WHAT IS A VA?</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbs p; <a href="Why Hire a VA.html">WHY HIRE A VA?</a>&nbsp; &nbsp; <a href="What I Can Do.html">WHAT I CAN DO</a>&nbsp; &nbsp;&nbsp; <a href="About Me.html">ABOUT ME</a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="Contact Us.html">CONTACT</a></td>
<td>&nbsp;</td>
<td width="100%">&nbsp;</td>
</tr>

<tr bgcolor="#ffffff">
<td colspan="5"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>

<tr bgcolor="#ffffff">
<td valign="top" width="15"><img src="mm_spacer.gif" alt="" width="15" height="1" border="0" /></td>
<td valign="top" width="140"><img src="mm_spacer.gif" alt="" width="140" height="1" border="0" /></td>
<td width="505" valign="top"><br />
<table border="0" cellspacing="0" cellpadding="2" width="440">
<tr>
<td class="pageName">Form trying</td>
</tr>

<tr>
<td class="bodyText">

<form id="form1" name="form1" method="post" action="">
Name:
<input type="text" name="Name" id="Name" />
<label for="Name"></label>
<br />
Email:
<input type="text" name="Email" id="Email" />
<label for="Email"></label>
<br />
Comments:
<textarea name="Comments" id="Comments"></textarea>
<label for="Comments"></label>
<p>&nbsp;</p>
<p>
<input type="submit" name="Submitt" id="Submitt" value="Submit" />
</p>
</form>
<p class="style4">&nbsp;</p> </td>
</tr>
</table>
*<br />
&nbsp;<br /> </td>
<td valign="top">&nbsp;</td>
<td width="100%">&nbsp;</td>
</tr>

<tr>
<td width="15">&nbsp;</td>
<td width="140">&nbsp;</td>
<td width="505">&nbsp;</td>
<td width="100">&nbsp;</td>
<td width="100%">&nbsp;</td>
</tr>
</table>
</body>
</html>
Reply With Quote
    #5 (permalink)  
Old 07-08-2009
Codehead's Avatar
Administrator
Company name: Codehead LLP
 
Join Date: Apr 2007
Location: WA
Posts: 173
Default Re: Dreamweaver code
Put it right after <td class="bodyText"> before the form...
__________________
"Imagination is more important than knowledge."
Albert Einstein
Reply With Quote
    #6 (permalink)  
Old 07-08-2009
Codehead's Avatar
Administrator
Company name: Codehead LLP
 
Join Date: Apr 2007
Location: WA
Posts: 173
Default Re: Dreamweaver code
I also changed the code a bit so it can be where I suggested, be sure to copy and paste it now.
__________________
"Imagination is more important than knowledge."
Albert Einstein
Reply With Quote
    #7 (permalink)  
Old 07-08-2009
CherishR's Avatar
Contributing Member
Company name: Have Your Own Assistant
 
Join Date: Jan 2009
Location: Grand Prairie, TX
Posts: 83
Default Re: Dreamweaver code
You ROCK!! I don't know if anybody has told you that before!!! Thanks! I will Def try later. My head is Totally Spinning. Time to get the kid up from his nap anyway! CRAP, 3 hours. So much for going to bed on time tonight!!
Reply With Quote
    #8 (permalink)  
Old 07-08-2009
Business-Bytes's Avatar
Resident Member
Company name: SunRise Virtual Solutions
 
Join Date: Jun 2009
Location: Iowa
Posts: 1,045
Blog Entries: 1
Send a message via Skype™ to Business-Bytes
Default Re: Dreamweaver code
Just in case be sure to replace 'YOUR EMAIL ADDRESS' with your actual email address (including the single quotes):
Quote:
$email = 'YOUR EMAIL ADDRESS'; /* EDIT THIS */
__________________
Jules, SunRise Virtual Solutions - WordPress Customization & XHTML/CSS Web Sites
Reply With Quote
    #9 (permalink)  
Old 07-09-2009
CherishR's Avatar
Contributing Member
Company name: Have Your Own Assistant
 
Join Date: Jan 2009
Location: Grand Prairie, TX
Posts: 83
Default Re: Dreamweaver code
I am loosing my mind!

this is what I get right above my form and under the title of the page Form Trying is the Header in the page:

Form trying
Go back'; exit(); } $body .= $field .': ' .$value .'
'; } mail($email, $subject, $body); } ?>

(then the form actually begins)

this is part of the code: what am I doing wrong???? Red is the php part

<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>Form try</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="mm_lodging1.css" type="text/css" />
<style type="text/css">
<!--
.style1 {color: #336666}
.style3 {color: #FFFFFF}
.style4 {font-size: 12px}
.style7 { color: #FFFFFF;
font-size: 10px;
}
.style7 {font-size: 12}
.style8 {letter-spacing:.1em; font: 10px arial;}
-->
</style>
</head>
<body bgcolor="#3d5764">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15" nowrap="nowrap">&nbsp;</td>
<td height="60" colspan="3" nowrap="nowrap" class="logo style3">Have Your Own Assistant<br />
<span class="style6 style8">&quot;Let my Virtual Office take the office Administration out of your office&quot;</span><span class="style3"><span class="style7"><br/>
</span></span></td>
<td width="100%">&nbsp;</td>
</tr>

<tr bgcolor="#ffffff">
<td colspan="5"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>

<tr bgcolor="#a4c2c2">
<td width="15" nowrap="nowrap">&nbsp;</td>
<td height="36" colspan="2" id="navigation" class="navText"><span class="style1"><a href="index.html">HOME</a></span>&nbsp;&nbsp;&nbsp;&nbsp;& nbsp; <a href="What is a VA.html">WHAT IS A VA?</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbs p; <a href="Why Hire a VA.html">WHY HIRE A VA?</a>&nbsp; &nbsp; <a href="What I Can Do.html">WHAT I CAN DO</a>&nbsp; &nbsp;&nbsp; <a href="About Me.html">ABOUT ME</a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="Contact Us.html">CONTACT</a></td>
<td>&nbsp;</td>
<td width="100%">&nbsp;</td>
</tr>

<tr bgcolor="#ffffff">
<td colspan="5"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>

<tr bgcolor="#ffffff">
<td valign="top" width="15"><img src="mm_spacer.gif" alt="" width="15" height="1" border="0" /></td>
<td valign="top" width="140"><img src="mm_spacer.gif" alt="" width="140" height="1" border="0" /></td>
<td width="505" valign="top"><br />
<table border="0" cellspacing="0" cellpadding="2" width="440">
<tr>
<td class="pageName">Form trying</td>
</tr>

<tr>
<td class="bodyText">
<?php
if (!empty($_POST)) {
$email = 'cherishroundstream@sbcglobal. net';
$subject = 'From contact form';
$body = '';
$fields = array('Name', 'Email', 'Comments');
foreach ($fields as $field) {
$value = trim(strip_tags($_POST[$field]));
if ($value == '') {
echo $field .' can\'t be empty. <a href="javascript:history.go(-1);">Go back</a>';
exit();
}
$body .= $field .': ' .$value .'<br />';
}
mail($email, $subject, $body);
}
?>
<form id="form1" name="form1" method="post" action="">
Name:
<input type="text" name="Name" id="Name" />
<label for="Name"></label>
<br />
Email:
<input type="text" name="Email" id="Email" />
<label for="Email"></label>
<br />
Comments:
<textarea name="Comments" id="Comments"></textarea>
<label for="Comments"></label>
<p>&nbsp;</p>
<p>
<input type="submit" name="Submitt" id="Submitt" value="Submit" />
</p>
</form>
<p class="style4">&nbsp;</p> </td>
</tr>
</table>
*<br />
&nbsp;<br /> </td>
<td valign="top">&nbsp;</td>
<td width="100%">&nbsp;</td>
</tr>

<tr>
<td width="15">&nbsp;</td>
<td width="140">&nbsp;</td>
<td width="505">&nbsp;</td>
<td width="100">&nbsp;</td>
<td width="100%">&nbsp;</td>
</tr>
</table>
</body>
</html>
Reply With Quote
    #10 (permalink)  
Old 07-09-2009
Codehead's Avatar
Administrator
Company name: Codehead LLP
 
Join Date: Apr 2007
Location: WA
Posts: 173
Default Re: Dreamweaver code
So your hosting package doesn't support PHP, you could try using a free service, or you could try upgrading your hosting package...
__________________
"Imagination is more important than knowledge."
Albert Einstein
Reply With Quote
    #11 (permalink)  
Old 07-09-2009
Business-Bytes's Avatar
Resident Member
Company name: SunRise Virtual Solutions
 
Join Date: Jun 2009
Location: Iowa
Posts: 1,045
Blog Entries: 1
Send a message via Skype™ to Business-Bytes
Default Re: Dreamweaver code
Can you copy and paste the original code in your page? There is a reference to javascript and other code that is different, so that could be part of the problem.

Also, I wonder if the <form action="" needs to have an entry? Maybe not, but thought I would throw this out there. The forms that I do, I have the php in its own file named "feedback.php," so my code is: <form action="feedback.php" method="post"> and it calls the php file to execute my forms. And the actual page that has the php code is named form.php. I have CAPTCHA on mine, too, but that isn't something that everyone does.

Here's an example of a request form from a roofing co site I did: http://www.hsroofingco.com/form.php If you click the submit button without entering all the required info, a page will pop up and tell ya. It's a little separate HTML page - also a little HTML page comes up if they submit everything perfectly and they can go back to the home page from there. If you try it out, PLEASE don't fill out the form correctly, because it will go to the owners of the company - and they might not appreciate that! You can click the submit button without filling anything out.

ETA: Codehead could be right about your host.
__________________
Jules, SunRise Virtual Solutions - WordPress Customization & XHTML/CSS Web Sites
Reply With Quote
    #12 (permalink)  
Old 07-09-2009
Codehead's Avatar
Administrator
Company name: Codehead LLP
 
Join Date: Apr 2007
Location: WA
Posts: 173
Default Re: Dreamweaver code
<form action="" means that the form is self processing; the form and the code that sends the email are in the same file...
__________________
"Imagination is more important than knowledge."
Albert Einstein
Reply With Quote
    #13 (permalink)  
Old 07-09-2009
Business-Bytes's Avatar
Resident Member
Company name: SunRise Virtual Solutions
 
Join Date: Jun 2009
Location: Iowa
Posts: 1,045
Blog Entries: 1
Send a message via Skype™ to Business-Bytes
Default Re: Dreamweaver code
Originally Posted by Codehead View Post
<form action="" means that the form is self processing; the form and the code that sends the email are in the same file...
Thank you - that clarified that for me!
__________________
Jules, SunRise Virtual Solutions - WordPress Customization & XHTML/CSS Web Sites
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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Question] Dreamweaver Website Software Kathya Website Coding 6 05-29-2009 03:03 AM
submit button in Dreamweaver CherishR Website Coding 3 04-11-2009 06:24 PM
Help with Dreamweaver and Fireworks? Virtual Roadie General Website Design and Development 6 02-24-2009 03:58 PM
Dreamweaver & KompoZer compatibility Patsy General Website Design and Development 5 10-13-2008 04:29 AM
Dreamweaver Help eve_k0802 General Website Design and Development 2 04-29-2008 09:36 PM


All times are GMT -4. The time now is 10:49 PM.

International Virtual Assistants Association
Project Management for Virtual Assistants
Virtual Assistant Forums Advertising
Virtual Assistant Directory
Create a Professional New Client Welcome Packet
Virtual Assistant Forums Advertising
Virtual Assistant Contracts
Virtual Assistant Services
Affordable Website Hosting
Work from Home | Become A Virtual Assistant
Affordable Logo Design
Virtual Assistant Forums Advertising
Small Business Resources

© Virtual Assistant Forums 2012
All content and images are protected under copyright law and may not be reproduced in any way without express written consent.