473,806 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("Locatio n: 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
Jul 17 '05 #1
0 1318

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1774
by: jmgro | last post by:
I need help in structuring a 200 question survey. Each question has three responses, and I want all 200 questions displayed at the same time with the user using the scrollbar to go down. What is the best approach?
1
1634
by: Gary Shell | last post by:
I am trying to figure out the best way to subdivide a project for multiple programmers. I am embarking on a new development project with one other person but with an idea in mind that we may need to add a couple more folks on as we progress. The user interface is an "outlook style one" with a treeview over a small navigation pane with a splitter bar and a, for lack of a better term, content area. Selections made in the treeview will...
3
1200
by: arun.hallan | last post by:
Hi, I need some structuring help. I have a set of data, in the form of an arraylist of objects. Each object is the same, and can be treated as a generic object which gets and sets properties. I want to display this in a datagrid - which is not too hard. I've done this by mapping the object data to a datatable, and then
0
1090
by: Vinay Nagrik | last post by:
Hello Group members, I have access to server side php script which takes parameters from a form and processes the buffer and saves the file. However, I, as an implementor, do not have the luxury to use form based scripts. All I want to do is telnet to server and type in whole buffer/filename and use Header for Content_disposition.
7
1733
by: JohnGoogle | last post by:
Hi, I'm new to Visual C# and I am looking for guidance with structuring projects. I am wanting to develop a DLL assembly which will contain all my common classes which will be used by various projects. During development of this DLL assembly I have decided to have a second project which will be a console application whose entire job is to run code to test the classes to iron out bugs etc.
2
2008
by: Susanne West | last post by:
hi group. i'm tackling a bigger project that will use mod_rewrite to patch a series of urls into a master php-script. this script builds the page framework that contains a series of elements that remain on every page. only a center part (a <div>) is filled with different contents, depending on how the page is called (= mode of the page). the point is, there are quite a few (approx 20) different 'modes' for the center part to be filled...
19
248294
Atli
by: Atli | last post by:
Introduction At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect this data is essential to any developer. This article is a basic tutorial on how to user HTML Forms, the most common method of data collection. Assumptions - Basic HTML knowledge. - Basic PHP knowledge. HTML Forms A common and simple way of...
4
1568
by: Tom de Neef | last post by:
I hope you don't mind trivial questions. I only ask them after failing to find answers in my book and on the web... Can I split Javascript code into separate js files which reference each other (hierarchically)? For instance, can I put core functions in a library file and refer to them from other script files (like: $ïnclude "core.js"). TIA Tom
3
7222
by: =?Utf-8?B?TWlrZSBDb2xsaW5z?= | last post by:
I have a web application that I started building. I created a master page with some javascript in the head: <script src="<%# Request.ApplicationPath%>/Scripts/Main.js" type="text/javascript"></script> I am also using themes and set my default theme in webconfig: <pages theme="Default"> <controls>
0
9597
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10620
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10110
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9187
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5682
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3851
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.