GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP geeks - quick assist needed :) (https://gfy.com/showthread.php?t=616442)

Damian_Maxcash 06-01-2006 01:28 AM

PHP geeks - quick assist needed :)
 
Why dosnt this work? - I get the dreaded 'Headers already sent' error.


Code:

<?php function comefrom()
{
$lang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
if (substr($lang, 0, 2) hahahaha 'zh')
{
header("Location: http://asiafriendfinder.com/search/g462236-pct?race=2&show=F&age=18-27");
} else {
header("Location: home.php");
}
}

comefrom();

?>

Thanks :)

ssp 06-01-2006 01:31 AM

It probably means this piece of code is somewhere in the middle of your PHP code.. maybe even after something gets outputted (echo). Try moving it to the top.

Damian_Maxcash 06-01-2006 01:31 AM

Its ok - I fixed it - I had a line before the function.

ssp 06-01-2006 01:33 AM

Yep.. headers go first.


All times are GMT -7. The time now is 03:54 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123