Archive for the ‘Programming’ Category
May 07, 2010
Filed Under (Programming) by admin
Most developers will not want to do this, but putting a backdoor in your code can be useful. A backdoor can allow access to an app by bypassing the usual verification process. However, this should be implemented securely in order avoid any misuse. Why you need a backdoor is because there is an ideal world and a real world. In the ideal world, you would create your app, deliver it and all would be well. But unfortunately in the real world, you will be required to fix issues that that crop up now and then. Fixing the problem requires understanding it, and that means you need to be logged in as a particular user (the one who came across the problem). Implementing a backdoor password or a super user account will help you address these problems securely. Of course this is only possible if you are the sole developer on the project. For a professional environment, you need to implement something larger and more secure. That sort of backdoor is called a project management system. With a system like that, each developer will have privileges, authorities, access limits etc. Giving these rights and taking them away is as simple as clicking on a button. This is the most secure way of implementing a backdoor on a large project. A method similar to SSH can be implemented in PHP, to grant secure backdoor access. By using the OpenSLL extension, the project management system can sign in using openssl_sign. When the when the server verifies the access using openssl_verify, the PMS system gains backdoor access.
April 22, 2010
Filed Under (Programming) by admin
Although PHP is a very powerful language, learning it is not a very hard task. The difficulty is learning all you can about it. Most beginner programmers will learn a few basics and figure out the rest as they go on. This is not a bad plan. However, there are several key areas they will need to know about in order to write better code and to make their own lives easier. One of the key areas is using the Include function in PHP. For those who haven’t done any programming before the concept of Include will not make much sense. Those who have they will know it by the same or another name. The Include function is used to “put” the contents of one file within another. The basic advantage of this is that you can reduce the length of time taken to code and update a page. Using FRAME and IFRAME is now considered ugly and it is also based on the type of browser rendering your page. By using the include function you can avoid this method and save a lot of time in the process. For example, by using Include to display a navigation menu you can update the navigation easily as well as have it appear on the page seamlessly. All you have to do is to create a page that holds your navigation, and then have it “included” in every other page. So, from this brief explanation, you can see what a powerful function Include can be. By experimenting with it, you will find that it can be used to perform many other functions that will help you in your coding work.
April 10, 2010
Filed Under (Programming) by admin
The best code is always the code that you yourself write. This is because you know exactly how the code works and the thought process that went into its writing. However, as you progress with developing websites, you will find yourself pressed for time. It is during these occasions that you will have to resort to code that someone else has written to save time or to find a better way of solving a problem. If you find yourself in these situations, try to follow these criteria and you will have a better experience. 1. Make sure your host can run the script. Find out exactly what the script requires to run on a server. 2. Does the script fit your requirement? Don’t settle for half measures. If you have to end up modifying a lot of the code or having to compromise on certain features, it is simply not worth it. 3. Can the code be modified to fit certain aspects of the site? Although you don’t want to spend time modifying everything, it is almost a certainty that you will change a few minute details so the code matches certain layouts, colors, etc on your website. 4. Ease of installation. Some types of code can simply be uploaded and used with minor configuration changes however other types of code require more advanced developer skills. Depending on your proficiency in the language, choose the code that fits you better. 5. Does the author offer support? Sometimes you need to talk to the person who wrote the code to clarify certain details. It would be useful if the author is available to troubleshoot your questions. 6. Does it support “mods”? “Mods” and “Plugins” are bits of code written by users other than the main author to modify a large piece of code. For example, Wordpress can be modified by thousands of “mods” that are available online. 7. Free or pay? Depending on your budget you will have to choose or fluctuate between these two types of code. If you have enough time on your hands to look for it, you can always find good code for free. But if you are in a hurry, buying code is not a bad option. However, you should remember that not all things you pay for guarantee quality.
March 20, 2010
Filed Under (Programming) by admin
After 15 years since its arrival, PHP has firmly cemented its place in the online world. Its power and flexibility is so great it is found in over 20 million domains and is part of some the biggest websites around today, like Facebook, YouTube, Wikipedia and more. As with any programming language it is always useful to know a few tips that will save time and increase efficiency. Allocating memory - PHP scripts can eat up memory if left unregulated. To counter this, servers usually set a random limit. This can be a problem for certain developers who need more memory to execute their code. This can be easily fixed by editing the php.ini file to include the following code. memory_limit=16M The maximum limit however, is controlled by the host. Including files - If you need to include a .php file within the current file, you can easily do it with the php include function. This can be useful to include a fixed menu, header, footer, etc. The code to use should be of the following format. <?php include (’directory/file.php’); ?> Quote wisely - Proper usage of single and double quotes will save you a lot of time during execution. Keep in mind that double-quotes indicate to the code that there is a variable present. This in turn consumes processor time as the code checks for the presence of any variables. If you simply require something to be printed on screen then you should use only single quotes, as it will require less processor time.
March 13, 2010
Filed Under (Programming) by admin
PHP and ASP are two very popular languages in existence today. They are used by programmers who have a particular affinity to the features available in each language. It is easy to ramble on about each language but choosing between them is a much tougher job. Hypertext Preprocessor or as it is better known as PHP, is a server side language. Its widespread use in web forms is due to its ability to capture data and process it on the server before returning feedback to the user. PHP is not restricted only to the web; it can also be installed as an extension to your operating system enabling it to function in command line processing. PHP is also very strong in handling databases, which makes it a popular choice in online work. Active Server Pages (ASP) is also a server side language. It is not a language that is limited to IIS (Internet Information Services) servers as most people think. However, this perception is somewhat justified as ASP’s full potential can only be realized on an IIS server. Cost wise, PHP is free while ASP is not. But those who do buy IIS do it for integration purposes which more than justifies the cost. Resource wise, it is difficult to make a call on either language, as they handle memory in very different ways. PHP allocates and reserves a certain amount of space whether it is being used or not, whereas ASP is similar to a normal application loading and using memory. The only clear advantage that PHP has, other than its cost, is its compatibility. Unlike ASP, PHP can run on any operating system and is an open source programming language. This means that it has much bigger resources to draw from, in terms of development. However, even with all these factors in mind, it is still a difficult call to make on which language is better. It really boils down to the individual user or team and the requirements. To offer an analogy, it is similar to choosing between a Sedan and a 4WD jeep - it depends on what you want to use it for. So if you are torn between the two, take a look again at your requirements and choose the one that best fits your needs. |
|