header redirect not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, folks.  I'm running into an incredibly bizarre problem with a
header() redirect of which I cannot see the cause.

We have a CMS here where I work, in two separate production and training
environments.

Last night I implemented a new events manager module, copying all
necessary files from training to production, adding database tables,
etc. etc.

Everything worked, except for one redirect which happens after a user
deletes an event.  For some reason, the redirect is simply reloading the
event detail page from which the user clicked the delete link.

But the truly bizarre thing is that in the training environment it
works!!!

There is nothing different between the two files except for '-test'
being added to the subdomain (so it's cms-test.mydomain.com instead of
cms.mydomain.com) in any full paths.

The code that deletes the event, and then redirects the user is:

$conn->Execute("delete from cms_events where e_id = {$fd['e_id']}") or
$this->CMS_error(2,$this->mod_name,$query,$conn->ErrorMsg());
		
header("Location:{$this->CMS_base_path}mods/events_manager/cms.events_ma
nager.dsp.php");

Not to much to see here.  If the query doesn't execute the CMS_error
method is called, and the header would never be reached.

However, the query does execute, the event is deleted, but instead of
going to the appropriate location, it's simply redirecting back to:

/mods/events_manager/cms.events_manager.event_detail.dsp.php?e_id=15

where 15 is whatever the number of the event that was just deleted was,
and ergo it brings up an "Invalid event" error, and the user can then
click a link at the bottom of the page to go back to the main events
manager page.

Can anyone think of any reason why the above code, just those two lines,
would redirect correctly in one environment, yet simply redirect to the
currently existing page in another?

There are a number of other redirects in the events module that are
working fine, so why this one would work in the training environment and
not in the production environment is mystifying me.

Cheers, and thanks very much in advance for any help. This one hurt my
brain this afternoon.

Pablo

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux