PHP Classes

Not redirect

Recommend this page to a friend!

      Access user Class  >  All threads  >  Not redirect  >  (Un) Subscribe thread alerts  
Subject:Not redirect
Summary:problem
Messages:5
Author:mickey19m
Date:2005-05-23 13:45:09
Update:2005-05-24 06:50:05
 

  1. Not redirect   Reply   Report abuse  
Picture of mickey19m mickey19m - 2005-05-23 13:45:09
<<Sorry if my english is not so good.>>

But i have a problem with youre class.

everything is working ecxept 1 thing for now..

i use a template system including a page system (that i can do ?p=exemple)

but no when u go to ?p=example and i am not logged in than i see this message:

========================================
Warning: Cannot modify header information - headers already sent by (output started at /usr/home/mijnsite/domains/mijnsite.nl/public_html/index.php:38) in /usr/home/mijnsite/domains/mijnsite.nl/public_html/classes/access_user/access_user_class.php on line 169

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/mijnsite/domains/mijnsite.nl/public_html/index.php:38) in /usr/home/mijnsite/domains/mijnsite.nl/public_html/classes/access_user/access_user_class.php on line 155

Hello !
You are currently logged in.

Update user account

Update user PROFILE

Click here to log out.

============================================================

You see i am not redirect to ?p=login ...

i have everything done what i must do...

can you help me????

  2. Re: Not redirect   Reply   Report abuse  
Picture of Olaf Lederer Olaf Lederer - 2005-05-23 17:08:25 - In reply to message 1 from mickey19m
The problem is that you sent output to the browser before the header location is used. It's a common problem what happens to php benginners. Check this otherwise show us the first rows (i think in row 38 is the problem).


  3. Re: Not redirect   Reply   Report abuse  
Picture of mickey19m mickey19m - 2005-05-23 18:56:21 - In reply to message 2 from Olaf Lederer
$include_file = fopen("/home/profiel/domains/goldprofile.nl/public_html/begin.tpl", "r") or die("Kan de beginpagina niet openen.!");
while (!feof($include_file)) {
$line = fgets($include_file, 1024);
foreach (array_keys($template_keys) as $foo) {
trim($line);
if (preg_match("/$foo/", $line, $tempmatch)) {
$line = str_replace("$foo", $template_keys[$foo], $line);
}
}
echo $line;
}
fclose($include_file);

this is the code from index .php

echo $line; is row 38...

but youre class is include in index.php as first one:
this is the beginning from index.php:
<?php
include_once("/home/profiel/domains/goldprofile.nl/public_html/classes/access_user/access_user_class.php");


i hope you now a reason why he does this...

i dont now any more

  4. Re: Not redirect   Reply   Report abuse  
Picture of Olaf Lederer Olaf Lederer - 2005-05-23 19:47:18 - In reply to message 3 from mickey19m
The include shouldn't be the point but maybe later where the method is called. If you like then send me the important php files by mail, then I will check it...

  5. Re: Not redirect   Reply   Report abuse  
Picture of mickey19m mickey19m - 2005-05-24 06:50:05 - In reply to message 4 from Olaf Lederer
i mailed to you...

i hope you received him...

its the index.php. i dont now how i can fix this i am working on it almost 5 days...


already thanxx