THE BEST WAY TO PASS INFORMATION IN A TROUBLESHOOTER

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
alcodesign
Forum Newbie
Posts: 3
Joined: Thu Aug 28, 2003 6:55 am

THE BEST WAY TO PASS INFORMATION IN A TROUBLESHOOTER

Post by alcodesign »

i am trying to make a troubleshooter where people answer a set of questions and help is presented to them based on these questions. kind of like the windows troubleshooter. i could put a form on one page and have users fill it out, but i wanted something that went step by step to ensure people are doing things correctly. any ideas or suggestions are greatly appreciated.

--AL
User avatar
Rook
Forum Newbie
Posts: 10
Joined: Thu Aug 21, 2003 10:40 am
Location: Euless, Tx.
Contact:

Post by Rook »

Code: Select all

<?php
if (!$_POST) {
	
	// show initial drop down box of common problems
	
} elseif ($_POST['problem'] == 1) {
	
	// show stuff related to problem 1
	// or
	// show another drop down box of more specific problems related to problem 1
	
	if ($_POST['sub_problem'] == 1) {
		// show stuff related to sub_problem
	}

} elseif ($_POST['problem'] == 2) {

	// show stuff related to problem 2
	// or
	// show another drop down box of more specific problems related to problem 2
	
	if ($_POST['sub_problem'] == 1) {
		// show stuff related to sub_problem
	} elseif ($_POST['sub_problem'] == 2) {
		// etc...
	}
}
?>
Of course that's a very simple structure... you could get into more complex stuff using a database where issues and solutions are indexed and associated with each other.

- Rook.
Post Reply