Jump to content

vineld

Members
  • Posts

    286
  • Joined

  • Last visited

    Never

Everything posted by vineld

  1. You print "You are logged in as:" prior to checking anything at all so naturally that will be displayed....? What is the actual problem?
  2. Normally, no, but I can alter the sql which is much easier.
  3. Then you simply did not post that part of the code. You probably have some logical mistakes in another place...
  4. I think maybe it would be a good idea to build something less complex than an antire game until you get a good grip of the language. Chances are you will need to go back and correct A LOT of code otherwise.
  5. If you have many pages you will not want to use switch either but select the image file itself dynamically instead.
  6. Try simply selecting where 1 and see if you can get anything at all out of the database.
  7. You need to add a date field to the database as well and then either use one count for each date or simply update accordingly when you encounter the next day.
  8. they can only delete messages that are to the user who is logged in change $search="SELECT ".TBL_MESSAGES." WHERE to_user='".$user."' AND message_id='".$msgid."'"; to $search="SELECT * FROM ".TBL_MESSAGES." WHERE to_user='".$user."' AND message_id='".$msgid."'"; No, that's where you're completely wrong. The code you present above makes it possible for me to delete all messages if I feel like it, not just those that are my own.
  9. Do I get you right now. You wish to display ONE link (using #) if you are not on 0-9 and you wish to simply display # if you are on 0-9? If so, simply use in_array().
  10. vineld

    php tags

    You need to connect to a database and do sql queries in order to fetch the data. Read up on basic sql with php and you will find what you're looking for. Try avoiding short tags as well. Although they will work in virtually all shared hosting environments it is bad practice in the long run. It will still be supported in newer php versions as well though so what mmarif4u told you is not entirely true.
  11. Ginger is absolute right, it depends entirely on the situation. Do you mean libraries such as jQuery or prototype? If so, then you are of course free to use them. If you find other scripts or libraries you wish to use be sure to check what the license allows you to do with them. Also, choose wisely. No need using the entire jQuery library if you only need a few lines of javascript on your site.
  12. I assume you're trying to fake clicks on banner advertising? That is a real bad idea which will get you suspended from all programs, at best.
  13. First of all why do you use: $p_id = round($_GET['id']); ? If you want to validate the id value then there are more important checks to be made... Also, you should definitely escape the value before using it in the sql unless the database class does that for you. Try removing the backslashes: $result = $database->query("SELECT * FROM img WHERE id='$p_id'"); You never tell us exactly what is going wrong. Please let us know further. Try avoid using short tags as well.
  14. If you print the check boxes dynamically it will be easier. You could store the checked boxes in a hidden input field as well and use javascript upon body load. Validating on the client side might be an idea too if you don't really mind not maintaining the checked boxes for that very little clique that do not use javascript.
  15. You may have several submit buttons post to the same php file and then do differently depending on which one was used if that will work for you? Javascript and buttons will also do the job. It all depends on what you wish to accomplish, really. It's difficult for us to offer the best solution without knowing more.
  16. Why do you even use the array if all you want to do is print one single link...? Or am I missing something?
  17. You do not define what you want to select, nor have the FROM in your select here: $search="SELECT ".TBL_MESSAGES." WHERE to_user='".$user."' AND message_id='".$msgid."'"; Also, you should never insert user input directly without properly escaping it. As is now people are free to delete what they want from your table.
  18. Read up on basic sql and php because you are pretty much asking someone to do all the work for you...
  19. Search for object oriented php. It's built around classes.
  20. Create a proper html document and see if the problem remains.
  21. Alright, when put that way I will have to agree with you There are situations where the border between filtering and validation is very thin though. Most data stored in databases are plain text or numbers though and then I will not want any unnecessary operations on display. Of course a forum post or WYSIWYG content is a bit more complex to handle. I think we are on the same page after all In my defense, I haven't slept much lately
  22. Twisting words For me making sure that I get what I want is validation, no matter what I look for. Perhaps this is just a mistunderstanding. Could you give me some example of those scenarios where it will be necessary to filter database values where it can not easily be done prior to insertion?
  23. You'll place all css and html just as you would in the .html file. There's no difference.
  24. I am modernizing a site and in the process I have switched to XHTML 1.0 Strict. It did not mean too many changes in this case although there was one problem I ran into. There are quite large code blocks with mouseover effects that reside within a DIV. Inside there are several other DIVs, paragraphs and images. Changing this would mean some messy restructuring which doesn't sound very appealing to me. Is there any good easy solution to this problem? I don't really wish to use JS since search engine bots may not like it. I am actually considering leaving it as is even though it doesn't validate. After all, it does 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.