View Single Post
  #1 (permalink)  
Old 2008-03-20, 10:49 PM
OE07U OE07U is offline
Junior Member
 
Join Date: Mar 2008
Posts: 1
OE07U is on a distinguished road
Default Creating input boxes within a PHP If statement

Hi all. I'm new to the forum, and relatively new to webdesign, so please treat me gently.

I have a website which uses PHP, an SQL database and FPDF to create letters to print.

On one page I have a form with a radio button group that carries forward values from 1 - 4 to the next page using post/session variables.

On the second page can I create dynamic input boxes dependent on the value carried forward? Would this be PHP?

e.g

<?php
if ($_SESSION['CT_ST'] == "1" ) {
An input box for a Name would be created ;
}elseif ($_SESSION['CT_ST'] == "2" ) {
A checbox for Home owner would be created ;
}elseif ($_SESSION['CT_ST'] == "3" ) {
etc
}elseif ($_SESSION['CT_ST'] == "4" ) {
etc
}
end
?>

I've tried various versions but none seem to work.



Thanks
Reply With Quote