about showin code...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
adixtopix
Forum Newbie
Posts: 17
Joined: Thu Jun 23, 2005 7:02 am

about showin code...

Post by adixtopix »

if u look at this site http://www.thecrims.com

try now to see the code of the page. exactly, it can't be seen

why?

how to do this?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Code: Select all

<html>
<head>
<title>The Crims - The life of a criminal</title>
<meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; />
<meta name=&quote;robots&quote; content =&quote;index,follow&quote;>
<meta name=&quote;description&quote; content=&quote;TheCrims, a metropolitan for gangsters, scumbags, and criminals. Online free mmorpg webgame.&quote;>
<meta name=&quote;keywords&quote; content=&quote;thecrims,the crims,thecrimes,the crimes,mmorpg,free mmorpg&quote;>
<meta name=&quote;documentType&quote; content=&quote;WebDocument&quote;>
</head>

<frameset rows=&quote;*,0&quote; frameborder=&quote;NO&quote; border=&quote;0&quote; framespacing=&quote;0&quote;>

<frame src=&quote;start.php&quote; name=&quote;main&quote; scrolling=&quote;yes&quote;>
<frame src=&quote;empty.html&quote; name=&quote;top&quote; scrolling=&quote;NO&quote;>
</frameset>

<noframes>
<body>
</body>
</noframes>

</html>
Either disable JavaScript or use your browser's menu.. don't right click.

See my point? It's pointless using JS to do something like this ;)
adixtopix
Forum Newbie
Posts: 17
Joined: Thu Jun 23, 2005 7:02 am

Post by adixtopix »

actually i don't get it


all i know is that site is made in php and somehow hides the code, the html code, so i am confused and want to do something like that for my sites
adixtopix
Forum Newbie
Posts: 17
Joined: Thu Jun 23, 2005 7:02 am

Post by adixtopix »

well, i got it, 10x man

u see, i am very new in this thing called web design and i had to use my head a little more than usual, but it payd good

10x again
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

adixtopix wrote:actually i don't get it


all i know is that site is made in php and somehow hides the code, the html code, so i am confused and want to do something like that for my sites
His point was that its not hidden. It simply disables the right click menu on the webpage. The source is still there, not hidden, you simply have to access it another way. (There are dozens of ways to access it).

Hiding html isn't a benefit - its a bad thing. It prevents users from making suggestions on how to improve your site, and restricts their ability to do what they want and/or need to do. For people with disabilities such restrictions can end up preventing them from using the site at all.

The web was built on openness, not hiding.
adixtopix
Forum Newbie
Posts: 17
Joined: Thu Jun 23, 2005 7:02 am

Post by adixtopix »

See my point? It's pointless using JS to do something like this
what do you mean when u say that is pointless in using JS?
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

adixtopix wrote:
See my point? It's pointless using JS to do something like this
what do you mean when <span style='color:blue' title='ignorance is bliss'>you</span> say that is pointless in using JS?
Because the javascript doesn't prevent the user from seeing the code. It prevents the user from right-clicking. The user can also view source, validate with verbose mode, view his internet cache, view the code manually (with wget), and dozens of other methods.

HTML cannot be hidden. It has to be given to the browser, and once its there, the user can view it as well.
adixtopix
Forum Newbie
Posts: 17
Joined: Thu Jun 23, 2005 7:02 am

Post by adixtopix »

yes, i understand

therefor there is no way to protect your site from being copyed
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

adixtopix wrote:therefor there is no way to protect your site from being copyed
Originality, usefulness.

If you make a site that is unmistakably original, specific, and useful, a competitor will stick out as a copycat. The web is most powerful when you focus on sharing, providing, and giving users what they want and need. Not hiding behind technology to give you an edge. :)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

What are you trying to hide? It's not like you're doing anything no one has done before or can't be easy duplicated :wink:
adixtopix
Forum Newbie
Posts: 17
Joined: Thu Jun 23, 2005 7:02 am

Post by adixtopix »

u have a good point :))

only that i am obsessed of security
i don't want anyone to be able to attempt doing anything to my databases...
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

adixtopix wrote:<span style='color:blue' title='ignorance is bliss'>you</span> have a good point :))

only that i am obsessed of security
i don't want anyone to be able to attempt doing anything to my databases...
Thats security through obscurity, and it doesn't work.

Just like the site couldn't hide the sourcecode, you can't hide vulnerabilities - and you shouldn't want to. It will fool you into thinking its safe, when its not - its just well hidden!

Its like burying a million dollars in the backyard. What happens if someone finds out where its hidden? There is NO security stopping someone from digging it up! Its just hidden.

It's better to see the lack of security, and fix it. If you have security concerns, ask for help. You aren't the first person to implement security on a website, and most of the problems you face have been solved - long ago. :)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

adixtopix wrote:<span style='color:blue' title='ignorance is bliss'>you</span> have a good point :))

only that i am obsessed of security
i don't want anyone to be able to attempt doing anything to my databases...
Your HTML output should show nothing directly contained in your PHP. It's just that; output.

PHP itself is very secure if you don't leave open doors for external control ;)
adixtopix
Forum Newbie
Posts: 17
Joined: Thu Jun 23, 2005 7:02 am

Post by adixtopix »

so i should stick to doing good php code
Post Reply