I'm having a problem passing a variable between sub-routines. If I initialize it in DB.CGI the value will pass, but I cannot change the value in any other sub-routines. Basically, I wish to have a flag of what report type the user has chosen, pass this to html_view_success, and use it to conditionally format the output. Any advice would be appreciated.
Jul 18, 1999, 9:23 PM
Veteran / Moderator (8669 posts)
Jul 18, 1999, 9:23 PM
Post #3 of 9
Views: 2399
marksat, I still don't know what you're trying to do.
If you want to pass the value of a form field to the script, use
$in{'form field name'}
So, if your checkbox was named "Friend," you would access the value of the checkbox by the variable
$in{'Friend'}
Does that help?
------------------
JPD
If you want to pass the value of a form field to the script, use
$in{'form field name'}
So, if your checkbox was named "Friend," you would access the value of the checkbox by the variable
$in{'Friend'}
Does that help?
------------------
JPD
Jul 18, 1999, 9:38 PM
User (172 posts)
Jul 18, 1999, 9:38 PM
Post #4 of 9
Views: 2390
Thanks JPD,
I hope you're feeling better...It's a real bummer to go on vacation and not be well.
I hope you don't confuse marksat and my issues; it's just that they seemed similar, so I decided to post here instead of starting a new topic.
Basically, what you suggest is what I want to do. The checkbox on the login screen is not a database field though, and I want the value available to the rest of the script. But since it's a checkbox, what is it's checked/unchecked value and how do I check for it ?
Thanks much.
I hope you're feeling better...It's a real bummer to go on vacation and not be well.
I hope you don't confuse marksat and my issues; it's just that they seemed similar, so I decided to post here instead of starting a new topic.
Basically, what you suggest is what I want to do. The checkbox on the login screen is not a database field though, and I want the value available to the rest of the script. But since it's a checkbox, what is it's checked/unchecked value and how do I check for it ?
Thanks much.
Jul 18, 1999, 9:57 PM
Veteran / Moderator (8669 posts)
Jul 18, 1999, 9:57 PM
Post #5 of 9
Views: 2408
It's fine that you posted in this topic. Makes perfect sense to me.
(BTW, I am feeling quite a bit better. Thanks for your concern.
But I think I really do need this vacation!)
It doesn't matter whether it's a field in your database or not. There's all sorts of stuff that gets passed as "$in{'something'}" variables in the script.
You know, I don't know for sure what value is passed with a checkbox. To be sure, you can give it a value.
<input type="checkbox" name="Friend" value="1">
Then, when you test for it, you would use
do something;
}
Or you could use
do something;
}
It should give you the same results either way.
------------------
JPD
(BTW, I am feeling quite a bit better. Thanks for your concern.

It doesn't matter whether it's a field in your database or not. There's all sorts of stuff that gets passed as "$in{'something'}" variables in the script.
You know, I don't know for sure what value is passed with a checkbox. To be sure, you can give it a value.
<input type="checkbox" name="Friend" value="1">
Then, when you test for it, you would use
Code:
if ($in{'Friend'}) { do something;
}
Or you could use
Code:
if ($in{'Friend'} == 1) { do something;
}
It should give you the same results either way.
------------------
JPD
Jul 19, 1999, 11:27 AM
Veteran / Moderator (8669 posts)
Jul 19, 1999, 11:27 AM
Post #9 of 9
Views: 2396
Down to California (I live near Seattle). My college roommate and I are spending a week at her parents' house in the SF Bay area and we're going to spend a couple of days in Monterey. I'm finally going to see the aquarium!
Let me know how the code works out for you.
------------------
JPD

Let me know how the code works out for you.
------------------
JPD