mohammad26 Posted February 25, 2015 Share Posted February 25, 2015 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 17Warning: 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 Notice: Undefined variable: mysqli in C:\xampp\htdocs\plan\menu.php on line 4Fatal 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 Link to comment https://forums.phpfreaks.com/topic/294884-help/ Share on other sites More sharing options...
QuickOldCar Posted February 25, 2015 Share Posted February 25, 2015 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 https://forums.phpfreaks.com/topic/294884-help/#findComment-1506680 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.