<input />结束标记与<img/>结束标记冲突

时间:2019-03-22 14:30:36

标签: php html

//  1/. Ask for 2table dim sizes.
Console.WriteLine("Enter number of rows:");
var x = int.Parse(Console.ReadLine());

var table = new string[x][];

// 2/. Fill the board
for (int row = 0; row < table.GetLength(0); row++)
{
    Console.WriteLine($"Enter of the line n°{row}");
    var lineSize = int.Parse(Console.ReadLine());
    table[row] = new string[lineSize];
    for (int col = 0; col < table[row].Length; col++)
    {
        Console.WriteLine($"Enter the value of the cell [{row},{col}]");
        table[row][col] = Console.ReadLine();
    }
    Console.Write("\n");
}

// 3/. Display the Table 
Console.Write("\n");
for (int row = 0; row < table.Length; row++)
{
    for (int col = 0; col < table[row].Length; col++)
    {
        Console.Write(table[row][col]);
    }
    Console.Write("\n");
}

1 个答案:

答案 0 :(得分:0)

我认为将图像发送到浏览器然后再发送回服务器的方式是一个坏主意。我无法告诉您正确的操作方法,因为我不知道您正在做的事情的背景。

但是,解决您的问题的方法是使用img函数来对htmlentities标记中的字符进行转义:

<input 
     type="hidden" 
     name='product_image' 
     id="product_image"
     value="<?php echo htmlentities('<img class="img-responsive img-fullwidth" src="data:image/jpeg;base64,'.base64_encode( $row["image"] ).'"/>'); ?>" />
相关问题