Jump to content

redirect after with out using header


turtleman8605

Recommended Posts

From a Googled result:

 

<html>
<head> 
<title>Redirect to the right page</title> 
<META 
http-equiv="refresh" content="5;URL=http://www.indiana.edu/~smithclas/l200/">
</head>

(source)

 

Unless you are considering <head></head> the header -- and usually by "header" the HTTP header is meant -- then that's not in the header.

here's the code:

 

<?php

if (array_key_exists('_submit_check', $_POST)) {

// The submitted form is valid, so process it

process_form();

header( 'location:http://www.morseavenuedesign.com/CinemaSightLines.com/sample_forum.php' );

show_form();

}

else {

//The form wasn't submitted, so display

show_form();

}

 

this doesn't work, I get an error that says "Warning... head has already been sent..."

or just use my function instead of header()... saves ALOT of troubles! :-)

 

<?php
function redirect($filename="?", $delay="0", $die="0"){
if((!headers_sent())&&($delay=="0")) header('Location: '.$filename);
elseif($delay=="0"){
  echo '<script type="text/javascript">';
  echo 'window.location.href="'.$filename.'";';
  echo '</script>';
  echo '<noscript>';
  echo '<meta http-equiv="refresh" content="0;url='.$filename.'" />';
  echo '<noscript>';
}else echo '<meta http-equiv="refresh" content="'.$delay.';url='.$filename.'" />';
if($die=="0"){
  db_disconnect();
  exit;
}
}
?>

here's the code:

 

<?php

if (array_key_exists('_submit_check', $_POST)) {

// The submitted form is valid, so process it

process_form();

header( 'location:http://www.morseavenuedesign.com/CinemaSightLines.com/sample_forum.php' );

show_form();

}

else {

//The form wasn't submitted, so display

show_form();

}

 

this doesn't work, I get an error that says "Warning... head has already been sent..."

 

Does process_form() display any data, if so that is why.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.