1. 34.

Contact

aangepast

Testje

35.
36. 37. aAan) > 1) 39. { 40. ?>55. 58. 59. aVelden as $iKey=>$aValue) { 46. $sVal = (isset($_POST[$iKey])) ? htmlspecialchars($_POST[$iKey]) : ''; 47. ?>
Aan:
:'.$sVal.''; 50. } 51. else { 52. echo ''; 53. } 54. ?>
60.
61. time()) 68. { $aErr[] = 'Om spam tegen te gaan kunt u slechts 1 maal e-mailen in '.$this->iSpam.' seconden.'; } 69. 70. foreach($this->aVelden as $iKey => $aVeld) { 71. if($this->aVelden[$iKey][1]==1) { 72. if(strlen(trim($_POST[$iKey])) == 0) 73. { $aErr[] = 'Je bent het veld '.$aVeld[0].' vergeten.'; } 74. } 75. } 76. 77. if(count($aErr)>0) { 78. echo 'Het volgende ging fout:'; 82. } 83. else { 84. if(count($this->aAan)==1) 85. { $sAan = $this->aAan[0][1]; } 86. else 87. { $sAan = $this->aAan[$_POST['iAan']][1]; } 88. 89. $sHeader = "To: ".$sAan."\r\n"; 90. $sHeader .= "From: ".$_POST[1]." <".$_POST[2].">\r\n"; 91. 92. $sMail = ''; 93. foreach($this->aVelden as $iKey => $aVeld) 94. { $sMail .= $aVeld[0].': '.$_POST[$iKey]."\n"; } 95. 96. if(!@mail($sAan,$this->sPrefix.$_POST[0],$sMail,$sHeader)) 97. { echo 'Mailen niet gelukt.';} 98. else 99. { 100. echo 'De mail is verzonden. '; 101. $_SESSION['iSpam'] = time()+$this->iSpam; 102. $this->bIsGelukt = true; 103. } 104. } 105. } 106. 107. function Contact() { 108. if($_SERVER['REQUEST_METHOD']=='POST') { 109. $this->Mailen(); 110. } 111. 112. if(!$this->bIsGelukt) { 113. $this->Formulier(); 114. } 115. } 116. } 117. ?> 118. 119. 120. 121. 122. 123. 124. 125. sPage = $_SERVER['PHP_SELF']; 128. $aClass->Contact(); 129. ?> 130.