Permalink
Browse files

Fixed redirection and .htaccess issues

Few blank lines in php files were causing redirection not to work
Change of one line in .htaccess file prevents error in opening /install/ directory in a browser
  • Loading branch information...
1 parent 85a49ca commit 2e7d4d69c5d34a92d4c2e68831d9100421e6fde5 @collb collb committed Jun 12, 2012
Showing with 17 additions and 20 deletions.
  1. +1 −1 config/database.php
  2. +2 −4 includes/core_class.php
  3. +1 −3 includes/database_class.php
  4. +13 −12 index.php
View
@@ -54,4 +54,4 @@
$active_record = TRUE;
/* End of file database.php */
-/* Location: ./system/application/config/database.php */
+/* Location: ./application/config/database.php */
@@ -44,7 +44,7 @@ function write_config($data) {
// Config path
$template_path = 'config/database.php';
- $output_path = '../system/application/config/database.php';
+ $output_path = '../application/config/database.php';
// Open the file
$database_file = file_get_contents($template_path);
@@ -74,6 +74,4 @@ function write_config($data) {
return false;
}
}
-}
-?>
-
+}
@@ -42,6 +42,4 @@ function create_tables($data)
return true;
}
-}
-?>
-
+}
View
@@ -1,8 +1,8 @@
<?php
-error_reporting(E_NONE);
+error_reporting(E_NONE); //Setting this to E_ALL showed that that cause of not redirecting were few blank lines added in some php files.
-$db_config_path = '../system/application/config/database.php';
+$db_config_path = '../application/config/database.php';
// Only load the classes in case the user submitted the form
if($_POST) {
@@ -25,15 +25,15 @@
} else if ($database->create_tables($_POST) == false) {
$message = $core->show_message('error',"The database tables could not be created, please verify your settings.");
} else if ($core->write_config($_POST) == false) {
- $message = $core->show_message('error',"The database configuration file could not be written, please chmod /application/config/database.php file to 777");
+ $message = $core->show_message('error',"The database configuration file could not be written, please chmod application/config/database.php file to 777");
}
// If no errors, redirect to registration page
if(!isset($message)) {
$redir = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
$redir .= "://".$_SERVER['HTTP_HOST'];
$redir .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
- $redir = str_replace('install/','',$redir);
+ $redir = str_replace('install/','',$redir);
header( 'Location: ' . $redir . 'welcome' ) ;
}
@@ -62,7 +62,8 @@
display: block;
font-size: 18px;
margin: 0;
- padding: 0;
+ padding: 10px;
+ border-radius:10px;
}
label {
margin-top: 20px;
@@ -76,6 +77,7 @@
}
fieldset {
padding: 15px;
+ border-radius:10px;
}
legend {
font-size: 18px;
@@ -90,8 +92,8 @@
</head>
<body>
- <h1>Install</h1>
- <?php if(is_writable($db_config_path)):?>
+ <center><h1>Install</h1></center>
+ <?php if(is_writable($db_config_path)){?>
<?php if(isset($message)) {echo '<p class="error">' . $message . '</p>';}?>
@@ -106,10 +108,9 @@
</fieldset>
</form>
- <?php else: ?>
- <p class="error">Please make the /system/application/config/database.php file writable. <strong>Example</strong>:<br /><br /><code>chmod 777 system/application/config/database.php</code></p>
- <?php endif; ?>
+ <?php } else { ?>
+ <p class="error">Please make the application/config/database.php file writable. <strong>Example</strong>:<br /><br /><code>chmod 777 application/config/database.php</code></p>
+ <?php } ?>
</body>
-</html>
-
+</html>

0 comments on commit 2e7d4d6

Please sign in to comment.