php - Add Image with Strip Tags or Into Form to Email Response -


i don't know strip tags may not possible.

i have survey users fill out online. part of survey has question required vote on star rating. @ moment, once completed, emails through star rating number (i.e. 1 - 5). like, insert image instead of numbers, can visually show star rating selection. i'm not sure insert image strip tag?

or perhaps should going in "value" on frontend? afterall, what's being called in email.

any insight appreciated!

front-end html side:

<div class="question-sub"><p>ease of making reservation</p>        </div>  <span class="rating">           <input type="radio" class="rating-input"             id="rating-input-1-1" name="res-ease5" value="5">         <label for="rating-input-1-1" class="rating-star"></label>         <input type="radio" class="rating-input"             id="rating-input-1-2" name="res-ease4" value="4">         <label for="rating-input-1-2" class="rating-star"></label>                <input type="radio" class="rating-input"             id="rating-input-1-3" name="res-ease3" value="3">         <label for="rating-input-1-3" class="rating-star"></label>                  <input type="radio" class="rating-input"             id="rating-input-1-4" name="res-ease2" value="2">         <label for="rating-input-1-4" class="rating-star"></label>                        <input type="radio" class="rating-input"             id="rating-input-1-5" name="res-ease1" value="1">         <label for="rating-input-1-5" class="rating-star"></label>     </span> 

backend php side:

$message .= "<tr style='font-size: 8pt;'><td>ease of making reservation: </td><td width='50%'>" . strip_tags($_post['res-ease5']) . "" . strip_tags($_post['res-ease4']) . "" . strip_tags($_post['res-ease3']) . "" . strip_tags($_post['res-ease2']) . "" . strip_tags($_post['res-ease1']) . "</td></tr>"; 

update:

dagon's answer below works showing url rather embedding image actual email. here code using:

$img="http://myurl.com/guestquestionnaire/images/star".$_post['res'].'.jpg'; 

for start radio buttons wrong, each should have same name attribute:

so assume changed res

so in post array have $_post['res'] being 1-5

name images want use star[1-5].jpg

create img variable use in message:

$img="<img src='your website url/star".$_post['res'].".jpg'>"; 

then change $message to:

$message .= "<tr style='font-size: 8pt;'><td>ease of making reservation: </td><td width='50%'>$img</td></tr>"; 

Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -