logo-dw

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

Reply
 
Thread Tools Display Modes
Old 01-20-2012, 03:54 PM   #1
Heyokahaha
 
Join Date: Jan 2012
Location: Belguim
Posts: 8
Unhappy head is breaking over sending emailform in Dreamweaver to my email

Hello,

I am doing my websites with dreamweaver for a while and now because of working with a template I couldn't get my email buttons right, so I decided to build a contact form, this was very easy to do.
But then, and this is what I missed in the first googling I did, I wanted to SEND it to my email.

I tried googling, but really... my head is breaking over php.
In this moment I created a php file in my root folder. I adapted the properties of the form, renamed the action to the php file, and then... nothing happens AT ALL when I click the button. Where did I go wrong?

The contact form is here ;
http://www.companyenergetics.be/Contact.html

HTML Code:
<td width="100%" height="416"><form action="FormtoEmail.php" method="post" enctype="application/x-www-form-urlencoded" name="ContactForm" id="ContactForm">
                            <p class="style33">Uw gegevens : </p>
                            <table width="98%" border="0" cellspacing="5">
                              <tr>
                                <td height="34"><span class="style29">
                                  <label>Naam :
                                      <input type="text" name="textfield" />
                                  </label>
                                </span></td>
                                <td><span class="style29">
                                  <label>Email :
                                  <input type="text" name="textfield3" />
                                  </label>
                                </span></td>
                              </tr>
                              <tr>
                                <td height="44"><span class="style29">
                                  <label>Firma :
                                  <input type="text" name="textfield2" />
                                  </label>
                                </span></td>
                                <td><span class="style29">
                                  <label>Telefoon :
                                  <input type="text" name="textfield4" />
                                  </label>
                                </span></td>
                              </tr>
                            </table>
                            <p class="style31">
                              <label></label>
                              <span class="style34">.</span></p>
                            <p class="style31"><span class="style33">U wenst :</span> 
                              <label>
                              <br />
                              <input type="checkbox" name="checkbox" value="checkbox" />
                              <span class="style29">                              een offerte</span></label>
                              <span class="style29">
                              <label>
                              <input type="checkbox" name="checkbox2" value="checkbox" />
                              een inschrijving</label>
                              <label>
                              <input type="checkbox" name="checkbox3" value="checkbox" />
                              meer informatie</label>
                              </span></p>
                            <p class="style29">Voor de cursus :  
                      <label>
                              <input type="checkbox" name="checkbox4" value="checkbox" />
                              Company Energetics</label>
                              <label>
                              <input type="checkbox" name="checkbox5" value="checkbox" />
                              Body Energetics</label>
                            </p>
                            <p class="style29">Gegeven als: 
                              <label>
                              <input type="checkbox" name="checkbox6" value="checkbox" />
                              In Company Training </label>
                              <label>
                              <input type="checkbox" name="checkbox7" value="checkbox" />
                              Open Training </label>
                            </p>
                            <p class="style29">Datum : 
                            <input type="text" name="textfield5" />
                            </p>
                            <p class="style29">. </p>
                            <p class="style31">
                              <label><span class="style33">Vragen of opmerkingen : </span></label>
                            </p>
                            <p class="style31">
                              <textarea name="textarea" cols="70" rows="5" class="style31"></textarea>
                            </p>
                            </form>
 
and here is the php i was trying to adapt but now I am really having a headache and i am ready to throw my computer out of the window Please help...?

<?php
$my_email = "hilde.goris@heyokateljee.be";
$subject = 'Results from Contact form Energetics';
$emailadd = 'hilde.goris@heyokateljee.be';
$url = 'http://www.companyenergetics.be';

<?php
$text = "Results from form:ContactForm";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>

Thank you SO much in advance...

Hilde
Heyokahaha is offline   Reply With Quote
Old 01-20-2012, 04:13 PM   #2
Corrosive
Corrosive's Avatar
 
Join Date: Feb 2008
Location: Bristol, England
Posts: 7,103
Default

Have you checked the easy stuff like you have php on your server and your hosts allow the mail() function to be used? Some hosts disable mail() for security so you have to use SMTP.
Corrosive is offline   Reply With Quote
Old 01-21-2012, 01:33 AM   #3
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,175
Default

Put your submit button inside the form and it will work or it wont do anything
__________________
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 offline   Reply With Quote
Old 01-21-2012, 10:02 AM   #4
Heyokahaha
 
Join Date: Jan 2012
Location: Belguim
Posts: 8
Smile Yess!!!!

Tnx so much at least it is sent now....!!! I was looking over this one after all these hours doing very difficult stuff for me designer nitwit! It is working now and now I have to try to get the checkboxes renamed, so I can see what was indicated by the sender. The mail is saying now : checkbox4, 7... I know it is a bit lazy... but anyone willing to explain where I do this or where I find some clear instructions to rename the checkboxes in the php or html? I labeled them but the labeled name is not getting out...

I am SO happy already with this result!

Sun on your path, wind in the ailes,

Hilde
Heyokahaha is offline   Reply With Quote
Old 01-24-2012, 02:02 AM   #5
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,175
Default

in your form, if you give the checkboxes value a positive
ie
<input type="checkbox" name="offerte" value="ya!" />
if selected it will show
offerte: ya!
__________________
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 offline   Reply With Quote
Old 01-24-2012, 08:34 PM   #6
Heyokahaha
 
Join Date: Jan 2012
Location: Belguim
Posts: 8
Default

Hello
I was trying a little and I noticed that like this, the mail is indicating already the checked boxes, so I just renamed them... Tnx alot for your help, you made my day on friday!

Greetz,

Hilde
Heyokahaha is offline   Reply With Quote
Old 01-25-2012, 01:15 AM   #7
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,175
Default

welcome or welkom perhaps
__________________
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 offline   Reply With Quote
Old 01-25-2012, 08:15 AM   #8
Heyokahaha
 
Join Date: Jan 2012
Location: Belguim
Posts: 8
Default

Haha, you speak dutch We say 'graag gedaan' for this one
Heyokahaha is offline   Reply With Quote
Old 01-25-2012, 09:05 AM   #9
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,175
Default

i know my wife used to say that to me a long time ago now its kop dicht!
__________________
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 offline   Reply With Quote
Old 01-25-2012, 09:14 AM   #10
Heyokahaha
 
Join Date: Jan 2012
Location: Belguim
Posts: 8
Default

Hahahaha, kop dicht! You talk alot then If I would say this to my husband, the effect would be the other way around... he would get very mad
Heyokahaha 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:05 PM.


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