cPanel database administering class

It is long time since I have worked with cPanel. My last work was cPanel Email Management  script that enables us to create/delete email accounts from outside of cPanel.

Today I have worked with another cool thing. I have created similar class for database. Using this class, anyone can easily create/delete database and database users.

Current Features:

  1. Create database
  2. Create User
  3. Grant Privileges
  4. Delete Users -> Supports deleting multiple users at a time. See the example in test.php
  5. Delete Database -> Supports deleting multiple databases at a time. See the example in test.php
  6. Check if database exists
  7. Check if user exists

Requirements:

  1. cPanel server
  2. English as language of cPanel
  3. cURL

Please let me know your suggestion if you use this class.

Download V1.0

Special thanks to Sajjad Hossain for helping me during the development.

Update: 02-07-2009
– The class is approved in phpclasses.org. Click here to visit.

How to submit a form using PHP (cURL, fsockopen)

How to submit a form using PHP

There are situations when you want to send data using POST to a URL, either local or remote. Why would you want to do this? Probably you want to submit data to an optin form, but without taking a valuable visitor away from your site. Or maybe you want to send data to several applications for various purposes, which would be impossible to do in the usual manner. So how can we deal with this problem?

Simulate submitting a form using cURL

So what is cURL anyway? cURL stands for “Client URL”, and it is a library of functions that can be used to connect and communicate to a wide range of servers, such as HTTP, FTP, telnet and so on. cURL also speaks HTTPS, so it can be used to communicate with secure servers.

What are we going to use are cURL HTTP capabilities. cURL supports POST and GET methods, file uploads, cookies, user/password authentications, even using proxy servers for connecting.
Continue reading →