Hallo, ik ben bezig om een site die iemand anders heeft gemaakt te verhuizen naar een andere hoster.
In de site zitten o.a. een contact formulier en een bestellijst.
Als ik het contactformulier invul wordt deze netjes verzonden, echter als ik de bestellijst wil verzenden gebeurt er niet.
Ik heb de code even meegestuurd:

<h1> Bestellijst </h1>
<?php
function verstuur_mail($fromname, $fromaddress, $toname, $toaddress, $subject, $message)
{
//	echo($fromaddress);
	$headers  = "MIME-Version: 1.0\r\n"; 
	$headers .= "Content-Type: text/html; charset=ISO-8859-1 \r\n"; 
	$headers .= "From: ".$fromaddress." \r\n"; 
	$headers .= "Reply-to: {$fromaddress}\r\n"; 
	$headers .= "X-Priority: 3\r\n"; 
	$headers .= "X-Mailer: PHP mailer\r\n"; 
    return mail($toaddress, $subject, $message ,$headers) or die ( 'Fout bij het versturen v/d mail' ); 
}

switch($action){

case 'verwijder': 
	//het verwijderen
	$nieuwe_bestelling = "";
	$verwijder_id = $_GET['id'];	
	$productenArray = explode( ";", $_SESSION['Bestelling']);
	$numElementen = count($productenArray);
	for ($label = 0; $label < $numElementen; $label++ ) {
		
			
			if(!empty($verwijder_id) && $label == $verwijder_id){
			
			}else{
				if(!empty($productenArray[$label])){
					$product = geefProductMetid($productenArray[$label]);
				}
				$nieuwe_bestelling .= ';'.$product[id];
			}
		
	}
	$_SESSION['Bestelling'] = $nieuwe_bestelling;
	header("Location: http://www.gekkepoppen.nl/?site=bestellijst");
	break;

case 'post':
	
	$naam = $_POST['Naam'];
	$email = $_POST['Emailgebruiker'];
	
	$huurdatum = $_POST['huurdatum'];
	$afleveradres = $_POST['afleveradres'];
	$telefoonnumer = $_POST['telefoonnumer'];
		
	$opmerking = $_POST['Opmerking'];
	
	$totaaltekst.= "Naam: ".$naam."<br/>\n".
				   "E-mail adres: ".$email.
				   "<br/>\n"."Gewenste afleverdatum: ".$huurdatum.
				   "<br/>\n"."Afleveradres/afleverplaats: ".$afleveradres.
				   "<br/>\n"."Telefoonnummer: ".$telefoonnumer.
				   "<br/>\n"."Opmerking: ".$opmerking.
				   "<br/><br/><br/>\nBestelling:<br/>\n";
	

	$productenArray = explode( ";", $_SESSION['Bestelling']);
	$numElementen = count($productenArray);
	
	$totaaltekst.= '<table width="100%">
	<tr><th>Item</th><th align="center" width="65">Prijs</th><th align="center" width="65">Borg</th><th width="80"></th></tr>';
	
	
	for ($label = 0; $label < $numElementen; $label++ ) {
	
		if(!empty($productenArray[$label])){
		$product = geefProductMetid($productenArray[$label]);
		$totaaltekst .= ('<tr><td>'.$product[titel].'['.$product[artnr].']</td>
			<td align="right">&euro; '.number_format($product[prijs], 2, ',', '.').'</td>
			<td align="right">&euro; '.number_format($product[borg], 2, ',', '.').'</td></tr>');
	
			$prijstotaal = $prijstotaal + $product[prijs];
			$borgtotaal = $borgtotaal + $product[borg];
		}
		
	} 
	
	$totaal = $prijstotaal + $borgtotaal;
	
	$prijstotaal = number_format($prijstotaal , 2, ',', '.');
	$borgtotaal = number_format($borgtotaal , 2, ',', '.');
	$totaaltekst .= '<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>';
	$totaaltekst .= '<tr><td align="right"><strong>Subtotaal</strong></td><td align="right"><strong>&euro; '.$prijstotaal.'</strong></td><td align="right">&euro; '.$borgtotaal.'</td><td>&nbsp;</td></tr></table>';



 if(strlen($naam)==0){ 
        $error_msg[] = "U heeft uw naam niet ingevuld...<br/>"; 
    } 
    if((strlen($naam)!=0) && (strlen($naam) < 3)){ 
        $error_msg[] .= "Uw naam is niet correct ingevuld (min. 3 karakters)...<br/>"; 
    } 
   if(strlen($email)==0){ 
        $error_msg[] .= "U heeft uw mailadres niet ingevuld...<br/>"; 
    }

	if(strlen($huurdatum)==0){ 
        $error_msg[] .= "U heeft uw huurdatum niet ingevuld...<br/>"; 
    }
	if(strlen($afleveradres)==0){ 
        $error_msg[] .= "U heeft uw afleveradres niet ingevuld...<br/>"; 
    }
	if(strlen($telefoonnumer)==0){ 
        $error_msg[] .= "U heeft uw telefoonnummer niet ingevuld...<br/>"; 
    }
    
    
    if((strlen($email)!=0) && (!ereg("^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,5})$", $email))){ // email moet geldige constructie hebben, bv [email protected] (fout = . vooraan  alleen @, en .nl meer dan 3 caracters!) 
        $error_msg[] .= "Uw e-mailadres is niet correct ingevuld...<br/>"; 
    } 

if($error_msg){ // als dingen niet correct zijn ingevult 
        echo "Uw bestelling kon niet worden verzonden: <br/><br/>"; 
        for($i = 0, $j = 1; $i < 4; $i++, $j++){ 
            if($error_msg[$i]){ 
                echo $j . ". " . $error_msg[$i]; 
            } 
        } 
	echo "<br/>Ga <a href=javascript:history.go(-1)>terug</a> en probeer het opnieuw..."; 
}
else
{
	
	$bericht =  $totaaltekst;
	//$ontvanger_mail = "[email protected]";
	if(verstuur_mail($naam,$email,$ontvanger_naam,$ontvanger_mail,"Bestelling gekkepoppen!",$bericht)){
		echo("<br/>Uw bestelling is verzonden. Wij proberen uw aanvraag zo spoedig mogelijk te beantwoorden.<br/><br/>Heeft U ook aan de versiering gedacht? Deze kunnen wij tevens voor U meenemen.");
	
	$_SESSION['Bestelling'] = '';
	}else{
		echo("<br/><br/>Helaas is uw bestelling niet verzonden. Probeer het nog een keer.");
	}
	
}
	//print $totaaltekst;


	
	

break;

default:

	$totaaltekst= '<table width="100%">
	<tr><th>Item</th><th align="center" width="65">Prijs</th><th align="center" width="65">Borg</th><th width="80"></th></tr>';
	
	
	$productenArray = explode( ";", $_SESSION['Bestelling']);
	$numElementen = count($productenArray);
	
	if($numElementen >= 1){
	for ($label = 0; $label < $numElementen; $label++ ) {
	
		if(!empty($productenArray[$label])){
		$product = geefProductMetid($productenArray[$label]);
		$totaaltekst .= ('<tr><td><a href="?site=overzicht&Pid='.$productenArray[$label].'">'.$product[titel].'</a></td>
			<td align="right">&euro; '.number_format($product[prijs], 2, ',', '.').'</td>
			<td align="right">&euro; '.number_format($product[borg], 2, ',', '.').'</td>
			<td align="right"><a href="?site=bestellijst&action=verwijder&id='.$label.'">Verwijder</a></td></tr>');
	
			$prijstotaal = $prijstotaal + $product[prijs];
			$borgtotaal = $borgtotaal + $product[borg];
		}
		
	} 
	
	$totaal = $prijstotaal + $borgtotaal;
	
	$prijstotaal = number_format($prijstotaal , 2, ',', '.');
	$borgtotaal = number_format($borgtotaal , 2, ',', '.');
	$totaaltekst .= '<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>';
	$totaaltekst .= '<tr><td align="right"><strong>Subtotaal</strong></td><td align="right"><strong>&euro; '.$prijstotaal.'</strong></td><td align="right">&euro; '.$borgtotaal.'</td><td>&nbsp;</td>';
	//print '<tr><td align="right">Totaal borg</td><td align="right">'.$borgtotaal.'</td><td>&nbsp;</td><td>&nbsp;</td>';
	//print '<tr><td align="right"><strong>Totaal</strong></td><td align="right"><strong>'.$totaal.'</strong></td><td>&nbsp;</td><td>&nbsp;</td>';
	print $totaaltekst;


	
	?>
	
	</table>
	<form method="post" action="http://www.gekkepoppen.nl/?site=bestellijst&action=post" class="stijl">
	<fieldset>
	<legend>Gegevens</legend>
	<label for="naam">Naam: </label>
	<input id="naam" name="Naam" size="28" title="Vul hier uw naam in..." /><br />
	<label for="Emailgebruiker">E-mail Adres: </label>
	<input id="Emailgebruiker" name="Emailgebruiker" title="Vul hier uw e-mail adres in..." size="28"/><br />
	
	<label for="huurdatum">Gewenste afleverdatum: </label>
	<input id="huurdatum" name="huurdatum" title="Vul hier uw e-mail huurdatum in..." size="28"/><br />
	<label for="afleveradres">Afleveradres/afleverplaats: </label>
	<input id="afleveradres" name="afleveradres" title="Vul hier uw afleveradres adres in..." size="28"/><br />
	<label for="telefoonnumer">Telefoonnummer: </label>
	<input id="telefoonnumer" name="telefoonnumer" title="Vul hier uw telefoonnumer adres in..." size="28"/><br />
	
	<label for="Opmerking">Opmerking: </label>
	<input id="Opmerking" name="Opmerking" title="Vul hier een eventuele in..." size="28"/><br />
	
	<p><input name="Submit" type="submit" id="Submit" value="Bestellen"></input></p>

	</fieldset>
	</form>
	
<?php
	}else{
		print 'Er zijn geen items in de bestellijst';
	}
}

?>


Zet error_reporting(E_ALL) eens aan.
De function ereg() is antiek.
Ook zijn de mailheaders niet correct.
hallo SanThe,
mijn kennis gaat niet zover.

Ik was inderdaad vergeten te vermelden dat de site al oud is en niet goed werkt op php 5.3
Het probleem is dat ik niet zo snel een nieuwe site kan lanceren en deze site nog graag wil laten draaien totdat de nieuwe site gereed is.

als ik de errors aanzet krijg ik deze meldingen:
Notice: Undefined variable: action in /var/www/vhosts/gekkepoppen.nl/httpdocs/content/bestellijst.php on line 20

Notice: Undefined variable: action in /var/www/vhosts/gekkepoppen.nl/httpdocs/content/bestellijst.php on line 43

Notice: Use of undefined constant id - assumed 'id' in /var/www/vhosts/gekkepoppen.nl/httpdocs/includes/functions.php on line 59

Notice: Use of undefined constant titel - assumed 'titel' in /var/www/vhosts/gekkepoppen.nl/httpdocs/includes/functions.php on line 60

Notice: Use of undefined constant omschrijving - assumed 'omschrijving' in /var/www/vhosts/gekkepoppen.nl/httpdocs/includes/functions.php on line 61

Notice: Use of undefined constant afbeelding - assumed 'afbeelding' in /var/www/vhosts/gekkepoppen.nl/httpdocs/includes/functions.php on line 62

Notice: Use of undefined constant artnr - assumed 'artnr' in /var/www/vhosts/gekkepoppen.nl/httpdocs/includes/functions.php on line 63

Notice: Use of undefined constant prijs - assumed 'prijs' in /var/www/vhosts/gekkepoppen.nl/httpdocs/includes/functions.php on line 64

Notice: Use of undefined constant borg - assumed 'borg' in /var/www/vhosts/gekkepoppen.nl/httpdocs/includes/functions.php on line 65

Notice: Use of undefined constant titel - assumed 'titel' in /var/www/vhosts/gekkepoppen.nl/httpdocs/content/bestellijst.php on line 163

Notice: Use of undefined constant prijs - assumed 'prijs' in /var/www/vhosts/gekkepoppen.nl/httpdocs/content/bestellijst.php on line 164

Notice: Use of undefined constant borg - assumed 'borg' in /var/www/vhosts/gekkepoppen.nl/httpdocs/content/bestellijst.php on line 165

Notice: Use of undefined constant prijs - assumed 'prijs' in /var/www/vhosts/gekkepoppen.nl/httpdocs/content/bestellijst.php on line 168

Notice: Undefined variable: prijstotaal in /var/www/vhosts/gekkepoppen.nl/httpdocs/content/bestellijst.php on line 168

Notice: Use of undefined constant borg - assumed 'borg' in /var/www/vhosts/gekkepoppen.nl/httpdocs/content/bestellijst.php on line 169

Notice: Undefined variable: borgtotaal in /var/www/vhosts/gekkepoppen.nl/httpdocs/content/bestellijst.php on line 169

Notice: Use of undefined constant id - assumed 'id' in /var/www/vhosts/gekkepoppen.nl/httpdocs/includes/functions.php on line 59

Notice: Use of undefined constant titel - assumed 'titel' in /var/www/vhosts/gekkepoppen.nl/httpdocs/includes/functions.php on line 60

Notice: Use of undefined constant omschrijving - assumed 'omschrijving' in /var/www/vhosts/gekkepoppen.nl/httpdocs/includes/functions.php on line 61

Notice: Use of undefined constant afbeelding - assumed 'afbeelding' in /var/www/vhosts/gekkepoppen.nl/httpdocs/includes/functions.php on line 62

Notice: Use of undefined constant artnr - assumed 'artnr' in /var/www/vhosts/gekkepoppen.nl/httpdocs/includes/functions.php on line 63

Notice: Use of undefined constant prijs - assumed 'prijs' in /var/www/vhosts/gekkepoppen.nl/httpdocs/includes/functions.php on line 64

Notice: Use of undefined constant borg - assumed 'borg' in /var/www/vhosts/gekkepoppen.nl/httpdocs/includes/functions.php on line 65

Notice: Use of undefined constant titel - assumed 'titel' in /var/www/vhosts/gekkepoppen.nl/httpdocs/content/bestellijst.php on line 163

Notice: Use of undefined constant prijs - assumed 'prijs' in /var/www/vhosts/gekkepoppen.nl/httpdocs/content/bestellijst.php on line 164

Notice: Use of undefined constant borg - assumed 'borg' in /var/www/vhosts/gekkepoppen.nl/httpdocs/content/bestellijst.php on line 165

Notice: Use of undefined constant prijs - assumed 'prijs' in /var/www/vhosts/gekkepoppen.nl/httpdocs/content/bestellijst.php on line 168

Notice: Use of undefined constant borg - assumed 'borg' in /var/www/vhosts/gekkepoppen.nl/httpdocs/content/bestellijst.php on line 169


iemand een idee hoe ik dit op kan lossen?

Reageren