Log in

View Full Version : hiding code with php



chechu
09-20-2007, 10:05 AM
In a contactform, lots of content/actions are written in php, but cannot be seen when looking at the source.
Is it possible to hide coding from your content, but still visible/working online ?

f.ex.: you see a link to a site online, but in the source you cannot see anything regarding this action.

Is this possible ?

alexjewell
09-20-2007, 10:32 AM
Well, the simple answer would be: javascript. However, anyone with an understanding of javascript would be able to read it.

You cannot "hide" html code server side while displaying it on the page because anything displayed on the page is no longer "server side"...it's now "client side." That html has been outputted by what is server side for the browser to read and alas, no longer server side.

That's why javascript is the only option here, since javascript is client side. However, whenever you use client side scripting, all of it is viewable. Sure, there's some javascript tactics that you can do, but none of them are really worth it, I think. But I guess that's all up to you.

chechu
09-20-2007, 10:37 AM
Just to see how it 'd look like: can you tell me more about the Javascript coding, please ?

boogyman
09-20-2007, 12:45 PM
there is absolutely unequivically no way of hiding html / javascript / digital media from a person after it has been published on the web, and the javascript used to give the designer a sense of security can be found all over the web, though from experience it really i just a waste of bandwidth and disk space. but google away :)

//EDIT... added this after re-reading the original post
ps. the reason php cannot be seen in the source is because it is processed on the server, and thus the browser has no knowledge of what happened. it is also the reason you need javascript AJAX to react with the server if you wish to not reload an entire page.

djr33
09-20-2007, 04:09 PM
PHP is a program. It outputs html. You can "hide" the PHP code because it never was sent to the browser. But you can't hide that output.

The HTML generated by PHP is very similar to the images generated from PHP. You can't get the PHP source code from those images, but you can most certainly save them, even if some form of "security" is implemented.

alexjewell
09-20-2007, 10:29 PM
As Boogy said, it's pretty much just a waste of bandwidth, but here's some links:

http://www.portaldepot.net/articles/HideCode.html
http://www.designerwiz.com/ad-framer.htm?http&&&www.designerwiz.com/generator/encryptHTML1.htm
http://www.virtualpromote.com/tools/javascript-encrypt/
http://www.iwebtool.com/html_encrypter

And DD's own:
http://www.dynamicdrive.com/dynamicindex9/encrypter.htm

insanemonkey
09-24-2007, 07:00 PM
I dunno if this is correct, but you can hide media information with using
mpu or theres other ones i can't think of.. but does mpu hide video and mp3 urls?

Twey
09-24-2007, 07:15 PM
No. The URLs can be found inside the .mpu file (in fact, the .mpu file is just a text file with those URLs inside it; any idiot can open it up in Notepad or another text editor and find them).