Jump to content

Worqy

Members
  • Posts

    120
  • Joined

  • Last visited

Everything posted by Worqy

  1. Thank you all for your answers! Just to clear it up, when I asked if I should use the password in the salt I was thinking of using a salt (time + letters) + password to create a different salt that I would use to hash the password. So the password isn't saves in the database, insted I would use the password the user inputs to create the new salt to compare the hashed passwords.
  2. Should the salt be saved on the same place as the username & password? Is current time + random letters + password a good salt? Or how should I generate it?
  3. Thank you all for your answers! I've had two tests at school this week so I haven't had time to try out anything yet. I will post back on the weekend if I have some more questions.
  4. Hi! Insted of making alot of topics with just one question in them I decided to make a topic with all my short questions in it. I'm trying to make a intranet type of website that is made for smaller communities to control users and keep their staff up to date. Question 1 How should I store my MySQL username/password ? Right now I'm storing them in .php files and include them where needed. Is there a safer/better way to store them? Question 2 A Are session unique for every website? If website A has a session called "login" that is set to true can the user login to website B that also uses a session called "login" ? If true, how should I keep my session unique ? B Are sessions a good/safe way to store login information? Information like "is the user logged in", "access level" etc.. ? Question 3 How should I store critical user information like passwords ? Right now I'm using sha2 hash the passwords. Is that enough? Should all the user information (username, email...) be somehow encrypted? Any comments about website structure and/or security is welcome!
  5. So I need to rewrite a part of the rcon class im using?
  6. Ok. So for you guys to even better understand what I wan't to do, I'll paste the files: <?php Session_start(); include "config.php"; include_once("rcon.class.php"); echo "Console" . "<br />"; $r = new rcon("$serverip","$rcon_port","$rcon_password"); if($r->Auth()) { $r->rconCommand("say Logged in"); } function rcon_list() { echo $r->rconCommand("list"); } function rcon_save() { $r->rconCommand("save"); echo $->rconCommand("say Saved"); } ?> <html> <head> </head> <body> <button type="button">List</button><br /> <button type="button">Save</button><br /> </body> </html> Now by pressing the "list" button I wan't to run the function list, same with save. But I need to do this without reloading the page since it takes quite long to connect and login to the server. And ajax, could you give me an example how it would work in this case?
  7. Hi. I'm not sure if this can be solved with php, but I'll give it a shot. So I'm making a RCON webpanel, based on this code: http://fremnet.net/article/199/source-rcon-class . Now, the design of my site is going to be "console" like, a big textarea and a text field where you write the commands. My problem is that I wan't to run this piece of code: $r->rconCommand([i]TEXTFIELD DATA[/i]) whenever I press a button. But php is server-sided and what I wan't to do is kind of client-sided.
  8. Thanks, got it working
  9. Thanks for your help. But there is one problem with your script, the query ends with a ",". Like this: ), (607138,380,-357,3,48950,'XXXXX',10291,'XXXXXX',306,'idefix',492), (607924,365,-358,3,50822,'XXXX,6283,'XXXX',306,'idle',167), The script must somehow know when the last line is written, and then remove the ","
  10. Whats the easiest way to do it? You can see what the file looks like by scrolling up, 5000 insert statements. And no, I have no binary files or anything else, just a .sql file.
  11. So my best bet is to read the sql file line by line and query it while reading? Can you give me an example code of the fastest way to do this since the sql file could hold about 30 000 lines at most.
  12. By looking at sqlyog I think I need to give more info. The script that downloads the sql file runs every day, and therefore I need the "sql table uploader" to run every day automaticly. sqlyog looks more like a admin tool where you can do it yourself. Please explain more about them.
  13. This is not 2 querys, its about ~5000 rows of "INSERT INTO". INSERT INTO `x_world` VALUES (477901,104,-196,3,50503,'11',1382,'XXXX',30,'Idle',212); INSERT INTO `x_world` VALUES (477946,104,-196,3,50503,'11',1382,'XXXX',30,'Idle',220); INSERT INTO `x_world` VALUES (477974,104,-196,3,50503,'11',1382,'XXXX,30,'Idle',288); INSERT INTO `x_world` VALUES (477971,104,-196,3,50503,'11',1382,'XXXX',30,'Idle',270); ...
  14. Hi! I have a problem I need help with. My script downloads a sql file from a popular game, and the sql file is a exprted table. Now I need to import this table into my own database to make it easy to read. I tried to read the sql file line by line and query it, but it took quite long and I got a error saying I can only query 30 times in a second. Is there any easy way to import the table into my database?
  15. Hi. I need help with a PHP script that deletes mysql data. Is there some way to delete a sql row by only telling the data stored in it. Let say I have a table called "Users", with columns "Username" and "Password". Can I somehow delete is like this "DELETE FROM Users WHERE IT CONTAINS 'Kevin', 'Secret'" now it would search and see if there is any like with that data on it. I need it because I have a table with unknown column names, I only know the data stored.
  16. And now I found another thing I can't understand.. <?php $log = $_POST['txtLog']; $command = $_POST['txtCommand']; $action = "Nothing"; $words = explode(" ",$command); if(sizeof($words) == 2) { if($words[0] == "create") { if($words[1] == "new") { $action = "LOLOLO"; } } } // Add text to log $log = $log . "\n" . $command . " - " . $action; ?> <html> <head> </head> <body> <form method="post" action="test3.php"> <textarea cols="100" rows="20" name="txtLog" readonly="yes" style="background: black; color: white; font-family: COURIER;"><?php echo $log; ?> </textarea> <input type="text" name="txtCommand" style="background: black; color: white; font-family: COURIER;"> <button type="submit">Run</button> </form> </body> </html> when I input "create new" the output should be "LOLOLO" and it is. But when I input "ihiuui new" or "create asdasd" the output is still "LOLOLO". How can this be possible?
  17. Hi Here is a update of my project: Everything works well, I can run commands from the iFrame. But I need atm to use a button for it. How can I make "Enter" work as a submit button? EDIT: How can I make it so that text isn't saved to the textfield every time I submit it. Ex: I run the command "Create", "Delete", "Time". Now when I enter something, it suggests all of these because I have entered them before. Is there somekind of auto save that I can turn of for just this inputfield?
  18. I would wan't the Enter press to work the same way as a form posts. Ex: Non-iFrame: two fields, Username and Password, one button "Login" I enter the Username and Password, and press "Login". The page sends the data to another page where I check if its right and then redirects... iFrame: same two fields and button. This time it doesn't reload any page, it just edits the frame if the login was successful or not. so what I'm trying to say is, I will have one textarea that is a "log" for all content. Then a text field where I can write a command like "Connect to database", wand when I press Enter for example it could run a function called Connect... and then add the text "Connecting" to the "log"..
  19. ok. I have a iFrame now, and another page with the content. I have made the textarea (log) and but now when I wan't a textline and a button (or to press Enter would be even more nice), how do i do to send the data?
  20. Hi! I have started a big project with some of my friends. Its some kind of CMS system. Now, for quick commands we wanted something like cmd on windows. Is it possible to build a script that would be something like cmd/a console. Of course it would be a webpage and not a separate window. I could do this myself with a input field and a form using the POST method. But I wouldn't wan't to refresh the page every time I run a command. So something that works like the input field, form with the POST method, but without needing to refresh every time. Ask if I didn't make it clear enough! Regards Kevin
  21. It is returning everything I wan't it to.. But as you can see from the code in the first post, $a is a user input and I would wan't it to get from a div that the user selects
  22. Worked, thanks! I've tried all I know to this problem, but its been some months since I coded PHP, so I might have forgot something. This line: preg_match_all('#<div id="intro">(.*?)</div>#sim', $page_all, $div_array); should look like this: <div id=$a> etc.. But I cant get it to work!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.