Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29748

Hide empty/unused fields in php mail script [closed]

$
0
0

I am using a custom-control options to fill out a order form, that is submitted via php mail. Not everything is used depending on the item. Can I clean up unused fields? Attached is my php, and output.

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$holster = $_POST['holster'];
$clip = $_POST['clip'];
$snap = $_POST['snap'];
$muzzle = $_POST['muzzle'];
$mouth = $_POST['mouth'];
$shirtguard = $_POST['shirtguard'];
$modwing = $_POST['modwing'];
$darkwing = $_POST['darkwing'];
$mega = $_POST['mega'];
$bearing = $_POST['bearing'];
$message = $_POST['message'];
$straps = $_POST['straps'];
$buckle = $_POST['buckle'];
$color = $_POST['color'];
$length = $_POST['length'];
$tankerhardware = $_POST['tankerhardware'];
$beltwidth = $_POST['beltwidth'];
$formcontent=" From: $name \n Phone: $phone \n Email: $email \n Holster: $holster   \n Shirtguard: $shirtguard \n Reinforced Mouth: $mouth \n Sewn Muzzle: $muzzle \n Clip Preference : $clip  \n Snap : $snap \n Modwing: $modwing \n Darkwing: $darkwing \n Mega: $mega \n Light Bearing info: $bearing  \n Stomach/Back Straps: $straps \n Include Extra Tanker Hardware: $tankerhardware \n Belt Width: $beltwidth \n Belt Length: $length \n Buckle: $buckle \n Belt Color: $color \n Message: $message";
$to = "admin@roninleatherholstersllc.com";
$subject = "Order Inquiry";
$mailheader = "From: $email \r\n";
mail($to, $subject, $formcontent , $mailheader) ;

From: Josh Phone: 34324353 Email: user@gmail.com Holster: Shooters Belt Shirtguard: Reinforced Mouth: Sewn Muzzle: Clip Preference : Snap : Modwing: Darkwing: Mega: Stomach/Back Straps: Include Extra Tanker Hardware: Belt Width: 1.5 Belt Length: 45 Buckle: Satin Stainless Belt Color: Brown Light Bearing info: Message:


Viewing all articles
Browse latest Browse all 29748

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>