Author

Topic: creating a new faucet -- help (Read 264 times)

full member
Activity: 238
Merit: 100
it's showtime
October 11, 2016, 08:08:35 AM
#5
Faucets nowadays aren't profitable.

My sugest for you: Use the faucetinabox script from faucetbox, you just need to change the dbname and password in the config.php also you can find a lot of tutorials, 5 minutes and your faucet will be working.

If you have no knowledge about faucets, try to learn more before, because bots will dry your faucet Wink
hero member
Activity: 896
Merit: 1005
October 11, 2016, 06:59:16 AM
#4
I don't have experience with this script but in other scripts when I need to connect the database thenI fill the database data in the files having data like below:

class SystemComponent{
   private $settings;
   function getSetting(){
      $settings['dbhost']=$_POST['dbhost'];
      $settings['dbusername']=$_POST['uname'];
      $settings['dbpassword']=$_POST['pwd'];
      $settings['dbname']=$_POST['dbname'];
      return $settings;
   }



Fill the database name,
database username.
database password and hostname (which is mostly "localhost" if not having special one)

It seems like the script expects you to post this data to the script... My guess would be the settings should have been entered in an online form that was packed with this php file... This form should have posted the data to the script in question.

Edit: I've just actually took the time to look at the script a bit closer (i haven't taken the time to look at every line tough, so i only have a rough idear of what it's supposed to do), apparently, the form should have been printed when you executed the script without posted data...

Because you either did not use the form (in other words, skipped an installation step), or entered the wrong data, you received this error (at least, that's my best guess...)...

I don't have experience with this script, but usually there's a howto or readme file included that stipulates how to install the script... Your best bet would be to look for all mysql details (host, port, tablename, username, password) en then follow the readme that should be included.

If you don't succeed, you can always pay somebody to install the script for you Wink
member
Activity: 95
Merit: 10
October 11, 2016, 06:57:26 AM
#3
Elaborate your error.

Usually these kind of errors occur when you don't have the said database created. Check for spells. And also check for the port number of the database server.  Usually for mysql it is 3306. Some servers change that.
sr. member
Activity: 602
Merit: 250
October 11, 2016, 06:50:12 AM
#2
I don't have experience with this script but in other scripts when I need to connect the database thenI fill the database data in the files having data like below:

class SystemComponent{
   private $settings;
   function getSetting(){
      $settings['dbhost']=$_POST['dbhost'];
      $settings['dbusername']=$_POST['uname'];
      $settings['dbpassword']=$_POST['pwd'];
      $settings['dbname']=$_POST['dbname'];
      return $settings;
   }



Fill the database name,
database username.
database password and hostname (which is mostly "localhost" if not having special one)
hero member
Activity: 770
Merit: 500
October 11, 2016, 06:33:54 AM
#1
Can anybody help me in creating a new epay faucet. i am not a programmer. i downloaded the script in the hosting website after creating mysql database. when i open the browser i am getting error. its showing Unable to connect to database. please somebody can help me?
This is the script . please ttell me if i have to do any other changes to this install.php file. thanks in advance

session_start();
ob_start();
?>



   
   
   
   
   Faucet Installer
   https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
   
   
   
   








 
Faucet Installer

 

   Hi

Thank you for using this installer to begin a your new faucet with http://epay.info" target="_blank">ePay.info

We aim to improve the quality of this script over time, so remember to check the repository https://github.com/epayinfo/simple_faucet" target="_blank">here on regular basis to get the last updates.

Begin installing by clicking on the next step.



if(isset($_POST['dbname'])){

class SystemComponent{
   private $settings;
   function getSetting(){
      $settings['dbhost']=$_POST['dbhost'];
      $settings['dbusername']=$_POST['uname'];
      $settings['dbpassword']=$_POST['pwd'];
      $settings['dbname']=$_POST['dbname'];
      return $settings;
   }
}
require_once "includes/dbconnector.class.php";

$db=new DbConnector;
if($db->check_connection()){
   $dbhost=$_POST['dbhost'];
   $dbusername=$_POST['uname'];
   $dbpassword=$_POST['pwd'];
   $dbname=$_POST['dbname'];
   function generateRandomString($length = 25) {
      $characters = 'abcdefghijklmnopqrstuvwxyz123456789';
      $charactersLength = strlen($characters);
      $randomString = '';
      for ($i = 0; $i < $length; $i++) {
         $randomString .= $characters[rand(0, $charactersLength - 1)];
      }
      return $randomString;
   }
   $_SESSION['info']['admin']=generateRandomString();
   $adminpass=hash('SHA256',$_SESSION['info']['admin']);   
$content = <<class SystemComponent{
   private \$settings;
   function getSetting(){
      \$settings['dbhost']='$dbhost';
      \$settings['dbusername']='$dbusername';
      \$settings['dbpassword']='$dbpassword';
      \$settings['dbname']='$dbname';
      \$settings['adminpass']='$adminpass';
      return \$settings;
   }
}
END;
   chmod( 'templates_c', 0777 );
   chmod( 'configs/dbinfo.php', 0666 );
   $fp = fopen('configs/dbinfo.php',"w");
   fwrite($fp,$content);
   fclose($fp);
   $sql=fopen('install.sql','r');
   $schema=fread($sql,filesize("install.sql"));
   $queries = explode( ';', $schema );
   $queries = array_filter( $queries );
   array_pop($queries);
   foreach($queries as $q)
      $db->query($q);
     
   fclose($sql);
   header('Location: install.php?step=3');
   die();
}else{
   $_SESSION['error']['db']=true;
   header('Location: install.php?step=2');
   die();
}
}else{
?>


   
Faucet Installer - Database

 
 
 

   
   Below you should enter your database connection details. If you’re not sure about these, contact your host.
   
   
   
   



Unable to connect to database.


   
   
   
   
   

       
       
       u996812304_qwert
   

   
   
   

       
       
       u996812304_asdfg
   

   
   
   
   

       
       
       1234567
   

   
   
   

       
       
       You should be able to get this info from your web host, if mysql.1freehosting.com does not work.
   

   
     
   
   






}
}elseif($_GET['step']==3){ 

@unlink('install.php');
@unlink('install.sql');

?>





 
Faucet Installer - Finish

 

   
   Your installation has just been completed.
   
   

   


  This is your administartion passphare:



 
 



 
 
 
 
 
 

   


   

 
Make sure install.php and install.sql are deleted from you host.

Admin passpharse will not be shown again even if you refresh this page. Save it somewhere safe. 
 
 
     











Jump to: