Contact formulier werkt neit

Gestart doorRogier11 reacties40 weergaven

12 berichten · pagina 1 van 1

Rogier

Lid · Topicstarter

Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
hey weten jullie waarom deze code niet werkt? ik krijg geen error maar ook geen mailtje.

[COLOR= #0000BB]<?php
$wie[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aan[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verzenden[/COLOR][COLOR= #007700]]) {[/COLOR]
  [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$wie[/COLOR][COLOR= #007700]) {
  }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [COLOR= #0000BB]$naar[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$wie[/COLOR][COLOR= #007700]; }[/COLOR]
  [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"From:"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$reply[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
  [URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$naar[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$onderwerp[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$headers[/COLOR][COLOR= #007700]);[/COLOR]
  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je bericht is sucsesvol verzonden!"[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
?>
<form name="contact" method="post" action="">
<table width="90%"  border="0" cellspacing="0" cellpadding="0">
  <tr bgcolor="#TRANSPA">
    <td colspan="2">&nbsp;</td>
  </tr>
[COLOR= #0000BB]<?[/COLOR]
  [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$wie[/COLOR][COLOR= #007700]) {[/COLOR]
?>  
  <tr>
    <td>Aan:</td>
    <td>
      <select name="naar">
            <option value="voeding@goedinvorm-voordorp.nl">Lette Doornbos</option>
        <option value="sport@goedinvorm-voordorp.nl">Karen van Ewijk</option>
        <option value="Rogierfischer@live.nl">Rogier Fischer (websitebeheerder)</option>

      </select>
    </td>
  </tr>
[COLOR= #0000BB]<?[/COLOR]
  [COLOR= #007700]}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"
  <tr>
    <td>Aan:</td>
    <td><b>$wie</b></td>
  </tr>"[/COLOR][COLOR= #007700]; }[/COLOR]
?>  
  <tr>
    <td width="30%">Onderwerp:</td>
    <td width="70%">
      <input type="text" name="onderwerp">
    </td>
  </tr>  <tr>
    <td valign="top">Je e-mail:</td>
    <td>
      <input type="text" name="reply">
    </td>
  </tr>  
  </tr>  
  <tr>
    <td valign="top">Bericht:</td>
    <td>
      <textarea name="bericht" cols="50" rows="6"></textarea>
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <input type="submit" name="verzenden" value="Verzenden">
      <input type="reset" name="reset" value="Wissen">
    </td>
  </tr>  
</table></form>
[COLOR= #0000BB]<?[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
0
Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik heb weinig ervaring/verstand van php hoor.
maar ben je neit een paar keer: ;
vergeten? bv bij: regel 3

en heb je alles goed geschreven en goed afgesloten/geopend
0
Rogier

Lid · Topicstarter

Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
voor zover ik weet wordt een ifje afgesloten met een } die je terug kan vinden op regelnr 9
0
Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
het zijn ook maar suggestieswink.
ps: van dit soort topic: probeer ik ook telerenwink
0
Rogier

Lid · Topicstarter

Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
oke, iemand anders een idee?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
$bericht en $onderwerp bestaan (nog) niet?
0
Rogier

Lid · Topicstarter

Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
KAn ej gelijk een suggestie doen hoe het wel moet? emo
Als het werkt wil ik je best een vergoeding geven.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$onderwerp[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderwerp[/COLOR][COLOR= #007700]];[/COLOR]
?>
0
Rogier

Lid · Topicstarter

Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
mijn kennis van php is 0,1 dus ik snap niet wat je bedoelt als je dat plaatst. Ik ben ook wel eens lui maar is het echt zoveel werk om te zeggen waar ik die twee regels meot neerdumpen? yummie
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
vervang:

[COLOR= #0000BB]<?php
$wie[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aan[/COLOR][COLOR= #007700]];[/COLOR]


in:

[COLOR= #0000BB]<?php
$wie[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aan[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$onderwerp[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderwerp[/COLOR][COLOR= #007700]];[/COLOR]
0
Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Maakt niet uit, je moet gewoon zorgen dat die twee strings ($) bestaan, en dan kan je er zelf voor kiezen of je een standaard onderwerp meegeeft of bijv. iets uit een database haalt.

[COLOR= #0000BB]<?php

$wie[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aan[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$naar[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$onderwerp[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderwerp[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email_form_bericht[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"From:"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$reply[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verzenden[/COLOR][COLOR= #007700]]) {[/COLOR]
  [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$wie[/COLOR][COLOR= #007700]) {
  }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [COLOR= #0000BB]$naar[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$wie[/COLOR][COLOR= #007700]; }[/COLOR]
  
  [URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$naar[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$onderwerp[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$headers[/COLOR][COLOR= #007700]);[/COLOR]

  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je bericht is sucsesvol verzonden!"[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
?>
<form name="contact" method="post" action="">
<table width="90%"  border="0" cellspacing="0" cellpadding="0">
  <tr bgcolor="#TRANSPA">
    <td colspan="2">&nbsp;</td>
  </tr>
[COLOR= #0000BB]<?[/COLOR]
  [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$wie[/COLOR][COLOR= #007700]) {[/COLOR]
?>  
  <tr>
    <td>Aan:</td>
    <td>
      <select name="naar">
            <option value="voeding@goedinvorm-voordorp.nl">Lette Doornbos</option>
        <option value="sport@goedinvorm-voordorp.nl">Karen van Ewijk</option>
        <option value="Rogierfischer@live.nl">Rogier Fischer (websitebeheerder)</option>

      </select>
    </td>
  </tr>
[COLOR= #0000BB]<?[/COLOR]
  [COLOR= #007700]}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"
  <tr>
    <td>Aan:</td>
    <td><b>$wie</b></td>
  </tr>"[/COLOR][COLOR= #007700]; }[/COLOR]
?>  
  <tr>
    <td width="30%">Onderwerp:</td>
    <td width="70%">
      <input type="text" name="onderwerp">
    </td>
  </tr>  <tr>
    <td valign="top">Je e-mail:</td>
    <td>
      <input type="text" name="reply">
    </td>
  </tr>  
  </tr>  
  <tr>
    <td valign="top">Bericht:</td>
    <td>
      <textarea name="bericht" cols="50" rows="6"></textarea>
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <input type="submit" name="verzenden" value="Verzenden">
      <input type="reset" name="reset" value="Wissen">
    </td>
  </tr>  
</table></form>
[COLOR= #0000BB]<?[/COLOR]
[COLOR= #007700]}[/COLOR]
?>


Zoiets?

Moet je zelf nog wel even nakijken wat je doet met $reply.
0
Berichten
9.969
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verzenden[/COLOR][COLOR= #007700]])){[/COLOR]
    [COLOR= #0000BB]$naar[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naar[/COLOR][COLOR= #007700]];[/COLOR]
    [COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]];[/COLOR]
    [COLOR= #0000BB]$onderwerp[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderwerp[/COLOR][COLOR= #007700]];[/COLOR]
    [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700]=[/COLOR]    [COLOR= #DD0000]"From: "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]reply[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"rn"[/COLOR] [COLOR= #007700].[/COLOR]
            [COLOR= #DD0000]X-Mailer: PHP/[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/phpversion"]phpversion[/URL][COLOR= #007700]() .[/COLOR] [COLOR= #DD0000]"rn"[/COLOR] [COLOR= #007700].[/COLOR]
            [COLOR= #DD0000]"MIME-Version: 1.0rn"[/COLOR] [COLOR= #007700].[/COLOR]
            [COLOR= #DD0000]"Content-Type: text/html; charset=utf-8rn"[/COLOR] [COLOR= #007700].[/COLOR]
            [COLOR= #DD0000]"Content-Transfer-Encoding: 8bitrnrn"[/COLOR][COLOR= #007700];[/COLOR]
  [URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$naar[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$onderwerp[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$headers[/COLOR][COLOR= #007700]);[/COLOR]
  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je bericht is sucsesvol verzonden!"[/COLOR][COLOR= #007700];
  }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
?>
<form name="contact" method="post" action="">
<table width="90%"  border="0" cellspacing="0" cellpadding="0">
  <tr bgcolor="#TRANSPA">
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td>Aan:</td>
    <td>
      <select name="naar">
            <option value="spam@relisten.nl">Lette Doornbos</option>
        <option value="sport@goedinvorm-voordorp.nl">Karen van Ewijk</option>
        <option value="Rogierfischer@live.nl">Rogier Fischer (websitebeheerder)</option>

      </select>
    </td>
  </tr>
  <tr>
    <td width="30%">Onderwerp:</td>
    <td width="70%">
      <input type="text" name="onderwerp">
    </td>
  </tr>  <tr>
    <td valign="top">Je e-mail:</td>
    <td>
      <input type="text" name="reply">
    </td>
  </tr>  
  </tr>  
  <tr>
    <td valign="top">Bericht:</td>
    <td>
      <textarea name="bericht" cols="50" rows="6"></textarea>
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <input type="submit" name="verzenden" value="Verzenden">
      <input type="reset" name="reset" value="Wissen">
    </td>
  </tr>  
</table></form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?>


jou opzet gehouden, als het goed is werkt die nu.

edit:
zo krijg je wel onzettend veel spam als je je email al zo online zet...
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren