Jump to content

maicol07

Members
  • Posts

    283
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by maicol07

  1. Ok thanks, I'll try. But... the config.php file? I have to use the connect-db.php file or not? Also I need a sql query (for an another component) to select all the data in the database from all the tables that have the prefix $username (it's a php variable that contains the username of the user, so a user can have some tables with his prefix and I want to select all the data from all of his tables). Thanks again
  2. Hi, I'm trying to build a dropdown in a form with, as options, the names of the tables of one database. How can I do? This is my script, it doesn't work: there isn't the dropdown... <form method="get"> <?php // database connection include('connect-db.php'); $result = mysql_query("SHOW TABLES") or die(mysql_error()); ?> <select name="select1"> <?php while ($line = mysql_fetch_array($result)) { ?> // The database I choose is "members", as can you see in the code below <option value="<?php echo $line['Tables_in_members'];?>"> <?php echo $line['Tables_in_members'];?> </option> <?php } ?> </select> <input type="submit" class="btn waves-effect waves-light" value="SEND"> </form> connect-db.php <?php /* CONNECT-DB.PHP Allow PHP to connect to the database */ // Database variables (I'm trying on XAMPP) $server = 'localhost'; $user = 'root'; $pass = ''; $db = 'members'; // Database connection $connection = mysql_connect($server, $user, $pass) or die ("Impossible connecting to the server ... \n" . mysql_error ()); mysql_select_db($db) or die ("Impossible connecting to the database ... \n" . mysql_error ()); ?> Thanks
  3. Well, I have found some code on the web... what do you think? http://www.zubrag.com/scripts/cpanel-database-creator.php require("xmlapi.php"); // this can be downlaoded from https://github.com/CpanelInc/xmlapi-php/blob/master/xmlapi.php $xmlapi = new xmlapi("your cpanel domain"); $xmlapi->set_port( 2083 ); $xmlapi->password_auth($opts['user'],$opts['pass']); $xmlapi->set_debug(0);//output actions in the error log 1 for true and 0 false $cpaneluser=$opts['user']; $databasename="something"; $databaseuser="else"; $databasepass=$opts['pass']; //create database $createdb = $xmlapi->api1_query($cpaneluser, "Mysql", "adddb", array($databasename)); //create user $usr = $xmlapi->api1_query($cpaneluser, "Mysql", "adduser", array($databaseuser, $databasepass)); //add user $addusr = $xmlapi->api1_query($cpaneluser, "Mysql", "adduserdb", array("".$cpaneluser."_".$databasename."", "".$cpaneluser."_".$databaseuser."", 'all')); Source: https://stackoverflow.com/questions/11989920/create-cpanel-database-through-php-script <?php include("xmlapi.php"); $db_host = "localhost"; $cpuser = "myuser"; $databasename = 'mydatabasename';//do not prepend with username $databaseuser = 'mydatabaseuser';//api will do that for you $databasepass = '123456'; $xmlapi = new xmlapi($db_host); $xmlapi->password_auth("root","root_pass"); $xmlapi->set_debug(1);//this setting will put output into the error log in the directory that you are calling script from $xmlapi->set_output('array');//set this for browser output //create database $createdb = $xmlapi->api1_query($cpuser, "Mysql", "adddb", array($databasename)); foreach($createdb as $v) { $result = $v['result']; } if ($result == 1) { //create user $usr = $xmlapi->api1_query($cpuser, "Mysql", "adduser", array($databaseuser, $databasepass)); } foreach($usr as $v) { $result2 = $v['result']; } if ($result2 == 1) { //add user to database $addusr = $xmlapi->api1_query($cpuser, "Mysql", "adduserdb", array($databasename, $databaseuser, 'all')); } print_r($addusr); ?> Source: https://forums.cpanel.net/threads/create-database-without-login-to-cpanel.130825/
  4. Hi, it is possible to create MYSQL databases from a PHP script on Tommy? Thanks
  5. Hi, I use a limited data plan from a mobile network (I don't know if you know the mobile operator called "H3G") with their router. Now I disabled the DHCP server, but it doesn't seem work... How can I use a proxy? Nevermind, I logged in from the HelioHost website and then entered CPanel, so it works! Thanks
  6. Ah... ok thanks. I hope that the attacks will stop... now Tommy is up!
  7. Hi, I have some problems... I can't access to CPanel with any device (it says "Your IP Adress has been changed. Retry the login") FTP doesn't create folders. I connect through Filezilla but I can't create folders (probably because I exceeded the maximum disk allowed) [solved deleting some softacoulous backup] FTP Permissions seems that doesn't work... (I think it is related to the second problem) [solved deleting some softacoulous backup]Thanks
  8. Hi, why Tommy is often offline? Thanks
  9. Some minutes ago it doesn't work... Okay, it seems solved! 👍
  10. Hi, My website https://maicol07.tk doesn't work with Cloudflare DNS setted. Why? I found that Tommy is fully compatible with Cloudflare but it still not work. Thanks
  11. Ok, thanks.
  12. Hi, A WordPress plugin request this function. Could you please activate that? Thanks
  13. Thanks for all. I had backed up all the data and deleted the Ricky account. Only one thing: books.maicol07.tk and apps.maicol07.tk are very slow, while maiocl07.tk is fast. I think it's a WordPress problem... Althought maicol07.tk is made with basic HTML and less elements than wordpress... Is it true or is it a Tommy problem? Thanks
  14. No, that file doesn't exsists...
  15. Yes, only one problem: https://apps.maicol07.tk doesn't work. Error: SSL_ERROR_BAD_CERT_DOMAIN
  16. No, of course. If you can for all my subdomains and add-on domains of my accounts. Thanks
  17. No, I had installed a certificate from ZeroSSL. Normally, it expires in 90 days, but I don't know why it expires in 3 years. Should I issue a new certificate? Thanks
  18. Hi, I have an SSL error in my browser (Firefox 53.0.3 x64): Secure Connection Failed. An error occurred during a connection to maicol07.tk. Peer's Certificate has been revoked. Error code: sec_error_revoked_certificate With the other browsers it works. Why? I see also that the certificate (issued by ZeroSSL) has expiring date on 2020! The others certificates by ZeroSSL of susbdomains has all expiring date on 07/2017... Thanks
  19. I updated Moodle from Softaculous and it sais that OpCache can improve performance. I'm using PHP 5.6 Also, it ask me to change InnoDB mysql tables to Barricade and other requests...
  20. Hi, can you enable the opcache php extension on Tommy? Thanks
  21. Thanks, it works. The max upload size is 8 MB, not 10.
  22. I'm tryng to upload 3 MB and also another file of 5 MB. I use PHP 5.6.24. Thanks
  23. Hi, on Tommy account, I can't upload in WordPress anything that is more than 2 MB. Why? Thanks
  24. I followed the tutorial for installing a ZeroSSL certificate and now it works. Thanks! I don't know why StartSSL certificates don't work...
×
×
  • Create New...