Jump to content

[SOLVED] Checkbox and email form


iciman

Recommended Posts

I have wrote a multi checkbox form that sends the list to me via email. I receive the email ok with the list, but the website gives an error message:

 

Notice: Undefined variable: ch

 

the code:

 

<?php

foreach($_POST['checkbox'] as $value) {

$ch .= "Checked: $value\n";                <--------------the error refers to this line

}

 

$adi=$_POST["name"];

$name=ucwords($adi);

$un=$_POST["unvan"];

$email=$_POST["email"];

$tel=$_POST["tel"];

$remarks=$_POST["remarks"];

$sebep="Maxi Pack Request";

$bana="info@xxxxxx";

?>

      <?

$mesaj  ="Unvani: " .$un. "\n";

$mesaj .="Full Name: " .$name. "\n";

$mesaj .="Email: " .$email. "\n";

$mesaj .="Telephone Number: " .$tel. "\n";

$mesaj .="Checked: " .$ch. "\n";

$mesaj .="Remarks: " .$remarks. "\n";

$extra_baslik  ="From: ".$email. "\n";

$extra_baslik .="Reply-To: ".$email. "\n";

$extra_baslik .="Cc:info@xxxxx\n";

$extra_baslik .="Bcc:xxxxxxxx\n";

$extra_baslik .= "Content-Type:text/plain; charset=\"iso-8859-9\"\n";

$extra_baslik .= "Content-Transfer-Encoding: 8bit\n";

mail($bana, $sebep, $mesaj, $extra_baslik);

 

Can anybody see were I have gone wrong please.

Link to comment
https://forums.phpfreaks.com/topic/128948-solved-checkbox-and-email-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.