Html formdan gelen bilgileri php ile dosyaya yazirmak istiyorum fakat select bolumunde problem yasiyorum. Nasil yazdirabilirim?
$txt1=""; $txt = "Customer_Information.txt" + $txt1; if (isset($_POST['firstName']) && isset($_POST['lastName']) && isset($_POST['Address']) && isset($_POST['email']) && isset($_POST['ApartmentType'])) {
$fh = fopen($txt, 'a');
$txt = "Customer Register Information".PHP_EOL.''."First Name is " .''. $_POST['firstName'].PHP_EOL
."Last Name is " .''. $_POST['lastName'].PHP_EOL
."Address is " .''. $_POST['Address'].PHP_EOL
."E-Mail is " .''.$_POST['email'].PHP_EOL;
//."Apartment Type is ". ;
$selectOption = $_POST['studio'];
if($selectOption==TRUE){
$txt1 ="Studio";
}
fwrite($fh, $txt); // Write information to the file
fclose($fh); // Close the file
}
<select name="ApartmentType" size="1"> <option value="Studio" name="studio">Studio</option> <option value="One Bedroom">One Bedroom</option> <option value="Two Bedroom">Two Bedroom</option> <option value="Three Bedroom">Three Bedroom</option> </select>