PDA

View Full Version : Gzipped content?


Beau
07-21-2005, 08:58 PM
I recently uploaded the latest version of my site: http://lilbro.net/ and ran into a problem with the .htaccess fuction:

php_value output_handler ob_gzhandler

The problem being that my site re-direction headers (I'm assuming) and other things won't work without that, I don't know why, but Bihira doesn't seem to allow that and it returns a 500 error.

I'm not really sure what's wrong if you could please help me.

Here is one of the errors that come up....


<i>Warning: Cannot modify header information - headers already sent by (output started at /home/lilbrone/public_html/header.php:32) in /home/lilbrone/public_html/members/login.php on line 20

Warning: Cannot modify header information - headers already sent by (output started at /home/lilbrone/public_html/header.php:32) in /home/lilbrone/public_html/members/login.php on line 21

Warning: Cannot modify header information - headers already sent by (output started at /home/lilbrone/public_html/header.php:32) in /home/lilbrone/public_html/members/login.php on line 22
Log In</i>


And here is the file: login.php

<i><?php
$location = $_SERVER['REQUEST_URI'];

if(isset($_POST['submit']))
{
$username = htmlentities($_POST['username']);
$password = md5($_POST['password']);
$varify = mysql_num_rows(mysql_query("SELECT user_id FROM users WHERE user_name = '$username' AND password = '$password'"));

if ($varify == 1) {
define('no_error', true);
}
else {
header("Location: /members/login_error.php");
}
}

if(defined('no_error'))
{
setcookie("lilbro_username", $username, time()+7776000, "/");
setcookie("lilbro_password", $password, time()+7776000, "/");
header("Location: $location");
}
?>


<form action="<?= htmlentities($_SERVER['REQUEST_URI']) ?>" method="post">
<fieldset>
<legend>
Log In
</legend>

<input type="text" class="login_box" id="username" name="username" />
<input type="password" class="login_box" id="password" name="password" />
<input type="submit" name="submit" value="Login" id="login_button" />

</fieldset>
</form></i>


Help is greatly appreciated!

BihiraJonathan
07-22-2005, 01:58 AM
The 500 errro is because we no longer allow php value changes in .htaccess. You can still do php value changes, but you will need to create a php.ini file in the directory you want that value to be changed.

In the php.ini you would put a php value like this:

output_handler ob_gzhandler

However since php.ini isn't .htaccess, it acts differently. You will need to upload a php.ini file with that code for each directory you want it to effect.

For example, say you uploaded a php.ini file into public_html with the value output_handler ob_gzhandler. It will only effect public_html folder, so if you want the same value to work for another directory (for example public_html/files/), you will need to upload another php.ini file into that folder as well.

Beau
07-22-2005, 10:43 AM
Ok, thanks. I ended up putting ob_start("ob_gzhandler"); into my header.....

That's too bad about the .htaccess though.