Open HansenDansen opened 8 years ago
Did you setup the MySQL database and are you getting connections to it?
Yes i did that :) and i have putted in the password :)
Where can i see if i got connection to the Database? In the update.php?
Try just making a simple PHP script to get data from the MySQL server. My guess is that your site can't connect to your database.
I'll try that, but cant i just see if it have connection through the update.php file?
The website got connection to the database, because i did just deposit an skin to my bot, and then the update.php file updated.. Before the deposit: http://i.imgur.com/dokQRjb.png And after the deposit: http://i.imgur.com/Lq4nikY.png
I have tested it twice now with two different things, and both did connect, but i still doesent show up on the website.. Does the Database needs to have a specific Charset, shouldnt UTF8 be fine?
Yep that all looks good. What's your website URL?
http://imgur.com/OSZxAHd Here's your issue. Add a chat message directly to the MySQL database and see if that fixes your issue.
To quote the README:
The site assumes that there will always be chat messages, so you have to manually insert one chat message into the chat database table.
I have forgot about that, for sure it might solve the problem.. But it might sound stupid, but how do i add an chat message in there.. http://imgur.com/hww1whD Which one of theese do i need to add something to? :) I do not know that much about MySQL
I did figure it out! But yeah that worked! Thanks alot for your help man!
Are you still in here, because now i got an new problem.. The timer on the website dosent start.. The update.php file does get the items, but the check-items.php and the timer-end.php makes this error message.. http://i.imgur.com/wbRPyLG.png Is it because i dosent have connection to the database? Thanks in advance
so i need to put the database password in that field?
or where should i supply an password?
No, you need to put the password that is defined as "default-password" in your passwords.txt
Okay, but i did code the password in to the .php files because that my host doesnt allow me to put anything outside of the web root... So how can i supply it?
I can send you an Pastebin with my files in, so you can see what i have changed.. if you want me to?
Change this:
# Get the password from config file and make sure it matches
$fileLoc = $_SERVER['DOCUMENT_ROOT'] . '/../passwords.txt';
if (file_exists($fileLoc)) {
$fh = fopen($fileLoc, 'r');
$jsonStr = fgets($fh);
$arr = json_decode($jsonStr, true);
$realPassword = $arr['default-password'];
fclose($fh);
} else {
die('no file found');
}
to
$realPassword = "XXX";
Then, when making a request, use http://site.com/timer-end.php
with a POST field of password
equal to XXX
. If you don't have a way to make POST requests easily, try Postman, a free Chrome extension. (Or alternatively you can change $_POST to $_GET to make it a get request which you can do from your URL bar - i.e. http://site.com/timer-end.php?password=XXX)
so like this: $password = isset($_POST['password']=xxx) ? $_POST['password'=xxx]
The password = xxx
?
I am really glad for you help dude! It means alot!
No. So let's just make this easy for now. Change
# Get the password from config file and make sure it matches
$fileLoc = $_SERVER['DOCUMENT_ROOT'] . '/../passwords.txt';
if (file_exists($fileLoc)) {
$fh = fopen($fileLoc, 'r');
$jsonStr = fgets($fh);
$arr = json_decode($jsonStr, true);
$realPassword = $arr['default-password'];
fclose($fh);
} else {
die('no file found');
}
to
$realPassword = "XXX";
AND change
$password = isset($_POST['password']) ? $_POST['password'] : null;
to
$password = isset($_GET['password']) ? $_GET['password'] : null;
Now you can end the timer with http://site.com/timer-end.php?password=XXX
.
Arh, okay.. But my problem is that i want the timer to start, it just keeps saying 0, and there is 4 people in the pot and 32 items in it.. can you solve that problem aswell?
Btw, cant i just put my passwords.txt in an folder, and then edit this: # Get the password from config file and make sure it matches $fileLoc = $_SERVER['DOCUMENT_ROOT'] . '/../passwords.txt'; if (file_exists($fileLoc)) { $fh = fopen($fileLoc, 'r'); $jsonStr = fgets($fh); $arr = json_decode($jsonStr, true); $realPassword = $arr['default-password']; fclose($fh); } else { die('no file found'); }
So that it find the file passwords.txt in that folder? Wouldnt that fix it all?
If you put it on your web host, that's an ENOURMOUS security risk, as someone can simply go to http://site.com/passwords.txt or /folder/passwords.txt and get all your passwords. The best way to do it is to put them all in a PHP file, and I'm not sure why that's not what @ztizzlegaming did. I'll fix that in my branch.
Yeah okay, stupid me xD. But i cant be awake 24/7 and type that url in, can i fix it on another way? And how to fix the bug with the timer that doesnt start?
Again i'm really glad for all you help dude!
If i buy my host on an host that allows me to save my files outside of the web root, wouldnt that fix it all aswell?
It should. If it's a fresh installation of CSGOWinBig, it should work fine.
But, again if the check-items.php and the timer-end.php files cant get the password, and i need to type that url in every time i want it to work, then i'll need to stay awake 24/7, is there anyway that i can fix it another way with that server i got now?
Thanks in Advance
@andrewda I just bought VPS at Bluehost, everything works fine now. Besides one thing.. The timer, i have tried to do everything that all the other suggest, but nothing really helps.. Can you help me with this as well? And again thank you very much for all your help!
Hey Everybody.
I can login to my website, but the pot and the chat keeps saying loading. I have hardcoded the passwords and api key into the code.. This is the changes i made when i did hardcode it in.. And this is a picture of the problem. http://imgur.com/KdLVsql
Regards Frederik