Hello guys this is my config.php file i am using xampp localhost. i do not know what is DBServer and how to configure here??? thanks
<?
define(Site_Name,"Welcome to site name ");
define(Site_Title,"Welcome to site name");
$SITE_NAME="Welcome to site name ";
$SITE_URL="http://localhost/test";
$DBSERVER = " ? ";
$DATABASENAME = "test";
$USERNAME = "test";
$PASSWORD = "012562555";
$ADMIN_MAIL="";
$SITE_TITLE=Food order;
?>
Just add on:
<?php
$DBSERVER = "127.0.0.1";
?>
Related
Hello i have file in folder assets/includes/config.php
The file contains this data:
$db_host = 'localhost';
$db_name = 'xxxx';
$db_username = 'xxxx';
$db_password = 'xxxxx';
$site_url = 'https://xxxxx.xx/';
How can i echo this data in index.php so it would be visible for everybody ?
Thank you!
Just use echo before all code lines.
For example
echo $db_host = 'localhost';
echo $db_name = 'xxxx';
echo $db_username = 'xxxx';
echo $db_password = 'xxxxx';
echo $site_url = 'https://xxxxx.xx/';
The code below doesn't connect:
$file_open = fopen("logindetails.txt","r");
if($file_open){
$user = fgets($file_open);
$pass = fgets($file_open);
$server = fgets($file_open);
}
echo "user: ",$user,"password: ",$pass,"server: ",$server;
#$db_handle = mysql_connect($server,$user,$pass);
but outputs:
user: root password: usbw server: localhost
logindetails.txt contains:
root
usbw
localhost
while this code connects:
$user = "root";
$pass = "usbw";
$server = "localhost";
echo "user: ",$user,"password: ",$pass,"server: ",$server;
#$db_handle = mysql_connect($server,$user,$pass);
I can't get this working and I can't guess why.
The variables you read with fgets in also contain linebreaks.
$user == "root\n";
$pass == "passw\n";
Which is why MySQL won't recognize them as valid.
So, you should either:
trim() them
instead use an INI file
better yet some config.php instead of a text file.
i am getting this error as i integrate this forum in my website i am new to this error his is my config.php i had made changes according to my database i am new to this i don't know why and what is this error.
<?php
$dbms = 'phpbb\\db\\driver\\mysqli';
$db host = 'localhost';
$dbport = '';
$dbname = 'abc_forum';
$dbuser = 'root',
$dbpasswd = '';
$table_prefix = '';
$phpbb_adm_relative_path ='adm/';
$acm_type = 'phpbb\\cache\\driver\\file';
#define('PHPBB_INSTALLED', true);
change $db host to $dbhost :
<?php
$dbms = 'phpbb\\db\\driver\\mysqli';
$dbhost = 'localhost';
$dbport = '';
$dbname = 'abc_forum';
$dbuser = 'root',
$dbpasswd = '';
$table_prefix = '';
$phpbb_adm_relative_path ='adm/';
$acm_type = 'phpbb\\cache\\driver\\file';
#define('PHPBB_INSTALLED', true);
The username and password are not valid. That is what this means. Ask your hosting provider for the correct credentials.
Keep it simple
$conn = new mysqli("DB_HOST","USERNAME","PASSWORD","DATABASE");
I have a confusing problem in login form, it seems work well when i try it in localhost but it gives a blank white screen when i upload it to hostinger. I think its not about the database connection. Please help me, because it doesn't give me an error reporting. Here's php code, the form and inputs name does match.
<?
$host = "localhost";
$user = "HIDDEN";
$pass = "HIDDEN";
$db = "connect_11265";
$koneksi=mysql_connect($host,$user,$pass) or die ("koneksi ke database gagal") ;
$koneksi_database= mysql_select_db($db,$koneksi);
if(ISSET($_POST['username'])){
$username = $_POST['username'];
$password = $_POST['password'];
$cek = mysql_query("SELECT * FROM login WHERE username='$username' AND password='$password'");
if(mysql_num_rows($cek)==1){//jika berhasil akan bernilai 1
$c = mysql_fetch_array($cek);
session_start();
$_SESSION['username'] = $c['username'];
$_SESSION['level'] = $c['level'];
if($c['level']=="administrator"){
header('location:admin/index.php?page=dashboard');
}elseif($c['level']="operator"){
header('location:admin/index.php?page=dashboard');
}
}
}
?>
I Assume, in hostinger not enabled the shortag options <? ?>, Can you try using <?php ?>.
BTW,
elseif($c['level']=="operator")
.....^
instead of
elseif($c['level']="operator")
Header is not working on Hostinger ....
Localhost for a mysql server is mysql.hostinger.hu
I am using PHP nuke 7.6
In config.php i have changes the some code -
$dbhost = "localhost";
$dbuname = "root";
$dbpass = "";
$dbname = " phpnuke";
$prefix = "nuke";
$user_prefix = "nuke";
$dbtype = "MySQL";
$sitekey = "SdFk*fa28367-dm56w69.3a2fDS+e9";
$gfx_chk = 0;
$subscription_url = "";
$admin_file = "admin";
After complete the configuration i got the following message.
"There seems to be a problem with the MySQL server, sorry for the inconvenience. We should be back shortly."
Please help me to shutout this problem.
Thanks
Maybe the space before phpnuke in $dbname?
$dbname = " phpnuke";