为了账号安全,请及时绑定邮箱和手机立即绑定

如何在 php 电子邮件上显示 php 单选输入值?

如何在 php 电子邮件上显示 php 单选输入值?

PHP
交互式爱情 2022-07-22 16:51:48
我有一个带有 4 个无线电输入的 php 表单,如下所示:<?php if( $chauffeur_data['enable-paypal'] == '1' ) { ?>            <div class="radio-wrapper clearfix"><input type="radio" name="payment-method" value="paypal" <?php if( $paypal_check == '1' ) { echo 'checked="checked"'; } ?> /><label><?php esc_html_e('Pay with PayPal','chauffeur'); ?></label><img src="<?php echo plugins_url('../../assets/images/paypal.png', __FILE__); ?>"></div>        <?php } ?>        <?php if( $chauffeur_data['enable-stripe'] == '1' ) { ?>            <div class="radio-wrapper clearfix"><input type="radio" name="payment-method" value="stripe" <?php if( $stripe_check == '1' ) { echo 'checked="checked"'; } ?> /><label><?php esc_html_e('Pay with Credit Card','chauffeur'); ?></label><img src="<?php echo plugins_url('../../assets/images/stripe.png', __FILE__); ?>"></div>        <?php } ?>        <?php if( $chauffeur_data['enable-cash'] == '1' ) { ?>            <div class="radio-wrapper clearfix"><input type="radio" name="payment-method" value="cash" <?php if( $cash_check == '1' ) { echo 'checked="checked"'; } ?> /><label><?php esc_html_e('Pay with Cash to the Driver','chauffeur'); ?></label></div>        <?php } ?>        <?php if( $chauffeur_data['enable-pos'] == '1' ) { ?>            <div class="radio-wrapper clearfix"><input type="radio" name="payment-method" value="pos" <?php if( $pos_check == '1' ) { echo 'checked="checked"'; } ?> /><label><?php esc_html_e('Pay with Card on POS in the Car','chauffeur'); ?></label></div>        <?php } ?>当检查一个广播按钮时,如何向我发送的电子邮件显示其值(例如POS)?
查看完整描述

1 回答

?
倚天杖

TA贡献1828条经验 获得超3个赞

表单提交后,从 $_POST 数组中获取单选按钮值;

$payment_method = $_POST['payment-method'];

使用 $payment_method 显示选中的单选按钮的值。

$customer_email_content .= '<li><strong>' . esc_html__('Payment Method you Selected','chauffeur') . ': </strong>' . $payment_method . '</li>'."\r\n";



查看完整回答
反对 回复 2022-07-22
  • 1 回答
  • 0 关注
  • 76 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号