d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Send Image From A Radio Value > Php Mailer
Add Reply New Topic New Poll
Member
Posts: 6,490
Joined: Feb 7 2018
Gold: 152.00
Dec 31 2019 12:35am
I'm using radio options in a form I've made, each have an image in them. I was wondering how I can email an image in a php form

Here is one of the radio options:
Code
<input type="radio" class="radio_item" value="1" name="item" id="radio1">
<label class="label_item" for="radio1"> <img src="../assets/fleet-truck-1.png"> </label>


I'm using PHPMailer to handle the emails, and here is the line for the radio

Code
$truck = "Truck Selected :" . $_POST['item'] . "<br>";


Am I able to place an image tag inside the "value" option, which will then send that image inside the email?

My phpmailer has HTML enabled when sending

This post was edited by Strickland on Dec 31 2019 12:35am
Member
Posts: 1,039
Joined: Jul 8 2008
Gold: 1,939.50
Dec 31 2019 08:17pm
If the images are hosted on your website and do not require authentication to download them then you can use a fully qualified name like https://www.example.com/assets/fleet-truck-1.png in the email. You don't want to allow the user to add arbitrary html to the email or else they could inject malicious scripts.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll