RE: [PHP] Re: simple ?- load page after submit
| From: | Katie Dewees | Date: | Fri, 23 Jan 2004 17:19:56 +0000 |
| Subject: | RE: [PHP] Re: simple ?- load page after submit | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175547@lists.php.net to get a copy of this message | ||
Matt Hedges wrote:
<snip>
> When I put the code below, I get a "can't send header" error.
>
> I tried changing the echo to <a href="page.php?id=$id">page</a>, but
> the page brings up page.php?id= (id = nothing).
</snip>
If it says it can't send the headers, that means that headers have already
been outputted. PHP automatically sends headers before anything is printed
to the page. In other words, make sure that you put your header() call
before any echo statements on the page.
Not having the id value is a different problem. If you've just inserted
something and need to get it out, there are functions to retrieve the most
recent auto-increment value from the database. If you're using MySQL it is
mysql_insert_id().
Katie Dewees
Web Developer/PHP Programmer
kdewees@bellsouth.net
http://www.evans-young.com