This question already has answers here:
Hiding the source CSS code
(3 answers)
How to protect css files [closed]
(1 answer)
Closed 4 years ago.
Is there anyway to hide css code from source code. So, no anyone can copy my code. Or, any other language is available for styling like css and it is not visible in source code. I know it's silly question.
Here I am also asking about alternate language of css which is not visible in source code.
Is there anyway to hide css code from source code. So, no anyone can copy my code.
Short answer: No. CSS must be sent as plain text to your clients' computers if you want your page to be rendered.
I hide my Javascript code from source code by implementing between PHP.
What? No, you cannot hide Javascript either, for the same reason.
You can minify or obfuscate this code, but you cannot avoid sending it (if you want it to be used).
There is NO way to hide the client side components like CSS.
you can check it here
Related
This question already has answers here:
Include another HTML file in a HTML file
(41 answers)
Closed 5 years ago.
Have a static website i am going to work on for a friend of about 4 distinct pages with a common footer, header, and nav. Just basic "this is who i am... this is what i have done... this is how to contact me." I would like to import the common sections either into a layout file where the contents that are specific to each page are included in, but if not, be able to include the common sections into each unique page. Just trying to avoid duplicative code.
I am familiae with Django and Laravel bur that would be overkill. Dont think ReactJS or Angular either since these are just static pages with almost no dynamic content, some animated behaviors that can be done with CSS, jQuery or VanillaJS.
A couple options came to mind and also some i read here on SO. The main options seem to be to use PHP include which seems pretty clean. Or use jQuery which seems a little messier. I would prefer to keep this project just HTML, JS, CSS if possible so the latter would seem the better option.
Are there any other options or lightweight, basic, HTML templating engines that can accomplish this? Again i dont need to render dynamic content nor database data.
You need to change your file extensions to .php
So the end result would look like this:
<?php include 'header.php'; ?>
ALL YOUR CONTENT HERE
<?php include 'footer.php'; ?>
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
How do I hide view-source in core php or html?
I have read this but I am unable to understand how to use:
Web Developer Class: How to Hide your Source Code
The simple answer: You can't hide your HTML source code from anyone who is willing to spend more than 15 seconds looking for it. Don't bother trying.
Your PHP code, however, never leaves the server, so that will stay hidden.
If it's about HTML - you can't.
Also, the article you're citing is unfortunately misleading. Even if you manage to "uglify" your page source, client's browser will parse it anyway and will print it in a prettified form when using "View Source".
Technically it is possible to hide the source code by sending a "Link" header to the browser, similar to the <link .../> tags you would include in the HTML head section. This can be used to include a css, or even an html import into the DOM without sending anything in the body of the response from the server. Here's an example.
The header would look something like this:
Link: <some-file.html>; rel=import
In the same way that the HTML <LINK> element expresses a link between the document it occurs in and some other resource in the web, a Link: entity header expresses a link between the entity it occurs in and some other resource in the web.
https://www.w3.org/Protocols/9707-link-header.html
Note that this only hides the "view-source" contents, but the developer tools included with the browser will still show what had been parsed.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
JavaScript for detecting browser language preference
How to getting browser current locale preference using javascript?
I have a wordpress website that I am in the works of localizing. I don't really have much php or javascript knowledge, and don't really know what I am looking for in terms of doing this.
I have a support tab that users can click to go to my helpdesk. I can create multiple tabs for different languages and get the code to display it.
So my question is: Is their an if then statement in javascript that I can use to help detect the language of the browser and display the correct tab? Or is their a better way of doing this? Since my localized domains format is "ru.domain.com" I could even have the if then statement check for the language code in the current page url. Any help would be appreciated.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to protect my source code when deployed?
Can you give me some suggestions on how to secure a piece of code (credits, footer) from being removed?
It's just a text saying "Made by", bla bla...
If a user removes that piece of code, I want to force it back on the place or to display a warning message.
How about populating a div using javascript? Most users that will hack your theme/code won't understand where its coming from. Try something like appending the div to your body tag so even the div isn't written in html of your code. This might prevent a lot of efforts to remove the credits. What are you building exactly? What is the context? Is it a theme for a cms?
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to encrypt HTML, CSS and JavaScript to prevent theft
Is there any technique in PHP language, or some software available to encrypt the html code that is seen while clicking on view source and view generated source on browsers.Can the code be encrypted to binary strings ie( 0 and 1) format.
No. The browser needs valid HTML to display the document. There is no way to encrypt HTML.
The whole world is serving pages that are not encrypted, so it stands to reason it's not necessary, either.
People will always be able to get to your html - even if you did find some way to obfuscate / hide it, maybe using javascript, anyone can always use wget or similar to view it.
No. You can obscure it a bit, but in the end your browser needs to read it, and it reads HTML.
In a word: no. You can make the HTML ugly by removing whitespace, but the browser needs to be able to read it! You can obfuscate your Javascript pretty darn well by removing whitespace and newlines and using short or crazy variable names: for example see here.