Hello to every body who visit this thread
I want to prevent view source(html tags & javascript scripts) of the page with php. I've studied php manual withuot any success how can I do it? Is it possible

I don't see how you can hide the source that gets sent to the client browser. Code within the PHP tags would be processed at the server end anyway. So data such as database login wouldn't be sent to the client machine anyway.

I know ! But I want prevent show client source of the web. Ofcourse I think that I ask wrong, however generally I want to hide html tags and javascript scripts. What is the solution?

I don't think this is possible because your web browser requires the source and viewing the source code is a function of the browser.

Is there any particular reason you need to do this?

Yes, I want to hide my javascript functions. I want to block it. but you right it seems impossible with php.

Member Avatar for iamthwee

I don't think this is possible. Encryption might be an idea but that's very very doubtful.

You can't reliably do it. If someone wants it they will get it. If you don't want people to have it, don't put it on thew web.

FYI, your javascript is not special. If you can write it, so can anyone else who knows javascript. Hiding it is pointless.

I you are writing an application where you want to hide all your code you can use something like Zend or Ioncube.

For Javascript you can use encyption to make it 'harder' to read and copy. If you tell what this javascript does and why should it be protected maybe there is an alternative to having the code more secure.

Tim

There's one way to do it, there's one program called HTML Encryptor, you can google search to that. I used to use it a while back.. but it seems useless and crappy because it changed several things... XD a.k.a it's not a reliable software.. :) but pretty nice, they encrypted everything..

One way I can think of which can prevent a novice computer literate person is by using a No Right Click Java Script.

This method can only slow down a person from viewing your source as there are many other way to get the source.
Also you may want to read this Article on why not to use a No Right Click Java Script :
http://websiteowner.info/articles/ethics/norightclick.asp

The Article also mentions few ways to prevent source code to be easily read.
Hope that helps...:)

One way I can think of which can prevent a novice computer literate person is by using a No Right Click Java Script.

lol, that one won't work.. you can still see it with View --> page source :D

lol, that one won't work.. you can still see it with View --> page source :D

That is why I said it will only slow a person down.:P

It also can be defeated, like all JavaScript, simply by turning JavaScript off. Or, in FireFox, you can even leave JS on and tell FF to block scripts like that.

You could do the whole site in Flash I suppose :P
... which of course would be really slow and irritating...

Haha, or use Server Side :D

You could use JavaScript Encode, to encode the HTML/page source, so that it isn't readable at all.

thanks but how can I use it?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.