473,395 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

securing php scripts

170 100+
Hi there,

just wondering, if I want to stop users of a site "stealing" the code, is there a way to achieve this? Is it automatic because any php is parsed before it reaches the browser? Am I better off putting basically everytthing inside php echos, even if it could be done using html? I guess I'm basically asking about security of the stuff I've done and whether there's a way to guarantee that someone won't be able to grab the code.

Thanks,
Nov 24 '08 #1
6 1304
Dormilich
8,658 Expert Mod 8TB
no one without server access is able to see your php code (as you already mentioned). but I don't recommend putting all your html code in echos, it will be visible either way.
so put in a one-liner: php code is safe from stealing, html code never.

regards

note: of course you can add a copyright comment to all your code, that's more reasonable.
Nov 24 '08 #2
Markus
6,050 Expert 4TB
Putting it in echo()s or not has exactly the same output. You could obfuscate you PHP code, just incase.
Nov 24 '08 #3
bilibytes
128 100+
@beary
Hi,
i don't know the exact reason why you are wondering how to do that but,
i don't think you should care about it... if someone wants to copy your HTML code it can use Firebug and get all the code you wrote in one line-> indented.
don't protect your code, just improve your service and you will never fear someone stealing you clients...

regards
Nov 24 '08 #4
beary
170 100+
Thanks all for your replies to this.

Bilibytes, I have to say I'm confused. The exact reason I'm wondering how to do it is because surely if you think something is not only good but also reasonably unique, and you made it, you'd want to protect it. Wouldn't you? Particularly if there was some potential return.

I guess it's at the stage where due to the nature of the product, there isn't a client base for this at all. It'll need to be built. So I need to make sure that if I provide a web address for something, and say there's a demo section, that a cluey person can't use that fact to grab the necesary code.

When you write that someone can use firbug to grab the html code, you did mean html didn't you, not php?

Thanks for your thoughts.

@bilibytes
Nov 25 '08 #5
Markus
6,050 Expert 4TB
Yes, firebug will only grab the sourcecode (the html, javascript and css). However, you need not Firebug to view the source - most major browsers have a rightclick option to 'view source'.

You do not need to worry about users being able to view your PHP - as long as you use the correct file extensions, a server running php, etc., you'll be good.

Markus.
Nov 25 '08 #6
beary
170 100+
Cool. Thanks Markus. Puts my mind at ease...

@Markus
Nov 25 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Steve | last post by:
I have a pretty nice php web site, that's also reasonably secure. However, I wrote some php code to create some dynamic images based on database data, but I can't figure out how to secure this...
2
by: Dave Smithz | last post by:
Hello there, In summary: How to make my password protected php scripts available for use to public, without letting them do anything they want to DB. Previously a shared hosting hosted MySQL...
6
by: Stephen VanDahm | last post by:
I'm looking for a way to install Python on a UNIX machine in a way such that any user on the system can use it, but only to execute scripts that are located in a certain directory. I do not have...
1
by: Bruno Desthuilliers | last post by:
Hi everyone ! Could someone point me to infos about securing python for use as CGI or mod_python for a shared hosting environnement ? I searched google, but did not find anything specific :( ...
5
by: AeonOfTime | last post by:
Let's assume a web application (in this case a browser-based game) with a custom HTTP server built on PHP, and a client also built on PHP. The client uses the server to access and change data. Even...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.