Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Help with PHPretro install error
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="NotoriousJameson" data-source="post: 401333" data-attributes="member: 65480"><p>Hi guys, I was going to test using V26 RP to see if I can still do so but seems PHPretro is broken or something, I don't know.</p><p></p><p>I get the error:</p><p><strong>Notice</strong>: Undefined index: page in <strong>C:\xampp\htdocs\install\install.php</strong> on line <strong>36</strong></p><p></p><p><strong>Notice</strong>: Undefined index: submit in <strong>C:\xampp\htdocs\install\install.php</strong> on line <strong>110</strong></p><p></p><p><strong>Fatal error</strong>: Uncaught Error: Call to undefined function split() in C:\xampp\htdocs\install\install.php:128 Stack trace: #0 {main} thrown in <strong>C:\xampp\htdocs\install\install.php</strong> on line <strong>128</strong></p><p><strong></strong></p><p><strong>I do not know how to fix this but it is stopping me from installing the retro, or if I should use holoCMS instead of that to get around it, please lmk.</strong></p><p><strong>Below is the install.php code</strong></p><p><strong>[PHP]<?php</strong></p><p><strong>/*================================================================+\</strong></p><p><strong>|| # PHPRetro - An extendable virtual hotel site and management</strong></p><p><strong>|+==================================================================</strong></p><p><strong>|| # Copyright (C) 2009 Yifan Lu. All rights reserved.</strong></p><p><strong>|| # http://www.yifanlu.com</strong></p><p><strong>|| # Parts Copyright (C) 2009 Meth0d. All rights reserved.</strong></p><p><strong>|| # http://www.meth0d.org</strong></p><p><strong>|| # All images, scripts, and layouts</strong></p><p><strong>|| # Copyright (C) 2009 Sulake Ltd. All rights reserved.</strong></p><p><strong>|+==================================================================</strong></p><p><strong>|| # PHPRetro is provided "as is" and comes without</strong></p><p><strong>|| # warrenty of any kind. PHPRetro is free software!</strong></p><p><strong>|| # License: GNU Public License 3.0</strong></p><p><strong>|| # http://opensource.org/licenses/gpl-license.php</strong></p><p><strong>\+================================================================*/</strong></p><p><strong></strong></p><p><strong>session_start();</strong></p><p><strong>if($_SESSION['install_started'] != true || empty($_SESSION['install_started'])){ header('Location: ./index.php'); exit; }</strong></p><p><strong></strong></p><p><strong>require_once('./install_classes.php');</strong></p><p><strong></strong></p><p><strong>if(!empty($_SESSION['settings']['s_site_language'])){</strong></p><p><strong> $lang = new HoloLocaleInstaller;</strong></p><p><strong> $lang->addLocale("installer.main");</strong></p><p><strong> $lang->addLocale("installer.errors");</strong></p><p><strong> $continue = $lang->loc['continue'];</strong></p><p><strong> $back = $lang->loc['back'];</strong></p><p><strong>}else{</strong></p><p><strong> $continue = "Continue";</strong></p><p><strong> $back = "Back";</strong></p><p><strong>}</strong></p><p><strong></strong></p><p><strong>require_once('./install_functions.php');</strong></p><p><strong></strong></p><p><strong>$page = (int) $_POST['page']; if(empty($page)){ $page = 1; }</strong></p><p><strong>if(!isset($_SESSION['settings'])){ $_SESSION['settings'] = array(); }</strong></p><p><strong></strong></p><p><strong>if(!empty($_POST['submit']) && $_POST['submit'] == $continue){</strong></p><p><strong> foreach($_POST as $id => $value){</strong></p><p><strong> if($id == "page"){ continue; }</strong></p><p><strong> $_SESSION['settings'][$id] = $value;</strong></p><p><strong> }</strong></p><p><strong> switch($page){</strong></p><p><strong> case 1:</strong></p><p><strong> if(!isset($_POST['s_site_language']) || empty($_POST['s_site_language'])){</strong></p><p><strong> $error = "You must select a valid language!";</strong></p><p><strong> }</strong></p><p><strong> require_once('../includes/version.php');</strong></p><p><strong> $_SESSION['settings']['s_version'] = serialize(version());</strong></p><p><strong> $lang = new HoloLocaleInstaller;</strong></p><p><strong> break;</strong></p><p><strong> case 3:</strong></p><p><strong> foreach($_POST as $value){</strong></p><p><strong> if(empty($value)){</strong></p><p><strong> $error = $lang->loc['fill.all.fields'];</strong></p><p><strong> break;</strong></p><p><strong> }</strong></p><p><strong> }</strong></p><p><strong> if(writeConfig($_POST) == false){</strong></p><p><strong> $error = $lang->loc['cannot.write.config'];</strong></p><p><strong> break;</strong></p><p><strong> }</strong></p><p><strong> define('IN_HOLOCMS', true);</strong></p><p><strong> define('DEBUG', true);</strong></p><p><strong> require_once('../install/config.php');</strong></p><p><strong> require_once('../includes/classes.php');</strong></p><p><strong> $db = new $conn['main']['server']($conn['main']);</strong></p><p><strong> if($db->connection == false){ $error = $lang->loc['cannot.connect.database']; break; }</strong></p><p><strong> if(!empty($db->error)){ $error = $lang->loc['database.connection.error'].": ".$db->error; break; }</strong></p><p><strong> break;</strong></p><p><strong> case 4:</strong></p><p><strong> $last = $_POST['s_site_path'][strlen($str)-1];</strong></p><p><strong> if($last == "/"){ $_POST['s_site_path'] = substr_replace($_POST['s_site_path'],"",-1); }</strong></p><p><strong> foreach($_POST as $value){</strong></p><p><strong> if(empty($value)){</strong></p><p><strong> $error = $lang->loc['fill.all.fields'];</strong></p><p><strong> break;</strong></p><p><strong> }</strong></p><p><strong> }</strong></p><p><strong> define('IN_HOLOCMS', true);</strong></p><p><strong> define('DEBUG', true);</strong></p><p><strong> require_once('../install/config.php');</strong></p><p><strong> require_once('../includes/classes.php');</strong></p><p><strong> $db = new $conn['main']['server']($conn['main']);</strong></p><p><strong> ($conn['server']['enabled'] ? $serverdb = new $conn['server']['server']($conn['main']) : $serverdb = $db);</strong></p><p><strong> if($db->connection == false){ $error = $lang->loc['cannot.connect.database']; break; }</strong></p><p><strong> require_once('../includes/data/'.$_SESSION['settings']['s_hotel_server'].'.php');</strong></p><p><strong> $data = new installer_sql;</strong></p><p><strong> $sql = $data->select1();</strong></p><p><strong> if($serverdb->num_rows($sql) < 1){ $error = $lang->loc['no.valid.database']; break; }</strong></p><p><strong> break;</strong></p><p><strong> case 5:</strong></p><p><strong> $filter = preg_replace("/[^a-z\d\-=\?!@:\.]/i", "", $_POST['admin_username']);</strong></p><p><strong> if($_POST['admin_username'] != $filter){ $error = $lang->loc['invalid.username']; }</strong></p><p><strong> foreach($_POST as $value){</strong></p><p><strong> if(empty($value)){</strong></p><p><strong> $error = $lang->loc['fill.all.fields'];</strong></p><p><strong> break;</strong></p><p><strong> }</strong></p><p><strong> }</strong></p><p><strong> break;</strong></p><p><strong> case 6:</strong></p><p><strong> header('Location: ./?installed=success'); exit;</strong></p><p><strong> break;</strong></p><p><strong> }</strong></p><p><strong> if(!isset($error)){</strong></p><p><strong> $page++;</strong></p><p><strong> }</strong></p><p><strong>}elseif($_POST['submit'] == $back){</strong></p><p><strong> $page--;</strong></p><p><strong>}</strong></p><p><strong> </strong></p><p><strong></strong></p><p><strong>switch($page){</strong></p><p><strong>case 1:</strong></p><p><strong>$description = "Welcome to PHPRetro! To begin, please choose your language. Please note that this is permanent and you cannot change it later without reinstalling and losing all data.";</strong></p><p><strong>$title = "Introduction";</strong></p><p><strong>$disable_back = true;</strong></p><p><strong>$form = '<input type="hidden" name="page" value="1" /><div class="installer-label white"><label for="s_site_language">Language:</label></div><select name="s_site_language" title="Install all language files to ./includes/languages" class="installer-input">';</strong></p><p><strong>if ($handle = opendir('../includes/languages')) {</strong></p><p><strong> while (false !== ($file = readdir($handle))) {</strong></p><p><strong> if($file == "." || $file == ".."){ continue; }</strong></p><p><strong> if(substr($file,-4) != ".php"){ continue; }</strong></p><p><strong> $filename = '../includes/languages/'.$file;</strong></p><p><strong> $fh = fopen($filename, 'r');</strong></p><p><strong> $contents = fread($fh, filesize($filename));</strong></p><p><strong> $lines = split("\n", $contents);</strong></p><p><strong> $name = str_replace('Name: ','',$lines[2]);</strong></p><p><strong> if(isset($_SESSION['settings']['s_site_language']) && $_SESSION['settings']['s_site_language'] == str_replace('.php','',$file)){ $selected = ' selected="true"'; }</strong></p><p><strong> $form .= '<option value="'.str_replace('.php','',$file).'"'.$selected.'>'.$name.'</option>';</strong></p><p><strong> }</strong></p><p><strong> $form .= '</select>';</strong></p><p><strong> closedir($handle);</strong></p><p><strong>}</strong></p><p><strong>break;</strong></p><p><strong>case 2:</strong></p><p><strong>$lang->addLocale("installer.check");</strong></p><p><strong>$description = $lang->loc['page.desc'];</strong></p><p><strong>$title = $lang->loc['page.title'];</strong></p><p><strong>$disable_back = true;</strong></p><p><strong>if(!function_exists('apache_get_version')){</strong></p><p><strong> function apache_get_version(){</strong></p><p><strong> $version = explode(" ",$_SERVER["SERVER_SOFTWARE"],3);</strong></p><p><strong> if(!strstr($version,"Apache")){ return false; }else{ return true; }</strong></p><p><strong> }</strong></p><p><strong>}</strong></p><p><strong>if(!function_exists('apache_get_modules')){</strong></p><p><strong> function apache_get_modules(){</strong></p><p><strong> return array();</strong></p><p><strong> }</strong></p><p><strong>}</strong></p><p><strong>$passed['php_version'] = ((version_compare(PHP_VERSION, '5.0.0') < 0) ? false : true);</strong></p><p><strong>$passed['apache'] = (apache_get_version() ? true : false);</strong></p><p><strong>$passed['mod_rewrite'] = (in_array('mod_rewrite',apache_get_modules()) ? true : false);</strong></p><p><strong>$passed['premission_cache'] = (is_writable('../cache/') ? true : false);</strong></p><p><strong>$passed['premission_config'] = (is_writable('../install/') ? true : false);</strong></p><p><strong>$form = '<input type="hidden" name="page" value="2" />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label><em>'.$lang->loc['php.version.met'].'</em></label>';</strong></p><p><strong>$form .= $passed['php_version'] ? '<div class="check passed">'.$lang->loc['passed'].'</div>' : '<div class="check failed">'.$lang->loc['failed'].'</div><p class="error">'.$lang->loc['php.version.met.error'].'</p>';</strong></p><p><strong>$form .= '<div class="installer-label white"><label><em>'.$lang->loc['web.server.met'].'</em></label>';</strong></p><p><strong>$form .= $passed['apache'] ? '<div class="check passed">'.$lang->loc['passed'].'</div>' : '<div class="check failed">'.$lang->loc['failed'].'</div><p class="error">'.$lang->loc['web.server.met.error'].'</p>';</strong></p><p><strong>$form .= '<div class="installer-label white"><label><em>'.$lang->loc['mod.rewrite.check'].'</em></label>';</strong></p><p><strong>$form .= $passed['mod_rewrite'] ? '<div class="check passed">'.$lang->loc['passed'].'</div>' : '<div class="check failed">'.$lang->loc['failed'].'</div><p class="error">'.$lang->loc['mod.rewrite.check.error'].'</p>';</strong></p><p><strong>$form .= '<div class="installer-label white"><label><em>'.$lang->loc['cache.folder.writable'].'</em></label>';</strong></p><p><strong>$form .= $passed['premission_cache'] ? '<div class="check passed">'.$lang->loc['passed'].'</div>' : '<div class="check failed">'.$lang->loc['failed'].'</div><p class="error">'.$lang->loc['cache.folder.writable.error'].'</p>';</strong></p><p><strong>$form .= '<div class="installer-label white"><label><em>'.$lang->loc['install.folder.writable'].'</em></label>';</strong></p><p><strong>$form .= $passed['premission_config'] ? '<div class="check passed">'.$lang->loc['passed'].'</div>' : '<div class="check failed">'.$lang->loc['failed'].'</div><p class="error">'.$lang->loc['install.folder.writable.error'].'</p>';</strong></p><p><strong>if(!$passed['apache'] || !$passed['mod_rewrite'] || !$passed['premission_config']){ $disable_continue = true; }</strong></p><p><strong>break;</strong></p><p><strong>case 3:</strong></p><p><strong>if(!isset($_SESSION['settings']['db_prefix'])){ $_SESSION['settings']['db_prefix'] = "cms_"; }</strong></p><p><strong>if(!isset($_SESSION['settings']['db_server'])){ $_SESSION['settings']['db_server'] = "mysql"; }</strong></p><p><strong>if(!isset($_SESSION['settings']['db_host'])){ $_SESSION['settings']['db_host'] = "localhost"; }</strong></p><p><strong>if(!isset($_SESSION['settings']['db_port'])){ $_SESSION['settings']['db_port'] = "3306"; }</strong></p><p><strong>if(!isset($_SESSION['settings']['db_username'])){ $_SESSION['settings']['db_username'] = "root"; }</strong></p><p><strong>$lang->addLocale("installer.database");</strong></p><p><strong>$description = $lang->loc['page.desc'];</strong></p><p><strong>$title = $lang->loc['page.title'];</strong></p><p><strong>$form = '<input type="hidden" name="page" value="3" />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label for="db_prefix">'.$lang->loc['table.prefix'].':</label></div><input type="text" class="installer-input" name="db_prefix" value="'.$_SESSION['settings']['db_prefix'].'" title="'.$lang->loc['table.prefix.desc'].'" /><br />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label for="db_server">'.$lang->loc['database.server'].':</label></div><select class="installer-input" name="db_server" title="'.$lang->loc['database.server.desc'].'"><option value="mysql"'; if($_SESSION['settings']['db_server'] == "mysql"){ $form .= ' selected="true"'; }; $form .= '>MySQL</option><option value="pgsql"'; if($_SESSION['settings']['db_server'] == "pgsql"){ $form .= ' selected="true"'; }; $form .= '>PostgreSQL</option><option value="sqlite"'; if($_SESSION['settings']['db_server'] == "sqlite"){ $form .= ' selected="true"'; }; $form .= '>SQLite</option><option value="mssql"'; if($_SESSION['settings']['db_server'] == "mssql"){ $form .= ' selected="true"'; }; $form .= '>Microsoft SQL Server</option></select><br />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label for="db_host">'.$lang->loc['database.host'].':</label></div><input type="text" class="installer-input" name="db_host" value="'.$_SESSION['settings']['db_host'].'" title="'.$lang->loc['database.host.desc'].'" /><br />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label for="db_port">'.$lang->loc['database.port'].':</label></div><input type="text" class="installer-input" name="db_port" value="'.$_SESSION['settings']['db_port'].'" title="'.$lang->loc['database.port.desc'].'" /><br />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label for="db_username">'.$lang->loc['database.username'].':</label></div><input type="text" class="installer-input" name="db_username" value="'.$_SESSION['settings']['db_username'].'" title="'.$lang->loc['database.username.desc'].'" /><br />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label for="db_password">'.$lang->loc['database.password'].':</label></div><input type="password" class="installer-input" name="db_password" value="'.$_SESSION['settings']['db_password'].'" title="'.$lang->loc['database.password.desc'].'" /><br />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label for="db_name">'.$lang->loc['database.name'].':</label></div><input type="text" class="installer-input" name="db_name" value="'.$_SESSION['settings']['db_name'].'" title="'.$lang->loc['database.name.desc'].'" />';</strong></p><p><strong>break;</strong></p><p><strong>case 4:</strong></p><p> <strong>$pageURL = 'http';</strong></p><p> <strong>if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}</strong></p><p> <strong>$pageURL .= "://";</strong></p><p> <strong>if ($_SERVER["SERVER_PORT"] != "80") {</strong></p><p><strong> $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];</strong></p><p> <strong>} else {</strong></p><p><strong> $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];</strong></p><p> <strong>}</strong></p><p><strong>$pos = strpos($pageURL,"/install");</strong></p><p><strong>$pageURL = substr($pageURL, 0, $pos);</strong></p><p><strong>if(!isset($_SESSION['settings']['s_site_name'])){ $_SESSION['settings']['s_site_name'] = "Retro Hotel"; }</strong></p><p><strong>if(!isset($_SESSION['settings']['s_site_shortname'])){ $_SESSION['settings']['s_site_shortname'] = "Retro"; }</strong></p><p><strong>if(!isset($_SESSION['settings']['s_site_path'])){ $_SESSION['settings']['s_site_path'] = $pageURL; }</strong></p><p><strong>$lang->addLocale("installer.settings");</strong></p><p><strong>$description = $lang->loc['page.desc'];</strong></p><p><strong>$title = $lang->loc['page.title'];</strong></p><p><strong>$form = '<input type="hidden" name="page" value="4" />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label for="s_site_name">'.$lang->loc['site.name'].':</label></div><input type="text" class="installer-input" name="s_site_name" maxlength="24" value="'.$_SESSION['settings']['s_site_name'].'" title="'.$lang->loc['site.name.desc'].'" /><br />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label for="s_site_shortname">'.$lang->loc['short.name'].':</label></div><input type="text" class="installer-input" name="s_site_shortname" value="'.$_SESSION['settings']['s_site_shortname'].'" title="'.$lang->loc['short.name.desc'].'" /><br />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label for="s_site_path">'.$lang->loc['site.path'].':</label></div><input type="text" class="installer-input" name="s_site_path" value="'.$_SESSION['settings']['s_site_path'].'" title="'.$lang->loc['site.path.desc'].'" /><br />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label for="s_hotel_server">'.$lang->loc['hotel.server'].':</label></div><select name="s_hotel_server" title="'.$lang->loc['hotel.server.desc'].'" class="installer-input">';</strong></p><p><strong>if ($handle = opendir('../includes/data')) {</strong></p><p><strong> while (false !== ($file = readdir($handle))) {</strong></p><p><strong> if($file == "." || $file == ".."){ continue; }</strong></p><p><strong> if(substr($file,-4) != ".php"){ continue; }</strong></p><p><strong> $filename = '../includes/data/'.$file;</strong></p><p><strong> $fh = fopen($filename, 'r');</strong></p><p><strong> $contents = fread($fh, filesize($filename));</strong></p><p><strong> $lines = split("\n", $contents);</strong></p><p><strong> $name = str_replace('Name: ','',$lines[2]);</strong></p><p><strong> if(isset($_SESSION['settings']['s_hotel_server']) && $_SESSION['settings']['s_hotel_server'] == str_replace('.php','',$file)){ $selected = ' selected="true"'; }</strong></p><p><strong> $form .= '<option value="'.str_replace('.php','',$file).'"'.$selected.'>'.$name.'</option>';</strong></p><p><strong> }</strong></p><p><strong> $form .= '</select>';</strong></p><p><strong> closedir($handle);</strong></p><p><strong>}</strong></p><p><strong>break;</strong></p><p><strong>case 5:</strong></p><p><strong>$lang->addLocale("installer.admin");</strong></p><p><strong>$description = $lang->loc['page.desc'];</strong></p><p><strong>$title = $lang->loc['page.title'];</strong></p><p><strong>$form = '<input type="hidden" name="page" value="5" />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label for="admin_username">'.$lang->loc['username'].':</label></div><input type="text" class="installer-input" name="admin_username" value="'.$_SESSION['settings']['admin_username'].'" title="'.$lang->loc['username.desc'].'" /><br />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label for="admin_password">'.$lang->loc['password'].':</label></div><input type="password" class="installer-input" name="admin_password" value="'.$_SESSION['settings']['admin_password'].'" title="'.$lang->loc['password.desc'].'" /><br />';</strong></p><p><strong>$form .= '<div class="installer-label white"><label for="admin_email">'.$lang->loc['email'].':</label></div><input type="text" class="installer-input" name="admin_email" value="'.$_SESSION['settings']['admin_email'].'" title="'.$lang->loc['email.desc'].'" /><br />';</strong></p><p><strong>break;</strong></p><p><strong>case 6:</strong></p><p><strong>$lang->addLocale("installer.installing");</strong></p><p><strong>$description = $lang->loc['page.desc'];</strong></p><p><strong>$title = $lang->loc['page.title'];</strong></p><p><strong>$disable_back = true;</strong></p><p><strong>$form = '<input type="hidden" name="page" value="6" />';</strong></p><p><strong>$installing = true;</strong></p><p><strong>break;</strong></p><p><strong>}</strong></p><p><strong></strong></p><p><strong>require_once('./installer_header.php');</strong></p><p><strong>?></strong></p><p><strong><div id="container"></strong></p><p><strong> <div class="cbb process-template-box clearfix"></strong></p><p><strong> <div id="content"></strong></p><p><strong> <div id="header" class="clearfix"></strong></p><p><strong> <h1><a href="#"></a></h1></strong></p><p><strong> <ul class="stats"></strong></p><p><strong> <li class="stats-online"><span class="stats-fig"><?php echo $page; ?>/6</span> <?php echo $title; ?></li></strong></p><p><strong> </ul></strong></p><p><strong> </div></strong></p><p><strong> <div id="process-content"></strong></p><p><strong> <div id="column1" class="column"></strong></p><p><strong> </strong></p><p><strong> <div class="habblet-container "> </strong></p><p><strong> <form method="post" action="./install.php" autocomplete="off"></strong></p><p><strong></strong></p><p><strong> <div id="installer-column-left" ></strong></p><p><strong></strong></p><p><strong> <div id="installer-section-left"></strong></p><p><strong> <div class="cbb clearfix gray"></strong></p><p><strong> <div class="box-content"></strong></p><p><strong> <div class="installer-description"><label><?php echo $description; ?></label></div></strong></p><p><strong> </div></strong></p><p><strong> </div></strong></p><p><strong> </div></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong> </div></strong></p><p><strong> <div id="installer-column-right"></strong></p><p><strong></strong></p><p><strong> <div id="installer-section-right"></strong></p><p><strong> <?php if(isset($error)){ ?></strong></p><p><strong> <div class="installer-error"></strong></p><p><strong> <div class="rounded rounded-red"></strong></p><p><strong> <?php echo $error; ?></strong></p><p><strong> </div></strong></p><p><strong> </div></strong></p><p><strong> <?php } ?></strong></p><p><strong> <div class="rounded rounded-blue"></strong></p><p><strong> <h2 class="heading"><?php echo $title; ?></h2></strong></p><p><strong></strong></p><p><strong> <fieldset id="installer-fieldset"></strong></p><p><strong> <?php if(isset($form) && !empty($form)){ echo $form; } ?></strong></p><p><strong> <?php if($installing == true){ installDB(); } ?></strong></p><p><strong> </fieldset></strong></p><p><strong></strong></p><p><strong> </div></strong></p><p><strong> </div></strong></p><p><strong></strong></p><p><strong> <div id="installer-buttons"></strong></p><p><strong> <?php if(!$disable_continue){ ?><input type="submit" name="submit" value="<?php echo $continue; ?>" class="continue" id="installer-button-continue" /><?php } ?></strong></p><p><strong> <?php if(!$disable_back){ ?><input type="submit" name="submit" value="<?php echo $back; ?>" class="back" id="installer-button-back" /><?php } ?></strong></p><p><strong></strong></p><p><strong> </div></strong></p><p><strong> </div></strong></p><p><strong> </form></strong></p><p><strong> </strong></p><p><strong> </strong></p><p><strong> </strong></p><p><strong> </strong></p><p><strong> </div></strong></p><p><strong> <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script></strong></p><p><strong></strong></p><p><strong> </strong></p><p><strong></strong></p><p><strong></div></strong></p><p><strong><?php require_once('./installer_footer.php'); ?>[/PHP]</strong></p><p><strong></strong></p></blockquote><p></p>
[QUOTE="NotoriousJameson, post: 401333, member: 65480"] Hi guys, I was going to test using V26 RP to see if I can still do so but seems PHPretro is broken or something, I don't know. I get the error: [B]Notice[/B]: Undefined index: page in [B]C:\xampp\htdocs\install\install.php[/B] on line [B]36[/B] [B]Notice[/B]: Undefined index: submit in [B]C:\xampp\htdocs\install\install.php[/B] on line [B]110[/B] [B]Fatal error[/B]: Uncaught Error: Call to undefined function split() in C:\xampp\htdocs\install\install.php:128 Stack trace: #0 {main} thrown in [B]C:\xampp\htdocs\install\install.php[/B] on line [B]128 I do not know how to fix this but it is stopping me from installing the retro, or if I should use holoCMS instead of that to get around it, please lmk. Below is the install.php code [PHP]<?php /*================================================================+\ || # PHPRetro - An extendable virtual hotel site and management |+================================================================== || # Copyright (C) 2009 Yifan Lu. All rights reserved. || # http://www.yifanlu.com || # Parts Copyright (C) 2009 Meth0d. All rights reserved. || # http://www.meth0d.org || # All images, scripts, and layouts || # Copyright (C) 2009 Sulake Ltd. All rights reserved. |+================================================================== || # PHPRetro is provided "as is" and comes without || # warrenty of any kind. PHPRetro is free software! || # License: GNU Public License 3.0 || # http://opensource.org/licenses/gpl-license.php \+================================================================*/ session_start(); if($_SESSION['install_started'] != true || empty($_SESSION['install_started'])){ header('Location: ./index.php'); exit; } require_once('./install_classes.php'); if(!empty($_SESSION['settings']['s_site_language'])){ $lang = new HoloLocaleInstaller; $lang->addLocale("installer.main"); $lang->addLocale("installer.errors"); $continue = $lang->loc['continue']; $back = $lang->loc['back']; }else{ $continue = "Continue"; $back = "Back"; } require_once('./install_functions.php'); $page = (int) $_POST['page']; if(empty($page)){ $page = 1; } if(!isset($_SESSION['settings'])){ $_SESSION['settings'] = array(); } if(!empty($_POST['submit']) && $_POST['submit'] == $continue){ foreach($_POST as $id => $value){ if($id == "page"){ continue; } $_SESSION['settings'][$id] = $value; } switch($page){ case 1: if(!isset($_POST['s_site_language']) || empty($_POST['s_site_language'])){ $error = "You must select a valid language!"; } require_once('../includes/version.php'); $_SESSION['settings']['s_version'] = serialize(version()); $lang = new HoloLocaleInstaller; break; case 3: foreach($_POST as $value){ if(empty($value)){ $error = $lang->loc['fill.all.fields']; break; } } if(writeConfig($_POST) == false){ $error = $lang->loc['cannot.write.config']; break; } define('IN_HOLOCMS', true); define('DEBUG', true); require_once('../install/config.php'); require_once('../includes/classes.php'); $db = new $conn['main']['server']($conn['main']); if($db->connection == false){ $error = $lang->loc['cannot.connect.database']; break; } if(!empty($db->error)){ $error = $lang->loc['database.connection.error'].": ".$db->error; break; } break; case 4: $last = $_POST['s_site_path'][strlen($str)-1]; if($last == "/"){ $_POST['s_site_path'] = substr_replace($_POST['s_site_path'],"",-1); } foreach($_POST as $value){ if(empty($value)){ $error = $lang->loc['fill.all.fields']; break; } } define('IN_HOLOCMS', true); define('DEBUG', true); require_once('../install/config.php'); require_once('../includes/classes.php'); $db = new $conn['main']['server']($conn['main']); ($conn['server']['enabled'] ? $serverdb = new $conn['server']['server']($conn['main']) : $serverdb = $db); if($db->connection == false){ $error = $lang->loc['cannot.connect.database']; break; } require_once('../includes/data/'.$_SESSION['settings']['s_hotel_server'].'.php'); $data = new installer_sql; $sql = $data->select1(); if($serverdb->num_rows($sql) < 1){ $error = $lang->loc['no.valid.database']; break; } break; case 5: $filter = preg_replace("/[^a-z\d\-=\?!@:\.]/i", "", $_POST['admin_username']); if($_POST['admin_username'] != $filter){ $error = $lang->loc['invalid.username']; } foreach($_POST as $value){ if(empty($value)){ $error = $lang->loc['fill.all.fields']; break; } } break; case 6: header('Location: ./?installed=success'); exit; break; } if(!isset($error)){ $page++; } }elseif($_POST['submit'] == $back){ $page--; } switch($page){ case 1: $description = "Welcome to PHPRetro! To begin, please choose your language. Please note that this is permanent and you cannot change it later without reinstalling and losing all data."; $title = "Introduction"; $disable_back = true; $form = '<input type="hidden" name="page" value="1" /><div class="installer-label white"><label for="s_site_language">Language:</label></div><select name="s_site_language" title="Install all language files to ./includes/languages" class="installer-input">'; if ($handle = opendir('../includes/languages')) { while (false !== ($file = readdir($handle))) { if($file == "." || $file == ".."){ continue; } if(substr($file,-4) != ".php"){ continue; } $filename = '../includes/languages/'.$file; $fh = fopen($filename, 'r'); $contents = fread($fh, filesize($filename)); $lines = split("\n", $contents); $name = str_replace('Name: ','',$lines[2]); if(isset($_SESSION['settings']['s_site_language']) && $_SESSION['settings']['s_site_language'] == str_replace('.php','',$file)){ $selected = ' selected="true"'; } $form .= '<option value="'.str_replace('.php','',$file).'"'.$selected.'>'.$name.'</option>'; } $form .= '</select>'; closedir($handle); } break; case 2: $lang->addLocale("installer.check"); $description = $lang->loc['page.desc']; $title = $lang->loc['page.title']; $disable_back = true; if(!function_exists('apache_get_version')){ function apache_get_version(){ $version = explode(" ",$_SERVER["SERVER_SOFTWARE"],3); if(!strstr($version,"Apache")){ return false; }else{ return true; } } } if(!function_exists('apache_get_modules')){ function apache_get_modules(){ return array(); } } $passed['php_version'] = ((version_compare(PHP_VERSION, '5.0.0') < 0) ? false : true); $passed['apache'] = (apache_get_version() ? true : false); $passed['mod_rewrite'] = (in_array('mod_rewrite',apache_get_modules()) ? true : false); $passed['premission_cache'] = (is_writable('../cache/') ? true : false); $passed['premission_config'] = (is_writable('../install/') ? true : false); $form = '<input type="hidden" name="page" value="2" />'; $form .= '<div class="installer-label white"><label><em>'.$lang->loc['php.version.met'].'</em></label>'; $form .= $passed['php_version'] ? '<div class="check passed">'.$lang->loc['passed'].'</div>' : '<div class="check failed">'.$lang->loc['failed'].'</div><p class="error">'.$lang->loc['php.version.met.error'].'</p>'; $form .= '<div class="installer-label white"><label><em>'.$lang->loc['web.server.met'].'</em></label>'; $form .= $passed['apache'] ? '<div class="check passed">'.$lang->loc['passed'].'</div>' : '<div class="check failed">'.$lang->loc['failed'].'</div><p class="error">'.$lang->loc['web.server.met.error'].'</p>'; $form .= '<div class="installer-label white"><label><em>'.$lang->loc['mod.rewrite.check'].'</em></label>'; $form .= $passed['mod_rewrite'] ? '<div class="check passed">'.$lang->loc['passed'].'</div>' : '<div class="check failed">'.$lang->loc['failed'].'</div><p class="error">'.$lang->loc['mod.rewrite.check.error'].'</p>'; $form .= '<div class="installer-label white"><label><em>'.$lang->loc['cache.folder.writable'].'</em></label>'; $form .= $passed['premission_cache'] ? '<div class="check passed">'.$lang->loc['passed'].'</div>' : '<div class="check failed">'.$lang->loc['failed'].'</div><p class="error">'.$lang->loc['cache.folder.writable.error'].'</p>'; $form .= '<div class="installer-label white"><label><em>'.$lang->loc['install.folder.writable'].'</em></label>'; $form .= $passed['premission_config'] ? '<div class="check passed">'.$lang->loc['passed'].'</div>' : '<div class="check failed">'.$lang->loc['failed'].'</div><p class="error">'.$lang->loc['install.folder.writable.error'].'</p>'; if(!$passed['apache'] || !$passed['mod_rewrite'] || !$passed['premission_config']){ $disable_continue = true; } break; case 3: if(!isset($_SESSION['settings']['db_prefix'])){ $_SESSION['settings']['db_prefix'] = "cms_"; } if(!isset($_SESSION['settings']['db_server'])){ $_SESSION['settings']['db_server'] = "mysql"; } if(!isset($_SESSION['settings']['db_host'])){ $_SESSION['settings']['db_host'] = "localhost"; } if(!isset($_SESSION['settings']['db_port'])){ $_SESSION['settings']['db_port'] = "3306"; } if(!isset($_SESSION['settings']['db_username'])){ $_SESSION['settings']['db_username'] = "root"; } $lang->addLocale("installer.database"); $description = $lang->loc['page.desc']; $title = $lang->loc['page.title']; $form = '<input type="hidden" name="page" value="3" />'; $form .= '<div class="installer-label white"><label for="db_prefix">'.$lang->loc['table.prefix'].':</label></div><input type="text" class="installer-input" name="db_prefix" value="'.$_SESSION['settings']['db_prefix'].'" title="'.$lang->loc['table.prefix.desc'].'" /><br />'; $form .= '<div class="installer-label white"><label for="db_server">'.$lang->loc['database.server'].':</label></div><select class="installer-input" name="db_server" title="'.$lang->loc['database.server.desc'].'"><option value="mysql"'; if($_SESSION['settings']['db_server'] == "mysql"){ $form .= ' selected="true"'; }; $form .= '>MySQL</option><option value="pgsql"'; if($_SESSION['settings']['db_server'] == "pgsql"){ $form .= ' selected="true"'; }; $form .= '>PostgreSQL</option><option value="sqlite"'; if($_SESSION['settings']['db_server'] == "sqlite"){ $form .= ' selected="true"'; }; $form .= '>SQLite</option><option value="mssql"'; if($_SESSION['settings']['db_server'] == "mssql"){ $form .= ' selected="true"'; }; $form .= '>Microsoft SQL Server</option></select><br />'; $form .= '<div class="installer-label white"><label for="db_host">'.$lang->loc['database.host'].':</label></div><input type="text" class="installer-input" name="db_host" value="'.$_SESSION['settings']['db_host'].'" title="'.$lang->loc['database.host.desc'].'" /><br />'; $form .= '<div class="installer-label white"><label for="db_port">'.$lang->loc['database.port'].':</label></div><input type="text" class="installer-input" name="db_port" value="'.$_SESSION['settings']['db_port'].'" title="'.$lang->loc['database.port.desc'].'" /><br />'; $form .= '<div class="installer-label white"><label for="db_username">'.$lang->loc['database.username'].':</label></div><input type="text" class="installer-input" name="db_username" value="'.$_SESSION['settings']['db_username'].'" title="'.$lang->loc['database.username.desc'].'" /><br />'; $form .= '<div class="installer-label white"><label for="db_password">'.$lang->loc['database.password'].':</label></div><input type="password" class="installer-input" name="db_password" value="'.$_SESSION['settings']['db_password'].'" title="'.$lang->loc['database.password.desc'].'" /><br />'; $form .= '<div class="installer-label white"><label for="db_name">'.$lang->loc['database.name'].':</label></div><input type="text" class="installer-input" name="db_name" value="'.$_SESSION['settings']['db_name'].'" title="'.$lang->loc['database.name.desc'].'" />'; break; case 4: $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } $pos = strpos($pageURL,"/install"); $pageURL = substr($pageURL, 0, $pos); if(!isset($_SESSION['settings']['s_site_name'])){ $_SESSION['settings']['s_site_name'] = "Retro Hotel"; } if(!isset($_SESSION['settings']['s_site_shortname'])){ $_SESSION['settings']['s_site_shortname'] = "Retro"; } if(!isset($_SESSION['settings']['s_site_path'])){ $_SESSION['settings']['s_site_path'] = $pageURL; } $lang->addLocale("installer.settings"); $description = $lang->loc['page.desc']; $title = $lang->loc['page.title']; $form = '<input type="hidden" name="page" value="4" />'; $form .= '<div class="installer-label white"><label for="s_site_name">'.$lang->loc['site.name'].':</label></div><input type="text" class="installer-input" name="s_site_name" maxlength="24" value="'.$_SESSION['settings']['s_site_name'].'" title="'.$lang->loc['site.name.desc'].'" /><br />'; $form .= '<div class="installer-label white"><label for="s_site_shortname">'.$lang->loc['short.name'].':</label></div><input type="text" class="installer-input" name="s_site_shortname" value="'.$_SESSION['settings']['s_site_shortname'].'" title="'.$lang->loc['short.name.desc'].'" /><br />'; $form .= '<div class="installer-label white"><label for="s_site_path">'.$lang->loc['site.path'].':</label></div><input type="text" class="installer-input" name="s_site_path" value="'.$_SESSION['settings']['s_site_path'].'" title="'.$lang->loc['site.path.desc'].'" /><br />'; $form .= '<div class="installer-label white"><label for="s_hotel_server">'.$lang->loc['hotel.server'].':</label></div><select name="s_hotel_server" title="'.$lang->loc['hotel.server.desc'].'" class="installer-input">'; if ($handle = opendir('../includes/data')) { while (false !== ($file = readdir($handle))) { if($file == "." || $file == ".."){ continue; } if(substr($file,-4) != ".php"){ continue; } $filename = '../includes/data/'.$file; $fh = fopen($filename, 'r'); $contents = fread($fh, filesize($filename)); $lines = split("\n", $contents); $name = str_replace('Name: ','',$lines[2]); if(isset($_SESSION['settings']['s_hotel_server']) && $_SESSION['settings']['s_hotel_server'] == str_replace('.php','',$file)){ $selected = ' selected="true"'; } $form .= '<option value="'.str_replace('.php','',$file).'"'.$selected.'>'.$name.'</option>'; } $form .= '</select>'; closedir($handle); } break; case 5: $lang->addLocale("installer.admin"); $description = $lang->loc['page.desc']; $title = $lang->loc['page.title']; $form = '<input type="hidden" name="page" value="5" />'; $form .= '<div class="installer-label white"><label for="admin_username">'.$lang->loc['username'].':</label></div><input type="text" class="installer-input" name="admin_username" value="'.$_SESSION['settings']['admin_username'].'" title="'.$lang->loc['username.desc'].'" /><br />'; $form .= '<div class="installer-label white"><label for="admin_password">'.$lang->loc['password'].':</label></div><input type="password" class="installer-input" name="admin_password" value="'.$_SESSION['settings']['admin_password'].'" title="'.$lang->loc['password.desc'].'" /><br />'; $form .= '<div class="installer-label white"><label for="admin_email">'.$lang->loc['email'].':</label></div><input type="text" class="installer-input" name="admin_email" value="'.$_SESSION['settings']['admin_email'].'" title="'.$lang->loc['email.desc'].'" /><br />'; break; case 6: $lang->addLocale("installer.installing"); $description = $lang->loc['page.desc']; $title = $lang->loc['page.title']; $disable_back = true; $form = '<input type="hidden" name="page" value="6" />'; $installing = true; break; } require_once('./installer_header.php'); ?> <div id="container"> <div class="cbb process-template-box clearfix"> <div id="content"> <div id="header" class="clearfix"> <h1><a href="#"></a></h1> <ul class="stats"> <li class="stats-online"><span class="stats-fig"><?php echo $page; ?>/6</span> <?php echo $title; ?></li> </ul> </div> <div id="process-content"> <div id="column1" class="column"> <div class="habblet-container "> <form method="post" action="./install.php" autocomplete="off"> <div id="installer-column-left" > <div id="installer-section-left"> <div class="cbb clearfix gray"> <div class="box-content"> <div class="installer-description"><label><?php echo $description; ?></label></div> </div> </div> </div> </div> <div id="installer-column-right"> <div id="installer-section-right"> <?php if(isset($error)){ ?> <div class="installer-error"> <div class="rounded rounded-red"> <?php echo $error; ?> </div> </div> <?php } ?> <div class="rounded rounded-blue"> <h2 class="heading"><?php echo $title; ?></h2> <fieldset id="installer-fieldset"> <?php if(isset($form) && !empty($form)){ echo $form; } ?> <?php if($installing == true){ installDB(); } ?> </fieldset> </div> </div> <div id="installer-buttons"> <?php if(!$disable_continue){ ?><input type="submit" name="submit" value="<?php echo $continue; ?>" class="continue" id="installer-button-continue" /><?php } ?> <?php if(!$disable_back){ ?><input type="submit" name="submit" value="<?php echo $back; ?>" class="back" id="installer-button-back" /><?php } ?> </div> </div> </form> </div> <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script> </div> <?php require_once('./installer_footer.php'); ?>[/PHP] [/B] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Help with PHPretro install error
Top