[Gllug] RE : anyone into PHP?
gllug at uncertainty.org.uk
gllug at uncertainty.org.uk
Tue Nov 6 18:00:34 UTC 2001
> On Tue, 2001-11-06 at 13:13, Allen Wayne wrote:
> > silly PHP question..... how do I force a jump to another page in PHP?
>
> The answer in terms of before output has already been given; I'm
> assuming you're trying to do this during a code block in the middle of a
> page, though. I'm open to correction (and am usually corrected ;-) but
> I can't see this being possible outside of a meta-refresh or header -
> it's just not How HTTP Works. I'm thinking that you're going to need to
> find another way to accomplish what you're trying to do.
>
> You are right in asertaining what I am trying to do. I have a page with a
> form that posts data to add.php3. This file then writes data to the MySQL DB
> and then jumps to another page. add.php3 has no visual aspect.
>
as people have said - you can issue a Location header to get the users
browser to call the other page.
but I don't like to do this without good reason - it presents the user
with further delay - not a huge delay but if its easy to avoid ...
It does depend on why you have a php file that presents no output and if
you are trying to fit into an already existing setup.
you could either get add.php3 to include("otherpage.php") or change the
form to submit to otherpage and then make otherpage like
if ($form_data_submitted){
include("add.php");
}
- there are many ways of doing this sort of thing, I rarely find I need
to issue a redirect.
--
Sean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 274 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20011106/3aebc492/attachment.pgp>
More information about the GLLUG
mailing list