Jul 26, 2008

Cpanel Db Creator

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

Cpanel Db Creator

dogtag
Hi
this would be very useful for WEB Programmers
if you have a cpanel host, you know that you cannot create MySql DBs and you should do it just by CPanel.

by this code you can do it in your programs:

CODE
<?php

// cPanel username
$cpanel_user = "user";

// cPanel password
$cpanel_password = "password";

// cPanel host
$cpanel_host = "host";

// cPanel theme/skin, usually "x"

$cpanel_skin = "x";

// Path to cURL on your server
$curl_path = "/usr/bin/curl";

//////////////////////////////////////
/* Code below should not be changed */
//////////////////////////////////////

if(isset($_GET['db']) && !empty($_GET['db'])) {
  // escape db name
  $db_name = escapeshellarg($_GET['db']);

  // will return empty string on success, error message on error
  $result = exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/sql/adddb.html?db=$db_name'");

  // output result
  echo $result;
}
else {
  echo "Usage: cpanel_create_db.php?db=databasename";
}

?>



just replace change these values:

QUOTE
$cpanel_user

$cpanel_password

$cpanel_host

 

 

 


Reply

Saint_Michael
Interesting script but $5 says that this is a not a secured script and if anyone saw this saw script running on a site they could use it to plant a wonder SQL injection into your site, or use for a location to sql inject another site. Then while they get away scott free the person hosting the site this script is on will get in trouble for it.

Reply

jlhaslip
Looks suspiciously similar to this function:

http://www.zubrag.com/scripts/cpanel-database-creator.php


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : cpanel db creator

  1. Cron Jobs And A Php Script In Cpanel - need a bit of help using the cron jobs thing! (0)
  2. Cpanel - SCRIPT HELP (2)
    Is there any Scripts in the CPanel with an Automatic SignUp Login Script. And I've created a new
    E-Mail Account but I dont know how to link it with my website. PLEASE HELP. /ph34r.gif' border='0'
    style='vertical-align:middle' alt='ph34r.gif' /> /ph34r.gif' border='0'
    style='vertical-align:middle' alt='ph34r.gif' /> ...



Looking for cpanel, db, creator

Searching Video's for cpanel, db, creator
advertisement



Cpanel Db Creator



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE