in Education by
This question already has answers here: How do I properly escape quotes inside HTML attributes? (6 answers) Closed 3 years ago. <?php $query="SELECT * FROM Products ORDER BY id ASC"; $result=mysqli_query($connect,$query); $image_path = ""; if(mysqli_num_rows($result)>0) { while($row=mysqli_fetch_array($result)) { ?>
<?php echo '<img class="img-responsive img-fullwidth" src="data:image/jpeg;base64,'.base64_encode( $row["image"] ).'"/>' ?> ' ?>" /> //input closing tag is clashed with img to closing tag
<?php } } ?> JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I think the way your sending the image to the browser and then sending it back to the server is a bad idea. I can't tell you the proper way to do it since I don't know the context to what you are doing. However, the solution to your problem is to escape the characters in the img tag using the htmlentities function like this: '); ?>" />

Related questions

0 votes
    I'm trying to insert data to the database and at the same time uploading an image to the path. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Closed 9 years ago. Possible Duplicate: PHP: unformat money How to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 4, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Closed 9 years ago. Possible Duplicate: PHP: unformat money How to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Closed 9 years ago. Possible Duplicate: PHP: unformat money How to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I think I have an error in my code here - $('#form input[type=radio]').val();. JS: $( ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I think I have an error in my code here - $('#form input[type=radio]').val();. JS: $( ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I think I have an error in my code here - $('#form input[type=radio]').val();. JS: $( ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I think I have an error in my code here - $('#form input[type=radio]').val();. JS: $( ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I currently have the following code: My problem is that the image when submitted isn't doing the same ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 28, 2022 in Education by JackTerrance
0 votes
    I currently have the following code: My problem is that the image when submitted isn't doing the same ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 28, 2022 in Education by JackTerrance
0 votes
    The img tag inside the canvas element is greyed out in firebug. Mostly this is due to a bad style ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 11, 2022 in Education by JackTerrance
0 votes
    The img tag inside the canvas element is greyed out in firebug. Mostly this is due to a bad style ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 11, 2022 in Education by JackTerrance
0 votes
    Tags that do not have closing tag are called empty tags. True or false Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    An element is composed of: a. ON tag and OFF tag b. The content between the opening and closing tag c. Both a and b Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    I want to load Google fonts in the head-section of my page using a php-function. My -area looks like this: ... ... Now ... I do this, there will be a "1" displayed (because of the...
asked Jun 2, 2022 in Education by JackTerrance
...