blazing_bruce Posted March 19, 2006 Share Posted March 19, 2006 hello, i am using a script named work.php for two purpose .1. displaying banner image2. checking remote address and putting clicks and hits informations in tables 2.1 after making these data base operations, redirecting browser to the $rediurl by using header();$rediurl = // my urlheader("Location:$rediurl");i spliting my script by two separate if conditions.1st condition for displaying image by echo("<center><a href=\"$hrf\"><img src=\"$banurl\"> <br> </a></center>");in second condition i am checking ip and date values, after that trying to redirect.by: mysql_close($connection);echo("until db Close "); // this is for debugging processheader("Location: $rediurl");i can get dbclose acknowledgement too. the header line didn't executed.Pleaese help me. Quote Link to comment https://forums.phpfreaks.com/topic/5307-headerlocation-httpdomaincom-not-working/ Share on other sites More sharing options...
hitman6003 Posted March 19, 2006 Share Posted March 19, 2006 The manual very clearly states:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. [/quote][a href=\"http://www.php.net/header\" target=\"_blank\"]http://www.php.net/header[/a] Quote Link to comment https://forums.phpfreaks.com/topic/5307-headerlocation-httpdomaincom-not-working/#findComment-18852 Share on other sites More sharing options...
blazing_bruce Posted March 19, 2006 Author Share Posted March 19, 2006 then how can i redirect to $rediurl? i want to redirect by based on some conditons.Please help me.Thank you,Karthi keyan. Quote Link to comment https://forums.phpfreaks.com/topic/5307-headerlocation-httpdomaincom-not-working/#findComment-18859 Share on other sites More sharing options...
Prismatic Posted March 19, 2006 Share Posted March 19, 2006 [!--quoteo(post=356470:date=Mar 19 2006, 03:04 PM:name=blazing_bruce)--][div class=\'quotetop\']QUOTE(blazing_bruce @ Mar 19 2006, 03:04 PM) [snapback]356470[/snapback][/div][div class=\'quotemain\'][!--quotec--]then how can i redirect to $rediurl? i want to redirect by based on some conditons.Please help me.Thank you,Karthi keyan.[/quote]Add ob_start(); to the very beginning of your script (First line of it) and then add ob_end_flush(); to the very end of your script (last line) and the header redirects will work just fine :) Quote Link to comment https://forums.phpfreaks.com/topic/5307-headerlocation-httpdomaincom-not-working/#findComment-18865 Share on other sites More sharing options...
blazing_bruce Posted March 19, 2006 Author Share Posted March 19, 2006 Great Prismatic, Thanks :) Really it is redirecting me. but one problem. i am using that redirecting line inside <iframe> tag so redirect url's content is showing inside of that iframe. if you are not clear with me then have a look at [a href=\"http://karthi.livesoft.info\" target=\"_blank\"]http://karthi.livesoft.info[/a] i want to load redirection page fully in browser atleast open in new window.Please help me,Thank you,Karthi keyan. Quote Link to comment https://forums.phpfreaks.com/topic/5307-headerlocation-httpdomaincom-not-working/#findComment-18870 Share on other sites More sharing options...
blazing_bruce Posted March 19, 2006 Author Share Posted March 19, 2006 Hello, i fixed this problem now. by embedding simple java script lines. like?><script language="javascript" type="text/javascript"> <!-- Newsite= window.open("<?php echo("$rediurl"); ?>","newsite"); // --> </script><?Thank you friends and PHP Freaks.Thank you,Karthi keyan. Quote Link to comment https://forums.phpfreaks.com/topic/5307-headerlocation-httpdomaincom-not-working/#findComment-18888 Share on other sites More sharing options...
Prismatic Posted March 19, 2006 Share Posted March 19, 2006 [!--quoteo(post=356499:date=Mar 19 2006, 04:01 PM:name=blazing_bruce)--][div class=\'quotetop\']QUOTE(blazing_bruce @ Mar 19 2006, 04:01 PM) [snapback]356499[/snapback][/div][div class=\'quotemain\'][!--quotec--]Hello, i fixed this problem now. by embedding simple java script lines. like?><script language="javascript" type="text/javascript"> <!-- Newsite= window.open("<?php echo("$rediurl"); ?>","newsite"); // --> </script><?Thank you friends and PHP Freaks.Thank you,Karthi keyan.[/quote]window.location would probably suit you better :) Quote Link to comment https://forums.phpfreaks.com/topic/5307-headerlocation-httpdomaincom-not-working/#findComment-18899 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.