dqc18251 2016-10-17 09:58
浏览 32
已采纳

public_html中的两个索引文件

I have a web app where once the user logs in he is directed to a profile page. While building the front end I created both a login form and profile separately with its individual CSS and JS files in separate folders. Now while uploading to the server, the profile page is not able to access its CSS and JS files. This is how the files look like after uploading in the server:

enter image description here

The index file in the pic is the index of the login page. I have the profile folder which contains all the CSS and JS files of the profile page. Its index file I have taken outside and named it profileindex.php. All the paths in the profileindex.php looks like this :-

<link href="public_html/profile/css/style.css" type="text/css" rel="stylesheet" media="all">

The location tag from the authentication page is pointing to the profileindex.php:

header('location: profileindex.php');

Please help as I am not able to access the CSS and JS of the profile page as expected. After login I can only see the profile page with its HTML components.

  • 写回答

4条回答 默认 最新

  • douliao8760 2016-10-17 10:01
    关注

    Your link is incorrect.

    Remove the public_html like so to use a relative path

    <link href="profile/css/style.css" type="text/css" rel="stylesheet" media="all">
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)