PHP header problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Cesar
Forum Commoner
Posts: 31
Joined: Sat May 22, 2004 1:35 am

PHP header problem

Post by Cesar »

Hi, I have a problem with send header if my page by UTF-8 encoding.

Code: Select all

<?php
header('Location: ../index.php');

?>
It is dont work when charset=utf-8, but it work when charset=ISO-8859-1.
Where is the error.

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

have you tried full urls? Sounds odd, but it may be part of it. Maybe your server is sending out two conflicting content types...?
Breckenridge
Forum Commoner
Posts: 62
Joined: Thu Sep 09, 2004 11:10 pm
Location: Breckenridge, Colorado

Post by Breckenridge »

try this

Code: Select all

header("HTTP/1.1 303 REDIRECT");
header("Location: http://domain.com/dir/index.php");
header("Connection: close");
Cesar
Forum Commoner
Posts: 31
Joined: Sat May 22, 2004 1:35 am

PHP header problem

Post by Cesar »

--Maybe your server is sending out two conflicting content types...?--
You mean in php.ini
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

no, I mean your code may be sending out conflicting content types. You'd need to look at the page headers your script sends out (actually sends out, not what you are asking it to send)

searching under for my posts with threads that talk about headers and curl will find several I've posted code bits on how to retrieve detailed headers.
Cesar
Forum Commoner
Posts: 31
Joined: Sat May 22, 2004 1:35 am

PHP header problem

Post by Cesar »

I dont send a content. i have index.php in root directory and in index.php i have code

Code: Select all

<?php
header('Location: ../src/index.php');
?>
and i have in /src index.php with my site code.
But first index.php dont redirected to ../src/index.php
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you probably need a full url. That's what the standard says it should be anyways.
Cesar
Forum Commoner
Posts: 31
Joined: Sat May 22, 2004 1:35 am

Post by Cesar »

I try with full URL, but it dont work. Problem with function header, it dont work in utf-8 encoding
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

wait, you're putting utf8 encoded characters into the header function?
Cesar
Forum Commoner
Posts: 31
Joined: Sat May 22, 2004 1:35 am

Post by Cesar »

NO, I create php page on Dreamweaver and Page preferences is view encoding = utf-8. ONLY.
User avatar
mudkicker
Forum Contributor
Posts: 479
Joined: Wed Jul 09, 2003 6:11 pm
Location: Istanbul, TR
Contact:

Post by mudkicker »

try writing the url without ".."
i mean

/src/index.php
Post Reply