Re: switch pages inside a table.

From: Date: Wed, 08 May 2002 14:08:49 +0000
Subject: Re: switch pages inside a table.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-96584@lists.php.net to get a copy of this message
Julie: On Wed, May 08, 2002 at 01:17:41AM -0400, Jule wrote: > > i have a script that uses include 'question.php'; on index.php the > question.php consists of a form, and when te form is clicked > answerquestion.php > how can i get answer.php to open up in the table cell where question.php is? Are you saying you want index.php to show either question.php or answer.php in the same place depending on wheather the form has been submitted? Just like any other situation where you want to do something conditionally, use an if statement (or, if there's more than two options, a switch statement). In the if statement, evaluate some condition that is true in one case and false in the other. Simple thing to do would be to add a "name" attribute to your submit button, so the variable by that name can be the thing you check: if ( empty($_POST['whateveryounamedit']) ) { include(question.php'); } else { include(answer.php'); } If I'm misunderstanding you, which is quite possible because your question is muddled, please clarify your question. Enjoy, --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

« previous php.general (#96584) next »