PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 21st, 2000, 03:46 PM
janaka janaka is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Posts: 3 janaka User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
...when a form has a question where the response can be one or more selections either from a series of chech box inputs or a selection list, how would i set into variables only the responses that are checked or selected so that only these values are available for exporting to a mySQL database?
...help with this will be much appreciated.

Reply With Quote
  #2  
Old April 22nd, 2000, 07:07 AM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan
janaka,

you can check whether the variable is set or not with isset()function..

if (isset($checkbox)){
#set the value for the varibale here..
}




------------------
SR -
shiju.dreamcenter.net

Reply With Quote
  #3  
Old April 23rd, 2000, 10:16 PM
firepages's Avatar
firepages firepages is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: Perth West Australia
Posts: 757 firepages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 18 m 32 sec
Reputation Power: 14
if you mean you have something like ..

option1<input type=radio name=thisfield value=1>
option2<input type=radio name=thisfield value=2>

then form variable $thisfield = 1 or 2 depending on selection, then in a conformation form you would use....

option1<input type=radio name=thisfield value=1 <?php if($thisfield==1){ echo "checked";}?>>

option2<input type=radio name=thisfield value=2 <?php if($thisfield==2){ echo "checked";}?>>

AM I even close to what you meant?

------------------
Simon Wheeler
FirePages -DHTML/PHP/MySQL

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > setting variables for only the selected items in form

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap