Structuring forms and scripts

This is a discussion on Structuring forms and scripts within the PHP Language forums, part of the PHP Programming Forums category; Hi guys I need some advice on how to best structure my forms and php code into separate files, and ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-14-2003
Milla
 
Posts: n/a
Default Structuring forms and scripts

Hi guys

I need some advice on how to best structure my forms and php code into
separate files, and how to move variables and form content between
them. I'm sure this is really standard stuff and it must have been
solved over and over already.

This is the flow of what's happening and how it's been structured so
far:

- Script1: Displays a varying number of products (from a previous
search) in a form, each with a check box. The user ticks the products
he wants to order, clicks continue and the form posts to Script2.

- Script2: Lists the products ticked in the form in script1, then
displays another form with input fields where user enters lots of
information. This script/form submits back to itself and performs
field validation until it's happy with all the input. When it is
(happy) the script goes off and does 'other stuff' (this is coded as
an include file) - and all works well.

Now I have decided to complicate things by showing another page just
displaying all information entered so far (in script1 and script2),
before going off to do 'other stuff' or go back to the form in Script2
to change the info. So I'd like to put all of this into Script3 and
call this from Script2, but this is where I run into problems. I
tried (in Script2) a header("Location: script3.php") - but that caused
header problems (although there are probably ways around this) - but
also this doesn't bring me across the form data?

I could code everything into Script2, but then that will be horribly
long and messy and difficult to read, so I'd rather not. This feels
like it must be standard stuff - any suggestions for a php-newbie on
how to solve?

thanks in advance

Milla
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:28 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0