Seth
Seth

Reputation: 2173

PHP Change Page?

I have found out the bad news about header(), so I am no longer using it, because now my website doesn't work..

Is there any other simple way to change pages automatically?

Upvotes: 2

Views: 6709

Answers (3)

Neil
Neil

Reputation: 3041

Ultimately you'd do well to re-work your code so you do a redirection before sending a bunch of HTML that's never going to be seen. And if you do that - you can use header(), which causes less delay for your end users, reduces processing all round, and is search-engine friendly! Win-win-win.

Upvotes: 1

Slawek
Slawek

Reputation: 782

Try javascript redirection

<script type='text/javascript'>
window.location = "new_page.php";
</script>

or you can use meta-refresh (many examples in google).

If you can't use header in your script, just add ob_start(); at the beginning and then you can use it AFTER html.

Upvotes: 2

Sebastjan
Sebastjan

Reputation: 1147

you mean like redirect? you can also use this:

<meta http-equiv="Refresh" content="5;
URL=http://www.yahoo.com">

Upvotes: 2

Related Questions