Tuesday, Sep 07, 2010
Login

Archive for July, 2006

DOT Blocked *.blogspot.com,*.typepad.com,geocities.com/*

India’s Department of Telecommunications (DoT) passed an order to ISPs Friday to block several websites. The list is confidential. Indian ISPs have been slowly coming into compliance. SpectraNet, MTNL, Reliance, and as of Monday afternoon, Airtel. State-backed BSNL and VSNL have not started yet but likely will soon. The known list of blocked domains is *.blogspot.com, *.typepad.com and geocities.com/*.

Yes folks, the Indian government has decided to censor blogs and refused to explain why. This morning Shivam Vij managed to talk to Dr Gulshan Rai, director of CERT-IN, the only body authorised to issue directives to ISPs. His response: “Somebody must have asked for some sites to be blocked. What is your problem?”

If any Boing Boing readers in India find several sites inaccessible today, please call your ISP and demand to know why. If you can help, please join the coordinating group: Link.

Link to Shivam’s post, and Jace is following developments on his blog, here.

Manish adds,

The block is still spreading through Indian ISPs. This recalls Pakistan’s Blogspot ban during the Danish cartoon controversy and India’s Yahoo Groups ban in ’03 to shut down a separatist forum.

Dina Mehta says,

The plot gets thicker and thicker as more bloggers are getting alerted to the fact that an increasing number of Indian ISP’s are banning blogspot and typepad blogs and geocities.com. Several detailed posts on this, with regular updates here: withinandwithout.com, Conversations with Dina, and Travel Tales from India.

There’s a wiki here: Link. We’re treading with a little caution before we go whole-hog at the government. There is a possibility that it is a mistake – where a directive from the government on a few blogs might have been misrepresented by ISP’s here – who have blocked the entire sites.

Amit Varma says,

Amit Agarwal has some tips on how Indian bloggers can circumvent the ban on Blogspot here: Link. More here: Link.

Update, 11AM PT: Shii says,

An Indian political blog is reporting that the ban was initiated by the Indian intelligence service to stop terrorism: Link. According totheir source, the terrorists are using blogs to communicate. Not only is this useless (because the terrorists can simply use proxies), it’s akin to shutting off the country’s telephone service because terrorists talk to each other through phones.

Jim says,

Indian Censorship can easily be bypassed when using TorPark. It’s a no-install version of Firefox that uses the Tor Network for communication. This should also work in China and other countries that filter the web.

And of course, this and many other censorship workarounds at BoingBoing’s “How to Defeat Censorware.”

Vijay says,

I am not yet facing any of the blocking effects as reported by several Indian bloggers. I have noticed a certain pattern here. The blocking seems to be affecting city users while rural netizens have been spared of this curb for now. I have mentioned this in detail here.


PHP File Uploads

Overview: In this article we will show you how simple it is to upload File from the browser.

Uploading a file is a very simple process, To upload a file to a Web server via an HTML form interface, we will be performing the following tasks.

# First we create a HTML form (upload_form.htm)

# Create an PHP script (upload_file.php) that actually uploads the file!

Creating the HTML Upload form

upload_form.htm




Upload a File

File to Upload:




Note that in the form tag we use the enctype=”multipart/form-data” attribute so that the browser knows that more than just text variables are coming at it.

We also have a hidden feild with the name name=”MAX_FILE_SIZE” which set’s the maximum file size in bytes that can be uploaded.

Now that we have the HTML form we create upload_file.php which actually uploads the file.
upload_file.php

if ($our_file != “”) {

copy($our_file, “upload/$our_file_name”) or die(“Couldn’t Upload the file!”);

} else {

die(“No input file specified”);
}

?>


Success!

You sent: , a
byte file with a mime type of .



PHP Sessions

Overview: In this article we will discuss what are Sessions and how to work with sessions in PHP.

Imagine that you have some data about a particluar user and this information you need on all of the pages, woudn’t it be great if you could store that info in a variable and access it from any page, Sessions exactly do that.

Using sessions you could hold data about particluar user and access that info on all the pages as long as the user is active on the site.

* Each session holds different values for different user.
* Sessions automatically die when the users session is over or he closes his browser.

PHP’s session-handling features, was first introduced in the 4.0 release. Sessions are native and thus require no additional packages.

To work with Sessions we will be using session_start() and session_register() functions, its important that you add sesions_start to every page where you would like to use sessions.

I will explain you the conecpt with an example.

session1.php
// create a new session
session_start();

// register a session-variable
session_register(“color”); //we have created a session with name color

$color = “blue”; //assigning some value to our session
?>

Okay now we have created a session with name color and assigned it as blue, now in our second program (session2.php) we access the value of our session color

session2.php
session_start();

echo “The value stored in your session: ” $color; //retriving value from the session
?>

To delete a session variable we use the function session_unregister(), so to delete our session color we would use the code

session_unregister(color);
?>


Installing MySQL Database

Overview: Configuring Mysql on your web server and write commands to create databases, adding users and creating password.

you can find the latest release of MySQL database here.

Download the appropriate version and install MySQL on your computer.

If you are going to install MySQL on windows machine then you will also need to download the MySQL ODBC drivers I have downloaded the ODBC 3.51 ver and installed it on my Windows machine and it works great.

If are using Windows N.T / 2000 / XP, then you should install MySQL as a service. Follow these steps to install MySQL as service.

1) First go to command prompt (Dos Prompt) then Go to c:\mysql\bin

2) Enter this command mysqld-nt –install this will install MySQL as a service and it will load automatically with windows the next time you boot.

* You can also use these commands (First go to c:\mysql\bin)
NET START mysql To start Mysql
NET STOP mysql To Stop Mysql

Creating a New Database in MySQL

1) First go to c:\mysql\bin

2) Enter the command mysql

3) Enter this command create database mybuddy;

4) The above command will create the database mybuddy
The syntax for creating the database is create database database_name;

Creating a New User on (mybuddy) Database in MySQL

1) First go to c:\mysql\bin

2) Enter the command mysql

3) Enter use mybuddy (This will change the current database to mybuddy)

4) Enter the command exactly as show below this will create a use called buddy_user with password mypass on the mybuddy database. GRANT ALL PRIVILEGES ON mybuddy TO buddy_user@localhost IDENTIFIED BY ‘mypass’ with GRANT OPTION;

5) quit;


Encrypting and protecting your PHP code

Overview: In this article we will discuss how can you protect your PHP source code from prying eyes, so that you can make applications and distribute them without worrying about someone stealing or modifying your PHP code.

Imagine that you have built this great product in PHP, and you now want to distribute this application commerically, now you may be wondering Is there a way to protect or encode your PHP source code?

A lot of developers who created commercial applications in PHP are worried that there clients/users might open up the code and modify there product, hence many developers are afraid to develop commercial applications in PHP.

But there is hope, Yes you might be surprised but you can encode, encrypt and protect your PHP source code from prying eyes. There are several commercial available products by which you can encrypt your PHP code and protect it .

I am going to discuss about two such popular products that I have personally used, the Source Guardian and Zend Encoder from Zend Technologies, Using these applications now you can stop worrying about someone stealing your intellectual property.

I personally use Source Guardian to protect and distribute the PHP code that I built, the best thing about Source Guardian is that you don’t need to install any additional software or modules on the target server, just upload all the encrypted files and the supporting files generated by Source Guardian and you are ready to go. Currently Source Guardian works with Linux and FreeBSD Server, and requires that you have PHP 4.04 or above installed on them.

One more feature I love, given by Source Guardian is the ability to make time limited copies of the encrypted PHP code, you can distribute scripts that time-out on a specific day, that way you can create PHP Trialware! Apart from that, Source Guardian also gives you the option of limiting your encrypted copy to a singe I.P.

On the other hand Zend Encoder encrypted files work even with PHP installed on windows platform, but you need Zend Optimizer installed on your server, which can be a problem as most of the shared hosting companies will not install Zend Optimizer for you on there server.

Cost wise again Source Guardian is a lot cheaper than Zend Encoder, at the time of writing this article the cost of Source Guardian was around $249/- compared to that Zend Encoder is available for $2400. The single year license of the Zend Encoder is available for $960.

For more info on Source Guardian you can visit there web site.

For more info on Zend Encoder please visit this page.