Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zane

  1. You should further explain this criteria. Reading through lines and lines of code is a lot of work when you could just as easily explain better.
  2. change $keyword.=$row300['keyword']; to this $keyword[] = $row300['keyword']; implode requires an array, not a concatenated string... much less a string at all.
  3. It depends really on what your queries look like. If you notice, at the bottom of this page it says and believe me, those queries are long.
  4. This seems like your best bet. Though the column wouldn't be temporary and I would do more than fill it with just 1s and 0s. I would perhaps call this column 'threshold' and increment it everytime you select it. Then you could simply check the threshold within your query.
  5. This forum is pretty large and I'd say the DB is just as large too if not larger... and although I don't manage it, I can guarentee you that it uses indexes. To not use indexes in a large DB would be insane IMO. Without indexes, how would you JOIN other tables in your query.
  6. In your form action I don't quite understand the dot, but it seems to me that you could POST to a "random" script. In other words... throw in some random GET variables in there.. more specifically the time. [code] That way it will always POST to a new script and the variables can never be reloaded... So long as you code around that technique. i.e check for $_GET['r']
  7. There are no divs in your supplied code. There's nothing complex about it. You only need to use the reserved word this The id route probably isn't the best idea, because you can't select all of them in one line. It would be better to give them a class name or two... like so Notice they all have two classes, but they all have value. So you could easily select them all, in jQuery with $('div.value').whatever(function() { /// Do some stuff.. with this element $(this).fadeOut().fadeIn(); });
  8. seeing as your here at PHPFreaks, it's probably safe to suggest that you start with PHP. Preferably having already started with HTML, CSS and Javascript.
  9. you must have mispelled something.. or put in an inexistant field or table.
  10. Why exactly do you need double while loops in the first place, you have exactly specified this. You mentioned that you wanted a member count, but if you follow my instructions from the begging, you can get that in one query... i.e ONE LOOP.
  11. It's a warning, not an error. And it has a meaning... highlighted in bold. In other words.. the query is bad.
  12. no different than the way you already are doing it. ^^^^ up there. Just change your query.
  13. http://www.phpfreaks.com/forums/index.php/topic,58799.0.html All the books you could possibly need.
  14. You need to have the group table separate from the users. For instance,. The GROUPS table group_id group_name The USERS table member_id username password group // This field would be INT and you would put a group id in it. Then when you run an SQL query on the users you can JOIN the groups to it. SELECT * FROM users JOIN groups ON groups.group_id = users.group
  15. that backslash is used to escape the double quotes... because you can't have double quotes inside of double quotes. Unless you escape your double quote with a \ slash, then the parse will think you are ending the string once it sees the second double quote.
  16. The main part you're forgetting here is that there is a PHP function called isset that one really must use to work with REQUEST (GET, POST, SERVER) variables. If this is only one form that you're using, and are doing separate things depending on which fields weren't filled in, then you probably don't need a hidden variable. Though you will need the isset funciton no matter what you do if you're accessing POST, GET variables. Assuming you don't need a hidden variable.. you would check for the submit button. if(isset($_POST['submit'])) { // The form was submitted... now what. } Now you can put your logic inside this depending on what was or wasn't inputted. Just off the top of my head, I would go about this in checking for the most inputted first. if(isset($_POST['submit'])) { // The form was submitted... now what. if(isset($_POST['var1']) && isset($_POST['var2']) && isset($_POST['var3'])) { //// All three were inputted. } else if (isset($_POST['var2']) && isset($_POST['var3'])) { /// Only var2 and var3 were inputted } else if(isset($_POST['var3'])) { /// Only var3 was inputted. } else { /// Nothing was inputted. } }
  17. This seems to me what you are trying to accomplish $data = 'Hello World This is a test string!'; $halt = 'String had more than 4 spaces.'; $arr = explode(' ', $data); if (count($arr) >= 4) { $data = $halt; else { $data = implode(' ', $arr); }
  18. If you mean to upload via AJAX, then yes.. that's ideally how you'd do it. No one wants to see a blank screen for half an hour or more. The only other way I can possibly think of is to use Flash and that's a different story altogether... even then, you'd be passing variables to an external upload script.. just like AJAX.
  19. I believe I'll just sticky this thread for once and hope to end these questions. http://www.phpfreaks.com/forums/index.php/topic,254277.0.html
  20. The most efficient way IMO, would be a switch using that hidden variable I mentioned.
  21. Typically, in situations like this I normally add an extra variable to the POST variables mix. I put a hidden variable in there. Mainly to tell me which type of data I'm receiving. Depending on the way you are POSTing your data, you have a few different ways to go about this technique. One of these ways is to POST the form with a GET variable. </pre> <form method="'post'" action="'awesomescript.php?o=1'"> ..... ...various form elements and a submit button. ..... </form> <b Notice how the action has a querystring attached to it. Doing that, you can check for it in awesomescript.php, obviously, for $_GET['o']. I usually choose a single letter for such hidden things just to have that sense of security... .. obscurity is what you'd call it really. Secondly, you can use an input type hidden inside your form. And last of all, is the AJAX way. If you're not using AJAX then don't worry about it, but if you are.. it's no different than just adding onto the querystring an extra variable.
  22. I don't exactly know what I was getting at on that point.. I was more or less just mentioning that link is inside the header, whereas a style tag (i.e the @import) could be placed anywhere else in the page. Ideally, you want everything like that in the header... and if for some reason you have multiple stylesheets... or a snippet of CSS you want to import in case of IE7, then you can use @import for that convenience.
  23. No, you're just telling it to echo $j + 1; Otherwise you would have added 5 to it. To increment it you need to call $j++;
  24. First Question What exactly is the problem that you're facing, other than the system not "working" Second Question You have four groups There's no telling how many permissions you have, but anyway. The best way is to store their permissions in binary form. Four groups means 0 = guest 1 = player 2 = mod 3 = admin That requires TWO bits. So alternatively, you could implement them like this 00 = guest 01 = player 10 = mod 11= admin Though it can get way more secure than that, that is the basis of it.
×
×
  • 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.