ztizzlegaming / CSGOWinBig

Open-source Counter-Strike: Global Offensive jackpot betting website.
MIT License
170 stars 104 forks source link

I keep getting this error im finding it so hard to get out of 'loading...' everytime i fix something, something else is broken #108

Open supremejackpot opened 8 years ago

supremejackpot commented 8 years ago

I keep getting this error im finding it so hard to get out of 'loading...' everytime i fix something, something else is broken. when i try to run the site i get this error, and the database wont connect i get a error.log then this '[14-Dec-2015 14:16:59 UTC] PHP Parse error: syntax error, unexpected 'with' (T_STRING) in /home/supremej/public_html/php/default.php on line 23 '

supremejackpot commented 8 years ago

the website is www.supremejackpot.tk if you need anymore infomation add me on http://steamcommunity.com/id/SupremeJackpotBot

theRod15 commented 8 years ago

Can you post your default.php line 23 code?

supremejackpot commented 8 years ago

yeh sure

supremejackpot commented 8 years ago

23: replace with 24: function getDB() {

supremejackpot commented 8 years ago

i had to use the paste bin thing because it couldn't find my passwords

supremejackpot commented 8 years ago

I've spent about 6 hours today trying to find the issue and another one just pops up after, i would be happy to let someone on the server and have a look as its just free server and free domain, and i have backup on computer

theRod15 commented 8 years ago

Hmm here is an working example, its from my site:

function getDB() {
$dbHost = 'localhost:3306';
$db     = 'databasename';
$dbUser = 'username';

# Get database password from outside of web root
$fileLoc = $_SERVER['DOCUMENT_ROOT'] . '/../passwords.txt';  #<--- Do you have your password.txt outside the root directory?
if (file_exists($fileLoc)) {
    $fh = fopen($fileLoc, 'r');
    $jsonStr = fgets($fh);
    $arr = json_decode($jsonStr, true);
    $dbPass = $arr['default-password'];
    fclose($fh);
  } else {
    die('no file found');
}

$db = new PDO("mysql:host=$dbHost;dbname=$db;charset=utf8mb4", $dbUser, $dbPass);
return $db;
}

Should work if you have placed your "passwords.txt" in the right way. Like this:

--- passwords.txt
  ---public_html <-- in your case
     ---index.html
     ---php
     ---img
     --- etc...
theRod15 commented 8 years ago

What is your plan with the "replace with" command? :p

supremejackpot commented 8 years ago

i got it from the paste bin

theRod15 commented 8 years ago

delete this haha

supremejackpot commented 8 years ago

?

supremejackpot commented 8 years ago

i have setup the site exactly how they said and it doesnt work

theRod15 commented 8 years ago

The "replace with" command. Its not really necessary, when you installed everything like its written in the readme file

theRod15 commented 8 years ago

will add you on skype

supremejackpot commented 8 years ago

thank you reecerandcharlie

supremejackpot commented 8 years ago

i haven't received anything on skype

theRod15 commented 8 years ago

now?

supremejackpot commented 8 years ago

yeh