Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Php Header Problem


12 replies to this topic

#11 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 18 August 2008 - 11:47 AM

php header
Php Header Problem

Well. If you really want to redirect users using php then you have to use a buffer or send the header before the anything else is sent.

#12 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 18 August 2008 - 11:48 AM

Replying to Amezis
Dude. Get your facts right. If you buffer your code you can use header after having sent html or any other code to the browser.

#13 Guest_kamal chapagain_*

  • Guests

Posted 13 May 2011 - 12:47 AM

View Postsilentwind, on 06 February 2006 - 05:35 AM, said:

simple javascript function should fix that problem :
?>
<script language="javascript">
  top.location.replace("http://www.path.you.want.to.redirect//");
</script>
<?php

And about your error. It's because you have allready echo an output that is produced by your error.
error = output some html code.

Hi, that was really a good idea and here is the code
$redirect = "<script language=\"javascript\">
top.location.replace(\"http://yourredirectURL\page.php\");
</script>";

if($success) {
echo $redirect;
}
else { echo "Whatever you want"; }

CHEERS




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users