Jump to content

"down for maintenance (err 2)" when including outside of WHMCS


proper

Recommended Posts

I created a file access.php so that I'd be able to act differently when a user is logged in or not.

 

root_folder/whmcs/access.php:

<?php
require("dbconnect.php");

if ($_SESSION['uid']) {
$result = mysql_query("SELECT firstname FROM tblclients WHERE id='".$_SESSION['uid']."' LIMIT 1;");
   while($row = mysql_fetch_array($result))
       echo '<a href="/members/logout.php">Log out</a>';
}else{
echo '<a href="/members/clientarea.php">Login</a>';	
}
?>

 

If I try to access it from root_folder/index.php everything is ok:

root_folder/index.php:

<li class="button"><?php include('/srv/www/public_html/members/access.php'); ?></li>

 

But if I try to include it from a nested folder such as root_folder/nested/nested/index.php I get an error:

"down for maintenance (err 2)".

 

Obviously it can't find the WHMCS files because relativity path issues. What can I do to resolve this?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated