[Gloucs] problem with php

Keith Edmunds keith at midnighthax.com
Tue Apr 19 09:12:20 BST 2005


On Mon, 18 Apr 2005 19:54:07 +0100
stilman davis <stilman.davis at telinco.co.uk> wrote:

> <?php
> if (isset($_POST['action']) && $_POST['action'] == 'submitted') {
> header("Location: test2.php");

> None of the posted values are seen in test2.php 

That would be because you haven't passed any values to test2.php.

There is A LOT of sense in keeping both parts in one file (for example, if
your user clicks on the "Back" button to correct an entry, what will
happen?). However, if you want to split it up in this way remember that
each URI called is complete in itself: unless you use session variables or
some other mechanism, there is no state information retained between
loading one page and the next. If you wanted the above to work, you'd need
to write:

	header("Location: test2.php&action=submitted&...");

- and you'd need to populate the "..." with all the values you want to pass
to the second page. Trust me, you do not want to do that.

You might want to consider using PEAR's HTML_QuickForm - there's a tutorial
on my website at http://www.thelinuxconsultancy.co.uk/techinfolist.php.

HTH
Keith

-- 
----------------------------------------------------------------------
       Linux consultancy: http://www.TheLinuxConsultancy.co.uk
----------------------------------------------------------------------



More information about the gloucs mailing list