Showing posts with label PROGRAMMING. Show all posts
Showing posts with label PROGRAMMING. Show all posts

Security Checks To Be Performed For PHP Web Development

This is a guest post by Nishant.

Security Checks
Web applications have been used today for a higher extent for marketing the products and services provided by various companies and consultants. As there is an increased demand for the web development activity there are also security breeches creeping in internally from the development activity and also from the external market. So, if a developer is developing a web application, he/she should be more careful and should be aware of all the required development techniques which will make the website more secured.

Here are the few suggestions which will help web developers in web applications development more secured way:
  • Most of the time developers will make use of variables for providing the authentication which is very dangerous. These variables can be replaced very easily by the hackers which will make to loose the important data of based on the user roles. At this situation take the complete benefit of PHP where there is “define” functions for providing authentication for the specified role users.
  • The other mistake done by the developers is that not using the escape characters for database queries and urls. They will just use the value of the variable based on the user input. This helps the hackers from accessing the database values. They can make any kind of changes for the database which is not acceptable. One can make use of “addslashes” function which will help to escape the special characters wherever used through out the application.
  • When there are cases of uploading the files, php web developers should be more careful. Commonly for file uploads developers will make use of variables. So as soon as the file is uploaded the PHP script will create a temporary file. This URL can be easily tracked where hackers can make the script to create the file in some other path or also can make the script not to create the file. To ensure the safety of the uploaded files it is highly recommended for the web developers to sue is_uploaded_file and move_uploaded_file methods to ensure that the file is uploaded in the correct path.
  • One more mistake done by the developers is that they will forget to escape the HTML characters. When it happens the visitors can make use of <blink> tag in the comments sections which will make the rest part of the website after the comment section to blink.

Create a best secured website so that business can be executed with ease without any issues externally and also internally.

About the author:

Nishant is very passionate about PHP development, codeigniter web application, web designing, SEO/internet marketing and blogging. If you like this post, I would love to hear from you. Leave a comment, share my post and follow me @phprockerz on Twitter.

How To Permanently Set Path Using Environment Variables In Java?

This post is for those java programmers who are just newbies in this language! After installing JDK, next step is to set path in DOS for compiling your first program in Notepad.

Note: I am not telling about Netbeans where you don't need to set any path. 

Before compiling your program written in Notepad, you need to set path every time after opening command prompt. It means path you set in command prompt is not permanently stayed here. Follow these simple steps for permanently set path using environment variables:
  • Go to Java installation's Bin folder in Program files & copy the whole path from address bar. For e.g.C:\Program Files (x86)\Java\jdk1.6.0_03\bin
  • Now go to start> run> Type sysdm.cpl> In System Properties> Go to Advanced tab> Click on Environment Variables placed on right bottom side.
  • In System variables look for "Path".
  • You will see several variable values.
  • Paste the path you copied from address bar followed by ; in variable value as did in screenshot:

    Set Path In Java
  • That's all.
  • From now, you don't need to set path every time before compiling your program.
If you are using Linux, then you don't need to set any path. Simple compile & run your program with javac & java.

Note: For installing Java in ubuntu, check my other post: How To Install Java In Ubuntu?

How To Install Java In Ubuntu?

Install Java In Ubuntu
Hello ubuntu users!! So are you interested in Java & wanna to install JDK & JRE in ubuntu? In ubuntu, you don't need to set any path first for executing your program using terminal. Follow these steps:
  • Go to Applications> Accessories> Terminal (Or use shortcut Ctrl+Alt+T).
  • Type "sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk" without quotes.
  • It will install JDK & JRE.
  • After installing, check installation by entering javac & java in terminal. If these commands execute, that means you have installed JDK & JRE successfully.
  • Next step is to execute your program (Suppose you have program file named Hello.java in your home directory).
  • Type javac Hello.java in terminal, then java Hello
Note: If you save your java file in any other directory, then you first need to change your directory path otherwise terminal will display error as "No such file or directory".
A Basic Calculator In Batch

A Basic Calculator In Batch

Basic calculator written in batch. Copy the given text & paste it on Notepad, then save it as calc.bat

Code:
@echo off
title Batch Calculator
echo -------------------------http://www.basicsofhacking.com-------------------------
:1
echo Enter the values with operands (E.g. 1+1):
set /p input=
set /a result=%input%
echo Result is: %result%
:2
echo Wanna continue? Press Y for yes Or N for No
set /p "choice=>"
if %choice%==Y goto 1
if %choice%==N goto end
echo Invalid choice
goto 2
:end
exit


You can also download the text fie from here.