Solved

predefine variables on HTML load

Posted on 1998-11-16
11
168 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

920 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

17 Experts available now in Live!

Get 1:1 Help Now