[FX.php List] Passing a direct link
Gjermund Gusland Thorsen
ggt667 at gmail.com
Fri Oct 8 15:06:52 MDT 2004
switch( $_REQUEST['action'] ) {
case 'reprint':
//do this stuff
break;
case 'edit':
//do this stuff
break;
case 'cancel':
//do this stuff
break;
}
On Sat, 09 Oct 2004 09:52:04 +1300, Steve Winter
<steve at bluecrocodile.co.nz> wrote:
> Hey Ben,
>
> > Thanks, that works well _except_ - there's already a $_post data for
> > that field on that page because it is the general search results page,
> > has a form on it that returns to itself - uses $_POST data to refer to
> > existing queries, set up form elements etc etc.
>
> Okay there are a couple of ways to get around this...
>
> > I feel like some of the stuff I'm doing is reasonably OK, and the rest
> > is utterly clueless! ;-)
>
> You'll be amazed at how quickly the shift moves towards the 'reasonably
> OK' and away from the 'utterly clueless'...fear not and carry on, I'm in
> the process of moving an FM web based system I developed in 2000 from
> CDML to using FX.php and when I look at the stuff I wrote 4 years ago
> I'm amazed at how much I've learnt... ;-)
>
> > I will have to set up two searches, I guess, and test for isset
> > ($_POST) or isset ($_REQUEST) to display different result sets? Is
> > that how you'd go about it?
>
> That would be option one, only you'd need to use $_POST and $_GET.
>
> The other option would be to include an additional variable in post or
> your get and then branch on your results page.
>
> Particularly when I'm dealing with bookings on one website I work on, I
> have the one page that things are posted to, then pass a variable I
> call 'action' along with all the other data, that way I can get the one
> page to handle new bookings, edits, cancelations, reprints of the
> confirmation letter (and because I never delete anything it's even
> possible to 'un-cancel' a booking)...
>
> So sometimes you get to the page via a get eg;
> http://server/booking/bookingDetails.php?record=3333&action=reprint
> So that way the bookingDetails.php page kow that all it has to do is
> search the correct db, and display the confirmation letter...
>
> On one form I have all the details, then a collection of buttons at the
> bottom, each of which defines the value of 'action' as the form is
> submitted etc...
>
> Following this method on bookingsDetails.php I then have;
>
> if($_REQUEST['action'] == 'reprint') {
> do this stuff }
>
> if($_REQUEST['action'] == 'edit') {
> do this stuff }
>
> if($_REQUEST['action'] == 'cancel') {
> do this stuff }
>
> (note I'd suggest you start by checking isset($_REQUEST['action']) and
> if not then display some error message, or the default search page or
> whatever you want...
>
> etc etc...note that $_REQUEST is used if your page should be accepting
> either a get or a post, and in fact you can always determine which it
> was (get or post) and use that info to decide what to do...
>
> > Maybe I'll just set up a second results page from the map using a
> > different search for the time being - inefficient, but I'm under the
> > hammer to get a project done - I'll clean it up later on...
>
> Your $_GET/$_POST suggestion above will be just as effective,
> and 'cleaner' if time's of concern...
>
> Best of luck
> Steve
>
> > Thanks!
> >
> >
> > >
> > >Ben,
> > >
> > >Sure there is :-)
> > >
> > >Here's a quick pseudo version of it, I'm writing this off the top of
> > my
> > >head so don't promise it'll work exactly as I write here...On your map
> > >you'd create a link
> > >
> > >http://server/results.php?region=thisRegion
> > >
> > >then on results.php you'd out something like;
> > >
> > >
> > > $thisSearch = new FX($serverIP, $portNumber);
> > > $thisSearch -> SetDBData('yourDatabase', 'layout');
> > > $thisSearch -> AddDBParam('region', $_REQUEST['region']);
> > > $returnedData = $thisSearch -> FMFind();
> > >
> > >now the array $returnedData will contain all of the records from your
> > >search...
> > >
> > >Hope this makes sense, let me know if you need more help...
> > >
> > >Cheers
> > >Steve
> >
> >
> > Ben Rollins
> > IT Manager
> > ElderTreks - Exotic Adventures for travelers 50 and over
> > Toronto, Canada
> > Tel: 416 588 5000
> > 1 800 741 7956
> > Fax: 416 588 9839
> > ben at eldertreks.com
> > http://www.eldertreks.com
> >
> > _______________________________________________
> > FX.php_List mailing list
> > FX.php_List at mail.iviking.org
> > http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
More information about the FX.php_List
mailing list