Solved

predefine variables on HTML load

Posted on 1998-11-16
11
167 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
  • 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
 
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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 50 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now