Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Getting passed value for Switch
At present I have webpage which is just a selection of 5 forms which
pass informaton to a .php files which update individual fields in a
database - i.e. price, details, type etc.

At present I'm using separate files for each form, which works well, but
I'm thinking about almalgamating them into one, which would be a more
elegant way of doing it.

I was going to use the switch function and then activate the required
code depending on which information was sent.

I can't figure out how to get the value of the sent information into the
switch variable.

Can anyone help?

TIA, Russ

pseudo code something like this:

<?php
$flag = value sent - could be $newdetail, $newprice etc..;

switch ($flag){
case $newprice:
action this code;
break;
case $newdetails:
action this code;
break;
etc...
}
?>


--
take out the trash to email

Report this thread to moderator Post Follow-up to this message
Old Post
highway of diamonds
11-30-04 09:00 PM


Re: Getting passed value for Switch
You can use named "submit" inputs and decide what was submited by checking
which variable is set (coresponding to which button). You may also use
form names (when "submit" button is not named, and form is, then the browser
should send "submit" button value under the form name).

Hilarion



Report this thread to moderator Post Follow-up to this message
Old Post
Hilarion
11-30-04 09:00 PM


Re: Getting passed value for Switch
Hilarion wrote:
> You can use named "submit" inputs and decide what was submited by checking
> which variable is set (coresponding to which button). You may also use
> form names (when "submit" button is not named, and form is, then the brows
er
> should send "submit" button value under the form name).
>
> Hilarion
>
>
Yep, obviously to close to it for too long... thanks,

coded as

switch (TRUE){
case $newprice:
action this code;
break;
case $newdetails:
action this code;
break;
etc...

works well!

R.
--
take out the trash to email

Report this thread to moderator Post Follow-up to this message
Old Post
highway of diamonds
12-01-04 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP SQL archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:16 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.