Goedendag,

ik vroeg me even af of deze controle goed is (hij werkt):

<?php
	function check_field($naam, $field) {
		if (strlen($naam) < 3) {
			$error .= "- Your ".$field." should be atleast 3 characters long.";
			return false;
		}
		else {
			return true;
	}
	if ($_GET['send'] == "true") {
		$send = true;
		$error = 'A error occured when trying to send your mail. The following errors were found:<br>';
		$send = check_field($_POST['voornaam'], "first name");
		$send = check_field($_POST['achternaam'], "last name");
		$send = check_field($_POST['subject'], "subject");
		$send = check_field($_POST['message'], "message");
		$error .= '<br><br>Please try it again <a href="?page=contact">here</a>.';
?>

Oftewel, is dit netjes/slordig gescript? Just curious =)
Jawel, had alleen het verkeerde toegevoegd. Was net aan het editen =P

Reageren