drra6593 2010-05-18 20:10
浏览 36
已采纳

正确设置root.php的路径变量

I just posted a similar question, but deleted it because I realized I was working with an old file...doh!

I am just trying to get my XAMPP setup working for me.

I have a live site that navigates to a login page at http://www.monkeycalendar.com/arvindkt/login.php

That login page includes a root.php file that is found at http://www.monkeycalendar.com/arvindkt/root.php

Live site works great.

My localhost is set up so my sites are a folder in localhost:

IE: http://www.example.com = localhost/example.com

I'm having problems figuring out how to make my root folder point to the right directory. Any help would be much appreciated:

root.php:

# local settings define("SITE_ROOT" , $_SERVER['DOCUMENT_ROOT']."/arvindkt"); define("SITE_URL" , "http://localhost/monkeycalendar.com"); define('DB_HOST', "localhost"); define('DB_USER', "root"); define('DB_PASS', ""); define('DB_NAME', "dev.monkeycalendar");

  • 写回答

2条回答 默认 最新

  • dqy0707 2010-05-18 20:18
    关注

    If root.php resides in the site root, how about

    define("SITE_ROOT"      ,  dirname(__FILE__));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 12864只亮屏 不显示汉字
  • ¥20 三极管1000倍放大电路
  • ¥15 vscode报错如何解决
  • ¥15 前端vue CryptoJS Aes CBC加密后端java解密
  • ¥15 python随机森林对两个excel表格读取,shap报错
  • ¥15 基于STM32心率血氧监测(OLED显示)相关代码运行成功后烧录成功OLED显示屏不显示的原因是什么
  • ¥100 X轴为分离变量(因子变量),如何控制X轴每个分类变量的长度。
  • ¥30 求给定范围的全体素数p的(p-2)/p的连乘积值
  • ¥15 VFP如何使用阿里TTS实现文字转语音?
  • ¥100 需要跳转番茄畅听app的adb命令