dongya2029 2016-03-11 18:39
浏览 45

使用PHP以HTML格式显示的.csv文件中的可点击URL

I have a few .csv files that store car accessories for my dealership and are displayed on a webpage using PHP by logging onto a local computer I've setup as a web server. I'd now like to add a row, holding URLs that point to images for each accessory. I know you can insert a link into a cell by using =HYPERLINK("http://www.google.com") and it works while inside Excel/Numbers, but once saved as a .csv it doesn't do anything. Also wondering if the PHP code I have setup to display the .csv files may cause an issue.

If anyone has any idea on how I can insert a URL into a .csv and have a clickable URL using PHP displayed in a web browser I'd greatly appreciate it!

Here is my PHP code for those interested:

<?php
 echo "<html><body><table>

";
 $f = fopen("csv/exterior.csv", "r");
 while (($line = fgetcsv($f)) !== false) {
    echo "<tr>";
    foreach ($line as $cell) {
            echo "<td>" . htmlspecialchars($cell) . "</td>";
    }
    echo "</tr>
";
  }
 fclose($f);
 echo "
</table></body></html>";
?>
  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器