?
Solved

predefine variables on HTML load

Posted on 1998-11-16
11
Medium Priority
?
180 Views
Last Modified: 2013-12-25
How can I assign a value to a variable, that can be used in a cgi script without having the user to define it from within a HTML page ?

in other words:
1. HTML page is loaded
2. a variable "CHOICE" is predefined with the value "GREEN"
3. this variable "CHOICE" can now be analysed in a cgi script

for the moment I do the following:
<INPUT Type=RADIO NAME="choice" Value="green">

NOTE:
I DON'T WANT THE RADIOBUTTON TO APPEAR(!) SO THE USER CANNOT ACCESS THIS VARIABLE !
I just want the variable "CHOICE" to be defined with "green"

Thx a lot
-Stavi-

PLEASE DO NOT POST ANY ANSWERS UNLESS I ADVICE SOMEONE TO DO SO !!!
0
Comment
Question by:mitrakis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 4

Expert Comment

by:pluim
ID: 1829582
I think your comment telling people not to post answers is rather rude.
If you don't like the answer, you can always reject it.
Also, please don't shout - capitals don't make a post more impressive.

The answer (sorry, _candidate_ _alleged_ _potential_ answer):
<INPUT TYPE="hidden" NAME="choice" VALUE="green">

Hope this helps.

pluim.

0
 
LVL 3

Author Comment

by:mitrakis
ID: 1829583
pluim,

rude ?...not at all.
It's a difference if I get an answer which covers my problem, or answers like "please install WIN95 again" !
I use this forum for months now, and believe me...this pretty small info helps preventing me from such answers.

and with capitals I try to focus attention on specific details :-)

BTW, don't you think that you have to give me the chance to check out the suggestions before crediting any experts ?

I posted the answer for a colleague, so please be patient until I get feedback.

THX for fast help and best regards
-Stavi-

P.S.:
_candidate_has_good_chance_to_get_credits =:-)
0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1829584
I agree with pluim. you can always reject an answer and it makes no difference. Are you trying to delete the question once you got an answer to redeem your points?

and honestly, screaming is not good, no matter how much attention you want to draw. Simply don't do it.

*** there are other ways to draw attention ***

and if you are trying to prevent answers like reinstall or can't do it, then specifically include just this info in normal typing in your question...

regards
Martin

PS: pluim's method is probably the easiest and most efficient but a user who wants to change the value still can: save the file, modify it and change the links to absolute, then simply execute it locally. also, you cannot hide the value from the user.
0
Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

 
LVL 3

Author Comment

by:mitrakis
ID: 1829585
Martin,

>>Are you trying to delete the question once you got an answer to redeem your points<<

I hate insinuations ! Just wanted to let you know...
I do not have 73,232 points of course but this is not a justification to jump on my "way to post questions" !

BTW, it makes a difference for me if I have to reject an answer 1,2,3 or 4 times just to let other experts access my Q (or do you always open locked Qs ??)

Let's come to an end :-)
Nobody had a problem with my postings...till now.
So, I think it would be better to change my way to post Q in ****this**** topic, eh ?

I'll be back with credits, soon

Best regards
-Stavi-

P.S.:
It seems that THIS IS THE AMERICAN WAY TO SHOUT...
and ****************this the german way, maybe ??******************
0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1829586
>I hate insinuations!

It was a possibility I had to consider because many people do it unfortunately. I did not mean to offend you and would like to take what I said off the protocoll...

>BTW, it makes a difference for me if I have to reject an answer >1,2,3 or 4 times just to let other experts access my Q

>(or do you always open locked Qs ??)

I do...but I check these more frequently than the questions to be answered past number 11. I like to see action with questions...

>Nobody had a problem with my postings...till now.

Did not have a problem, I was just agreeing with pluim and curious to find out why you would persue this style rather than the style suggested by the rules of play of EE...

>It seems that THIS IS THE AMERICAN WAY TO SHOUT...
>and ****************this the german way, maybe ?**************

THIS IS ALSO GERMAN but that is not the point. I agree that even **this** can be annoying but at least it is not considered screaming in the Netiquette. The best call is to simply use standard text...that is what I always do and if you make the text attractive to read (ie entertaining), people will get it!
0
 
LVL 1

Expert Comment

by:rajgn
ID: 1829587
Somebody forgot Experts in Experts-exchange???
0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1829588
close to my point...
0
 
LVL 28

Expert Comment

by:sybe
ID: 1829589
<input type="hidden"> (etc) can be edited in the way MaDduck describes. But there are ways to prevent that. The easiest way is to make sure in the CGI (where the form is send to) that the domain of the HTTP_REFERER and the domain of the CGI are equal. If not just don't process the form but redirect the browser to some nasty page, because you are sure that he's been trying to fool things.
0
 
LVL 3

Author Comment

by:mitrakis
ID: 1829590
Martin,

think we understand each other :-)
I just like this forum for getting quick, good suggestions on **any** (hehehe, I like this style) problem I posted in EE.

Just let us come to an end...I'll try to post Qs in a "better way", so there's no need to discuss anything but the **real problem** =:-))

I would like pluim to post the answer, so he can get credits...his suggestion worked for my colleague.
FYI, it's not important for him to avoid access on this variable. He just wanted it to be defined without displaying it (and this way a user cannot change it "accidently").

THX guys...see you on my next Q :-)
Regards
-Stavi-
0
 
LVL 4

Accepted Solution

by:
pluim earned 200 total points
ID: 1829591
Stavi,

Thanks for working with the experts on the etiquette of posting questions.
A lot of people would just have started flaming instead - refreshing!

Answer as posted.

pluim.

0
 
LVL 3

Author Comment

by:mitrakis
ID: 1829592
Thanks again :)

Best regards
-Stavi-
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question