Removing content without deleting
HTML comments show up in the source, so what if you want to remove text from the page without actually deleting it from the files?
<?php if (false) {?>
(content to be removed…)
<?php } ?>
HTML comments show up in the source, so what if you want to remove text from the page without actually deleting it from the files?
<?php if (false) {?>
(content to be removed…)
<?php } ?>
I have absolutely no idea what that means.
Well for example, I used to have an introduction box at the top of the main page. When I started pulling the dog’s blog feed there I removed the introduction by commenting it out. However, it showed up in the source code. By replacing the HTML comment tags <!- – and – – > (without spaces) with the code above, I was able to keep the text I had written (in index.php template) but it doesn’t show on the outside.
The if “function” needs an expression that is calculated as true, so by writing ‘false’ directly I ensure that the expression is always false, thus the stuff between curly brackets is completely ignored.
ooh, would that work with source codes too? *was wondering (so people can’t really view SOME parts of your source code?)
You want something on the website but don’t want it seen in the source code? That sounds tricky. Some people have disabled the viewing of their sourcecode altogether, but I can’t think of a way to hide a part of it…
Hiding the source is a little tricky. By nature, the Internet is open and free, so there’s no built-in function. You can disable context-clicking for images and source, but that will probably only keep casual surfers from access. It still goes to the cache.
You might be able to use PHP or ASP or something server-side to grab the source and display to the browser.
Yeah, it seems that nothing can hide it. But that’s okay though .. was interested to know if anyone knew anything about that :wink:.