Jump to content

Help


mohammad26

Recommended Posts

Am  new Programmer and starting new job and the programmer he left the program but when i want to edit the PHP page and run on the local server i run XAMPP server  giving me a following message 

 

Warning: include_once(./cp/app/includes/db_connect.php): failed to open stream: No such file or directory in C:\xampp\htdocs\plan\index.php on line 17

Warning: include_once(): Failed opening './cp/app/includes/db_connect.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\plan\index.php on line 17

THIS SITE IS CURRENTLY UNDER DEVELOPMENT - BETA VERSION 1.0
BETA1.png

Notice: Undefined variable: mysqli in C:\xampp\htdocs\plan\menu.php on line 4

Fatal error: Call to a member function prepare() on null in C:\xampp\htdocs\plan\menu.php on line 4

 

 

 

The db-connect file under htdocs and under my folder name (Plan)

 

the cp-config under htdocs and under my folder name (plan )

 

my db-connect code as a follwoing 

<?php
include_once('cp_config.php');   // As functions.php is not included


logMessage("db_connect.php");




$mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE);


// Reset messages
$messages_welcome = 0;
$messages_inbox = 0;
$messages_inbox_message = "";
$messages_error = 0;
$messages_error_message = "";
$messages_success = 0;
$messages_success_message = "";


?>
 
 
and cp-config code as a follwoing
 
<?php


/**


 * These are the database login details


 */  


define("HOST", "localhost");      // The host you want to connect to.


define("USER", "planetc2_admin");     // The database username. 


define("PASSWORD", "mDn1Vo3?VeGB");     // The database password. 


define("DATABASE", "planetc2_main");     // The database name.






define("CAN_REGISTER", "any");


define("DEFAULT_ROLE", "member");






define("SECURE", FALSE);     // FOR DEVELOPMENT ONLY!!!!






// TESTING ONLY


$showLog = TRUE;


$logMsg = "";


$logLine = 0;






function logMessage($message)


{


global $logMsg, $logLine;






$logMsg .= "<tr style='height: 25px;'><td>" . ($logLine++) . "</td><td>" . $message . "</tr>";


}






function displayMessage()


{


global $showLog, $logMsg;






if ( $showLog )


{


echo "<div style='display:block; clear: both; float: left; font-size: 12px; color: black;'>";


echo "<table width='100%'>";


echo "<th colspan='2'>LOG</th>";


echo $logMsg . "</table></div>";


}


}






logMessage("cp_config.php");
$table_account = "account";
$table_accountattending = "accountattending";
$table_accountevents = "accountevents";
$table_accountfilter = "accountfilter";
$table_accountfollow = "accountfollow";
$table_accountfriends = "accountfriends";
$table_accountimages = "accountimages";
$table_accountnotification = "accountnotification";
$table_accountuser = "accountuser";
$table_category = "category";
$table_countries = "countries";
$table_discountcode = "discountcode";
$table_events = "events";
$table_eventsgallery = "eventsgallery";
$table_wordblacklist = "wordblacklist";
?>
 
 
Please guide me and help me 
 
 
 
Edited by Ch0cu3r
Link to comment
Share on other sites

The old include location was in /cp/app/includes/ , you would need to use /plan/ instead

 

You could even do this

include_once($_SERVER['DOCUMENT_ROOT']."/plan/cp_config.php");
include_once($_SERVER['DOCUMENT_ROOT']."/plan/db_connect.php");

link to where you placed the files

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.