CSGOWinBig
CSGOWinBig copied to clipboard
I keep getting this error im finding it so hard to get out of 'loading...' everytime i fix something, something else is broken
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 '
the website is www.supremejackpot.tk if you need anymore infomation add me on http://steamcommunity.com/id/SupremeJackpotBot
Can you post your default.php line 23 code?
yeh sure
23: replace with 24: function getDB() {
i had to use the paste bin thing because it couldn't find my passwords
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
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...
What is your plan with the "replace with" command? :p
i got it from the paste bin
delete this haha
?
i have setup the site exactly how they said and it doesnt work
The "replace with" command. Its not really necessary, when you installed everything like its written in the readme file
will add you on skype
thank you reecerandcharlie
i haven't received anything on skype
now?
yeh