View Full Version : hide inputs in source
Demonicman
11-25-2007, 11:23 PM
can you use php or anythign for that matter to hide <input type=hidden value='hi'> from the source code?
people just post what are supposed hidden values in chat and its getting annoying
djr33
11-25-2007, 11:39 PM
No. You can't. Source code is sent to the browser then used to display the content. You don't send it, you don't display it; you end it, they have it. It's how the web works. Read any number of long, tedious conversations on the subject as you desire (search around for it-- there's on near the top of the Javascript forum at the moment).
A hidden input is something else entirely. Like a textbox, or a radio button, it's a type of input for a form. However, this type isn't actually displayed on the page. A hidden input only exists in the source code (and will always be there, or not exist).
You can use a hidden input, for example, to store an ongoing variable, such as the score. They answer the next question (via a form), and the score is sent along with it.
That isn't secure, but it would work. There are not that many cases when a hidden input is needed. Mostly, it's just to make the form work, such as helping to set some value so the next page accepts it, or send unchanging info that will be available, such as the recipient email for a form.
Using PHP sessions, cookies, etc are other ways to accomplish the same thing (and better in many cases).
Demonicman
11-25-2007, 11:42 PM
thanks thats what i thought but i just wanted to make sure
i figured storing it in a table would work but meh, too much work
djr33
11-25-2007, 11:49 PM
A table? In a database or html? Databases aren't a lot of work, once setup on your system. If it's just for one page, then, yeah, it can be a lot of work. Sessions, I'm guessing, would be easiest and work well.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.