Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2008-03-20, 10:49 PM
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
  #2 (permalink)  
Old 2008-04-14, 01:41 AM
Junior Member
 
Join Date: Apr 2008
Location: Cheltenham, UK
Posts: 12
hoopyfrood is on a distinguished road
Default CAN BE FIXED: sample would do :)

Hi OE07U,

it looks as though you're on the right track, yet in order to be able to fully help you can you please submit the full example of your PHP and HTML (the form and the script processing it) code?

Have you tried echoing the values of the submitted data? I.E. does the SESSION contain the information expected?

Good luck,
hoopyfrood
__________________
Love your documents!

DocuView - The best Web 2.0 document management system (DMS) - utilising the latest technology to help your company achieve ISO 9001 certification.
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

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



All times are GMT +1. The time now is 02:39 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.