This topic is locked

Problem with Redirect

2/21/2008 6:43:02 AM
PHPRunner General questions
M
Maverick31 author

Hi everyone !! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=7622&image=1&table=forumtopics' class='bbc_emoticon' alt=':rolleyes:' />
I have the following error :
Cannot modify header information - headers already sent by (output started at C:\Program Files\PHPRunner4.1\projects\Test\output\include\_attendee_events.php:33)
The code used is :

//** Redirect to another page ****

header("Location:_attendee_list.php");

exit();
In fact, I just want to go back in the list view, once infos are entered in the Add page.
I don't understant why I have this error. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=7622&image=2&table=forumtopics' class='bbc_emoticon' alt=':blink:' />
Thank you !!

J
Jane 2/21/2008

Hi,
what event do you use for this code?

M
Maverick31 author 2/21/2008

Into the Event:After Record Added

Mav'

J
Jane 2/21/2008

Hi,
it's difficult to tell you what's happening without seeing actual files.

You can publish your project on Demo Account and post a URL to your pages here or send it to [email=support@xlinesoft.com]support@xlinesoft.com[/email] along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.
As workaround try to use JavaScript code instead of your code:

?><script>

window.location='_attendee_list.php';

</script><?php

Alexey admin 2/21/2008

Hi,
header() function must be called before any actual output is sent.

So inspect your events and remove echo or any other output statements from there.
You can find more info here:

http://www.php.net/header

M
Maverick31 author 2/21/2008

Hi,

it's difficult to tell you what's happening without seeing actual files.

You can publish your project on Demo Account and post a URL to your pages here or send it to [email=support@xlinesoft.com]support@xlinesoft.com[/email] along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.
As workaround try to use JavaScript code instead of your code:


Yes !!

With JavaScript it works perfectlly !!

Thank you so much !!

Mav !