Jump to content

ixicoding

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Everything posted by ixicoding

  1. The first thing I've noticed is that you're setting error_message and then checking if it contains data to throw the error. If you remove $error_message = "Please enter an email address"; it should work fine. EDIT: You may want to remove the email addresses 'example@example.com' and 'example6%@example.com' from your database . I used them for testing it.
  2. Yup, but the game is still active and I'd assume he has email notifications. He wanted info, the threads not closed, I'm just helping. (the game isn't finished yet, so it is still in beta)
  3. Back on topic a bit, the maximum bankroll/cash on hand allowed is restricted to 2147483647. You may want to consider using a different variable type for storing money, or make it harder to get. Otherwise it seems to be coming along fairly well, good job.
  4. I checked your page on both safari and firefox. On firefox the loading image displays correctly, but on safari it wasn't as nice. It did work, however. If you notice it is displaying but just very quickly. It may be that webkit is more efficient?
  5. It seems to streamline quite a bit, thanks again for the info.
  6. Alright, that gives me a base for learning more . Thanks for the info.
  7. Nope, in this case (as I said) it is the jQuery object. Do explain to us humble muggles, if you have the time.
  8. As far as it's use in this case and in general it seems the dollar sign ($) is used for abbreviating document.GetElementById. In this case: Would be like writing: document.GetElementById("a.vote_up").click(function() I haven't had much luck using it, but from a bit of googling this is the best answer I came up with back when I was trying to figure out the same thing.
  9. That works. I'm surprised they got rid of it, it's pretty useful when the headers are already sent out. Either way glad to hear it's fixed.
  10. Did you try replacing the meta tag? .. the syntax was wrong in it. It was missing quotes etc. It looks like the PHP is fine so it's most likely logging them out in firefox but not redirecting them due to the broken meta tag.
  11. <?php echo $_SERVER['REMOTE_ADDR']; ?> is actually his signature. His reply was: "Text file database"
  12. The browser shouldn't have any effect on the code as it's all server sided. The only problem i can think of with this is that 'login_out' is being passed in differently. Try echoing what is stored in $_REQUEST['do'] and check if it is actually passing through properly. Also echo "<meta http-equiv=Refresh content=0;url='index.php'>"; should be echo "<meta http-equiv='Refresh' content='0;url=index.php' />";
  13. SELECT * FROM table_name WHERE COMPANY = 'Ours' ORDER BY JOB_NO DESC LIMIT 1 should work EDIT: A little more specific : $sql = "SELECT JOB_NO FROM table_name WHERE COMPANY = 'Ours' ORDER BY JOB_NO DESC LIMIT 1"; $result = mysql_query($sql); $row = mysql_fetch_array($result); echo $row['JOB_NO'];
  14. You mean: <?PHP echo "<tr><td>".$linenumber++."</td><td>".$userresults['username']."</td></tr>"; ?> ?
  15. Assuming you know some CSS/HTML you can use php to check a variable that adds to itself every time the loop is executed. If it is even then you use a certain color and a different one for odd. For example: <?PHP $i = 1; while($row = mysql_fetch_array($result)) { if ($i % 2 == 0) { echo "some info in the table here with a green background"; } else { echo "some info in the table here with a white background"; } $i = $i + 1; } ?>
  16. If it doesn't solve it hopefully it helps .. It's an overview on passing arrays to php directly from a form. It doesn't go into multi dimensional arrays but you may be able to specify i.e. <input type="text" name="myArray['Myarray2'][]" /> for passing it in multi dimensional.
  17. http://www.php.net/manual/en/faq.html.php#faq.html.arrays May help you out a bit.
  18. Yes, you would have to add in an extra field if you do not already have one. It's hard to produce example code when I don't know how you're doing it now but here's a very simple example: <?PHP function retreiveMsg() { $sql = "SELECT * FROM messages WHERE new = '1'"; $result = mysql_query($sql); $msg = mysql_fetch_array($result); broadcast($msg); } function broadcast(array $msg) { $chat->active_users->sendmsg($msg); removeflag($msg['uid']); } function removeFlag($uid) { $sql = "UPDATE messages SET new = '0' WHERE uid = '".$uid."'"; mysql_query($sql); } ?> This way it would select only the 'new' messages and send it to the active users in the current chat session. As a new user enters they would only see the newest ones from the time they joined the active users.
  19. This really depends on your implementation but I tend to use flags for this type of thing. You can set a 'new flag' in the database that gets removed once the active users have all been sent the message. You would then only need to pull the 'new' messages every time and the old ones will never display for anyone that was not previously logged in.
  20. Here's a couple basic things to make sure you're secured: Custom Post/Get Requests It may not be a big problem for you, but if you have an admin page for viewing registered user's accounts, you will want to check who's logged in and trying to access the page. I've created a couple custom POST and GET requests to pages that would just spit out all the information on a given users account without checking for any authentication. You can solve this by suppressing PHP errors so potential 'hackers' can't get your file structure, or ensuring there is an active/elevated session/account trying to access the information. Simple SQL Security If you're not accessing your database from anywhere other than the local machine then it is good practice to make sure the database users are only able to log in from localhost. It's also good to make a custom user for the website that only has certain privileges, that way if they manage to get in control they cannot do too much anyway. Also, it may be common sense but always password protect the database users. .htaccess Protection I'm not going to go too deep into how to set this up but using .htaccess to restrict directories that a user can access via password protection also helps you out as far as unwanted people snooping. You basically set up a .htpasswd file and point to it with your .htaccess file. Put a copy of the .htaccess file in any directory you want to further password protect beyond sessions etc. 404/Directory Redirect This is debatable and somewhat redundant but set your 404 page to redirect to your index page as well as any directory that you do not want people accessing. When people just randomly go through paths on your site they will always hit the index page. This can get pretty discouraging for someone looking for a hidden gem directory. If you have a directory called includes, link it to your index page unless a specific file is requested so they don't actually know if that directory is real or not. To answer your question, yes it is possible to steal cookies, which is why it is always good to double check the $_SERVER[REMOTE_ADDR] (this gives the users current I.P. address) variable or wherever you have it stored in your session variables constantly. You want to compare the one held to the one the current user has, this way you can determine if the cookies have been stolen or not. You can further check browser type, operating system etc. if you really want to go in depth on this but generally if someone is stealing the cookies they aren't going to be on the same computer as the victim so the I.P address should suffice. Hope this helped a bit. EDIT: Sorry if any of this has been mentioned, a few posts were made while i was typnig this out.
  21. Have you tried using a post or get request to the page itself? Basically <?PHP if isset($_GET[$name]) { $time = $_GET[$name]; //some code here to do whatever you want to do with the time variable } ?> If you were to put that before the HTML on the page you would be able to use the header() function to call a newly structured URL. For example: header('Location: http://genuinesounds.mine.nu/getmyip.php?time='.$time); If you don't want to modify headers or it is too difficult for the current use you can always echo a meta refresh tag. echo "<meta http-equiv=\"refresh\" content=\"0;url=http://genuinesounds.mine.nu/getmyip.php?time=".$time."\" />"; Another way may be to use JavaScript, 'document.getElementById['time'].value ' will grab the current selected value. This is the best i gathered of what you are trying to do (refresh the page based on the seconds selected). If that is the case both methods should 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.