Jump to content
MakeWebGames

header() alternative


Recommended Posts

Posted

This is a shout for help, as i got stucked and can't seem to get this going...

header('Location:'.$_SERVER['SERVER_NAME'].'/validate.php?page='.$page.''); - This one errors with "Warning: Cannot modify header information" message.

This one works, yet it briefly messes the layout and is slow

<META HTTP-EQUIV="refresh" CONTENT="0;URL=validate.php?page=<?=$page?>">

document.location.href - this one is not an option.

Also already tried to clean out buffers before redirecting but outcome is the same.

Any ideas?

Posted

Re: header() alternative

killah: i've thought of that option,

 

Also already tried to clean out buffers before redirecting but outcome is the same.

 

and oddly enough it keeps erroring!

Guest Anonymous
Posted

Re: header() alternative

Tried adding ob_start(); after the <?php

usually works for me.

Posted

Re: header() alternative

 

Tried adding ob_start(); after the <?php

usually works for me.

 

Yet oddly enough... this one worked!

@ killah the code you have given was one of many tries before my OP.

Thx both :)

  • 1 month later...
Posted

Re: header() alternative

That header message usually appears when you have whitespace or content displaying before the header.

The header is announced before the HTML, so the browser can render it. How can it render with HTML to process? It screws it up.

Hope it helps.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...