-1
これは、HTMLテンプレートにバンドルされている既成の連絡フォームとして開始されました。すべてのテキストボックスフィールドは、投稿時に完全に正常に動作します。しかし、私は自分自身を追加したチェックボックスのセクションでいくつかの助けが必要です。私はいくつかの調査をしようとしていますが、選択したすべてのチェックボックスを電子メールに含めることはできません。PHPコンタクトフォームを作成する方法選択したすべてのチェックボックスを集める
は、ここに私の作業のhtmlです:
<form class="nobottommargin" id="template-contactform" name="template-contactform" action="include/sendemail.php" method="post">
<div class="form-process"></div>
<div class="col_half">
<label for="template-contactform-name">Name <small>*</small></label>
<input type="text" id="template-contactform-name" name="template-contactform-name" value="" class="sm-form-control required" />
</div>
<div class="col_half col_last">
<label for="template-contactform-email">Email <small>*</small></label>
<input type="email" id="template-contactform-email" name="template-contactform-email" value="" class="required email sm-form-control" />
</div>
<div class="clear"></div>
<div class="col_half">
<label for="template-contactform-phone">Phone <small>*</small></label>
<input type="text" id="template-contactform-phone" name="template-contactform-phone" value="" class="sm-form-control required" />
</div>
<div class="col_half col_last">
<label for="template-contactform-budget">Budget</label>
<input type="text" id="template-contactform-budget" name="template-contactform-budget" value="" class="sm-form-control" />
</div>
<div class="clear"></div>
<div class="col_full">
<label for="template-contactform-services[]">Services Required: </label>
<input name="template-contactform-services[]" type="checkbox" value="Web-Design" />Web Design
<input name="template-contactform-services[]" type="checkbox" value="E-Commerce" />E-Commerce
<input name="template-contactform-services[]" type="checkbox" value="User-Experience" />User Experience
<input name="template-contactform-services[]" type="checkbox" value="Branding" />Branding
<input name="template-contactform-services[]" type="checkbox" value="Mobile-Design" />Mobile Design
<input name="template-contactform-services[]" type="checkbox" value="Search-Marketing" />Search Marketing
</div>
<div class="col_full">
<label for="template-contactform-message">Deliverables & Goals <small>*</small></label>
<textarea class="required sm-form-control" id="template-contactform-message" name="template-contactform-message" rows="4" cols="30" placeholder="List the specific deliverables, services, and goals required..."></textarea>
</div>
<div class="col_full">
<label for="template-contactform-missing">Anything Missing?</label>
<textarea class="sm-form-control" id="template-contactform-missing" name="template-contactform-missing" rows="4" cols="30" placeholder="Is there anything else you think we should know?"></textarea>
</div>
<div class="col_full hidden">
<input type="text" id="template-contactform-botcheck" name="template-contactform-botcheck" value="" class="sm-form-control" />
</div>
<div class="col_full">
<!--<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<div class="g-recaptcha" data-sitekey="your-recaptcha-site-key"></div>-->
</div>
<div class="col_full">
<button class="button button-3d nomargin" type="submit" id="template-contactform-submit" name="template-contactform-submit" value="submit">Send Message</button>
</div>
</form>
、ここでは私のPHPの:あなたは<input type="checkbox" />
タグに異なるname
属性を与える必要があり、事前
ありがとう、私はそれが動作する方法を参照してください、しかし、私はどのように私の電子メールテンプレートは、サービスが必要と言うだろう配列のようになることができます:Web、グラフィック、 –
このメールはあなたを助けますhttp:// stackoverflow。 com/questions/4997252/get-post-multiple-checkboxes – fonfonx
完全なphp noobとしては本当にありません(私は自分の既存のスクリプトを修正する方法を正確に知る必要があります)私は、issetの代わりにimplodeとis_arrayを使ったものを見ましたしかしそれの多くの感覚を作ることができないと私は私のフォームを壊し続けている –