Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8809993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:00:55+00:00 2026-06-14T03:00:55+00:00

I am currently trying to modify a contact form created by someone else. The

  • 0

I am currently trying to modify a contact form created by someone else. The current form processing php file uses a function mentioned in this article: http://www.gerd-riesselmann.net/archives/2005/09/sending-spam-through-contact-forms.

Here is the code segment where it formats the email to be sent out.

    if($_POST["txtEmail"]!=""){
    $xm="info@xxx.co.uk";
    $pem=$_POST["txtEmail"];
    $sb="Chauffer Inquiry";
    $txt='  <table border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse">
        <tr>
          <td align="right"><strong>Name:</strong></td>
          <td width="250">'.preprocessHeaderField($_POST["txtName"]).'</td>
        </tr>
<tr>
      <td align="right"><strong>Date of booking:</strong></td>
      <td width="250">'.preprocessHeaderField($_POST["date"]).'</td>
    </tr>

My problem is this handling a list box with multi-select capability within this formatting section. I have created it correctly in the form using an array, but I still can’t figure out how to process it within this code. Could someone explain how to include a for statement in here? I am capturing the number of selected items these two statements, before the if statement.

$aCars = $_POST['Cars'];
$nCars = count($aCars);

I did look everywhere but couldn’t find a way to embed a for statement to the above code. Please go easy on me as my php skills are not that great.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:00:57+00:00Added an answer on June 14, 2026 at 3:00 am

    Assuming everything works ($aCars and $nCars) have values and you want to know which were selected.

    You need to convert the array to a sting so it can be printed. Have a look at the implode function. That function allows you to ‘glue’ array elements together into a string.

    $carString = implode(",", $aCars); // $carString will be 'Car1,Car2,Car3'
    

    From there you can append it to $txt.

    $txt .= "<tr><td>Car names</td><td>".$carString. "</td></tr>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to modify a table from OpenCart, a PHP-based e-cart solution. I currently
I am currently trying to modify a Javascript function that slides in a <div>.
I am using Python and a CSV file. I am currently trying to modify
I am trying to modify the sample code below. It currently populates a View
I'm currently trying out Aptana Studio 3 for PHP development (I'm pretty new to
I am new to Ruby On Rails, and currently trying to modify an existing
I am trying to modify the content in my page without a reload. Currently
I'm trying to modify/touch a .htaccess file using a .sh script via ssh. The
I am trying to modify an existing PDF with iText. My code currently edits
Hi I'm currently trying to use the elem function in prelude. data MyType =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.