Note that there are some explanatory texts on larger screens.

plurals
  1. POSuccessful checkbox array for image names, but now display images in email output?
    text
    copied!<p>I am able to successfully pass an array of checkbox values to a PHP processing page which then emails an HTML email to a specified email address. </p> <p>The values are actually names of images. So, the email is currently outputting the names of the images, i.e. "cat.png, dog.png, bird.png". I would like to now have these as HTML img references. So, I would like it to print:</p> <pre><code>&lt;img src="cat.png" style="border-right:1px solid #CCC;"&gt;&lt;img src="dog.png" style="border-right:1px solid #CCC;"&gt;&lt;img src="bird.png" style="border:none;"&gt; </code></pre> <p>I tried this but it didn't work: </p> <pre><code> $Image_Style = '&lt;img src="images/"' . $_REQUEST['Image_Style'] . ' style="border-right:1px solid #CCC;"&gt;'; </code></pre> <p>Any ideas how I could make HMTL image calls and have it display the image in my email?</p> <p>HTML FORM PAGE</p> <pre><code> &lt;input name="Image_Style[]" type="checkbox" id="newcheck2" value="cat.png" /&gt; &lt;input name="Image_Style[]" type="checkbox" id="newcheck2" value="dog.png" /&gt; &lt;input name="Image_Style[]" type="checkbox" id="newcheck2" value="bird.png" /&gt; </code></pre> <p>PHP PROCESS PAGE - Variables</p> <pre><code> $Image_Style = $_REQUEST['Image_Style']; $Image_Style_Array = ""; for ($i=0;$i&lt;count($Image_Style);$i++) { $Image_Style_Array .= $Image_Style[$i]; if ($i&lt;count($Image_Style)-1) { $Image_Style_Array .= ", "; } } // echo $Image_Style_Array; </code></pre> <p>PHP PROCESS PAGE - Send Email </p> <pre><code> &lt;tr&gt;&lt;td&gt;Image Style: &lt;/td&gt;&lt;td&gt;' . $Image_Style_Array . '&lt;/td&gt;&lt;/tr&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload