Re: Still executing afte die()?
| From: | Leif K-Brooks | Date: | Sat, 04 Jan 2003 05:44:14 +0000 |
| Subject: | Re: Still executing afte die()? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-130207@lists.php.net to get a copy of this message | ||
But I only want it to insert if the page was all lowercase when they went to it. I understand it continuing after redirecting, but why after die()ing too? Putting the insert code into an else statment solved the problem, but it's ugly, and the question still remains... why does it do this?
Jason Wong wrote:
On Saturday 04 January 2003 11:00, Leif K-Brooks wrote:-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.But it shouldn't get to the database insert because of the redirect either... I only added the die; when it still inserted with the redirect.As you have already found out, the code _does_ continue to execute after the header() redirect. Try this: if (not_lowercase) { insert_into_db(); header(); die(); }