Redirection problem
Moderator: General Moderators
Redirection problem
Hi
I'm using a form to insert some data on a database. After the data is inserted I have added an if {} statement (which is working) and I want (depending on the result of the if) to go to some other page. I haven't found any way yet (except one that shows both pages in one - apparently this is not wanted!). Any ideas?
I'm using a form to insert some data on a database. After the data is inserted I have added an if {} statement (which is working) and I want (depending on the result of the if) to go to some other page. I haven't found any way yet (except one that shows both pages in one - apparently this is not wanted!). Any ideas?
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
I've tried with header() and I get :
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\add_question.php:2) in C:\Program Files\Apache Group\Apache2\htdocs\add_question.php on line 68
The code near is:
... --> code for inserting data from a form to a database
Any ideas why this might happen?
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\add_question.php:2) in C:\Program Files\Apache Group\Apache2\htdocs\add_question.php on line 68
The code near is:
... --> code for inserting data from a form to a database
Code: Select all
<?php if ($alts ==8)
{
header("add_answer_w_5_alt.php"); ----> This is line 68
}
?>Any ideas why this might happen?
- WaldoMonster
- Forum Contributor
- Posts: 225
- Joined: Mon Apr 19, 2004 6:19 pm
- Contact:
Code: Select all
<?php
if (some condition)
{
echo '<meta http-equiv="refresh" content="0;URL=another_page.php">';
exit();
}
?>Refresh can be used after some HTML or other output.