dougu6815 2013-07-23 22:13
浏览 15
已采纳

PHP图像路径对每个用户都不同

Hi ive run into what I thought would be a simple obstacle however, its become quite a hassle I want to display a picture on my website however it will be different for every user that is logged in. I tried this

<img src="<?php echo 'screenshots/img_$username.png' ?>" />

I didnt really think that would work but Im not exactly sure where to go on this one I have a java application that saves the images to a file on the users computer then uploads them to my server and saves them all as "img_someusername.png" but the username is going to be different for every person

how can I get it so that the user that is logged in will see his or her picture and not someone else's much like a profile picture on facebook?

  • 写回答

5条回答 默认 最新

  • doumindang2416 2013-07-23 22:18
    关注

    try this instead.

    <img src="screenshots/img_<?php echo $username; ?>.png" />
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法