Connecting Tech Pros Worldwide Help | Site Map

Structuring forms and scripts

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 12:32 AM
Milla
Guest
 
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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.