Jump to content

MDCode

Members
  • Posts

    640
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MDCode

  1. No, then you are risking javascript being used. You need to replace specific tags only. Example: <?php // $_POST['sometext'] will be <h1>Title</h1><p>Some paragraph</p><script>alert(hi)</script> $original_text = htmlentities($_POST['sometext']); // The htmlentitied tags (< being < and > being >) $converted = array('<p>', '</p>', '<h1>', '</h1>'); // What to replace them with $tags = array('<p>', '</p>', '<h1>', '</h1>'); // Use str_replace to make things so much simpler $new_stuff = str_replace($converted, $tags, $original_text); echo $new_stuff; ?> $new_stuff will display Title as an h1 header and the paragraph but will convert the script tags so they won't work
  2. Selecting from it getting the row and assigning it to a variable.
  3. No. I don't believe you can post a variable. Even if you can you have it in single quotes which will not parse it's value
  4. Have you tried echoing mysql_error() ?
  5. "I am struggling" does not define your problem? What is it doing that it shouldn't, or what is it not doing that is should?
  6. htmlspecialchars and htmlentities will both convert the less than and greater than. You will need to str_replace all of the tags back into your data
  7. You are letting users query your database? Aren't you a bit concerned that there are security issues? As for your problem I can not understand one bit of your description.
  8. If you want to select from multiple tables, you need to use a join. It's not good to use queries in loops.
  9. I see no errors with that code block. Paste the whole page in tags
  10. You can not use mysql commands with mysqli. It will not work. Choose one.
  11. http://yourdomain.com/yourfile.php?province=whatever&city=blah&k=k&t=rawr
  12. If they are not defined in the url, it would explain it. I've tested it on my site with no errors.
  13. Please do not post an issue in another person's topic. You first query should work except you misspelled a variable
  14. Perhaps they changed settings, change your opening <? tag to <?php
  15. Remove the quotations like you did with $_POST['subject'];
  16. Yes, you are looking for $_POST['subject'] not $subject. Change all those ($subject, $detail, $customer_mail).
  17. If this is a php issue it should not matter which country. Do you have a question other than what seems to be "Can you please go to my website?"
  18. If that is where your form and processing code is located yes.
  19. Well, we need to see your form and your full page of code if you haven't posted it already. I think what you might be looking for is $_POST['subject'], $_POST['detail'], etc.
  20. I found it much easier to learn python after I got a good grasp on php. My opinion is that you should go with php first.
  21. You're calling a variable by a variable that isn't defined. Of course it's going to give an undefined notice.
  22. You can use cookies (which can be cleared) or use a database.
  23. Look into google ReCaptcha. We are not here to code for you, we are here to help you.
×
×
  • 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.