Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. It looks like the behaviour of the letter-spacing property is to add additional space to the right of each letter rather than equally distribute it on both sides. This means that you will have to adjust the padding to accommodate that. Since the letter spacing is in ems, you'll have to define the padding in ems and have the right padding be the letter-spacing amount less than the left padding.
  2. First, you have to use prepared statements to send data to your queries. If you don't it's highly likely that some unexpected data will cause errors in your query and break your program and in the worst case scenario this can be used to hack your website. You can use the IN() operator to compare a field to multiple values. This works best in PDO, where you can pass parameters as arrays: <?php $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); // Set the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Build a string of placeholders like ?,?,?,?, one for each array element. $amount = count($uniqueValueArray_id); $placeholders = array_fill(0, $amount, '?'); $search = implode(',', $placeholders); // Prepare the statement $limit = 5; // Make absolutely sure this value is an integer or the program will break $stmt = $conn->prepare("SELECT id, text, date, FROM text WHERE id IN ($search) ORDER BY id DESC LIMIT $limit"); // Run the statement, passing in the values $result = $stmt->execute($uniqueValueArray_id); while($row = $result->fetch(PDO::FETCH_ASSOC)) { // Display the result here however you want print_r($row); }
  3. I can't help without seeing what code you used to put a video into the background.
  4. That is not a contradiction. The width is restricted to any value less than or equal to 100% of its parent's width. It is not allowed to be 200% or 400%. The range of valid values used to be from 0 to infinity, we have restricted it to the range [0, 100].
  5. About CSS and rule precedence CSS is currently the best system we have for easily creating flexible layouts. Some people might hate CSS but I'd like to see if they can come up with a better alternative. CSS rules are chosen based on how specific the selectors are. In general the following rules apply: A rule with an ID selector always has precedence over a rule without one. A more specific rule has precedence over a less specific one, that is when the selector has more pieces in it. If two rules are still the same after the previous tests, the last rule has precedence. This works across stylesheets and in the document as well. To get more details you can read this article: https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity The solution to your specific issue The issue here does not seem to be with precedence, though, it's actually a combination of a lot of small things. First, due to browsers very unusual way to render fieldsets, you need to set the min-width of your fieldsets to make them behave like normal boxes: #yp_container fieldset { min-width: 0; } The second thing is that you have to restrict your box's width so that the text is not given the opportunity to not wrap. If it's allowed to stretch the box, it will do that instead of wrapping, so we'll set the max-width of the box to 100%. #current_referral_url { max-width: 100%; } Finally, you made a mistake: The overflow-wrap property should be set to break-word. The normal behaviour is to not break. #current_referral_url { max-width: 100%; overflow-wrap: break-word; } A word about using IDs as selectors I would recommend not using IDs in your selectors if you have any other option. IDs are very powerful and as you know, with great power comes great responsibility. When you use an ID selector to set the style of an element, you make it terribly difficult for rules anywhere else to override your style. If you are going to use an ID selector, you should be sure to use it to only set properties that are very special to the element, which in most cases none of them are that special. It's a good idea to make all your selectors as weak as possible, you never know when you want to override them. A word about usability in your website I haven't had a good moment to tell you this, but your website has a severe usability problem and you have already been experiencing its negative effects. Every time you want somebody to get to a specific page on your site, you find yourself forced to give a long list of instructions on how to get there. This is a problem, there should be unique URLs to get people to land on any part of the site in just one click.
  6. As far as I know, numbers in Javascript are natively objects, everything is an object actially. There's just a syntax problem when doing 2.method() because the meaning of the dot is ambiguous until reading further, it could be indicating a decimal point. This works in the Javascript console: var x = 5; x.toString(); // Prints "5" Edit: There is actually some kind of distinction between primitives and the object representations of them, but anytime you call a method on a primitive the Javascript engine automatically creates an object representation of it. This MDN document has a short section about it. While the document is talking about strings it applies to all primitives.
  7. That's probably because you're linking from an HTTPS site to an HTTP site. Check that your link starts with https:// instead of http://
  8. Most browsers will show a collapsible representation of a data structure of you log it using console.log().
  9. There isn't, but you can send a report from the tutorial page that the example belongs to, the link I gave in my previous post. You can describe the issue in the report and they should be able to find it from there.
  10. I think you're most likely to get the staff's attention by visiting this page and clicking the "REPORT ERROR" link at the bottom of the page.
  11. Google will not find it through that specific link, but it is most likely capable of finding the page through other means. If you have a page that's public on the internet, Google's crawler will usually find a way to it. If you want to prevent Google from indexing the page, as I said before, use robots.txt or the meta robots tag to indicate that you don't want it indexed.
  12. My first guess would be that what you have is just a string instead of a JSON object. Log the full object into the console to see what it contains.
  13. Just replace the <button> element with an <a> element that has the same class attribute. The class is important. <a class="button"><span>Hover </span></a>
  14. I'm not sure what "from inside the div" means. Does that mean that the script that's doing the replacement is inside the div? As far as replacing the content of any element, you can either set its innerHTML property or use DOM methods such as removeChild() and appendChild().
  15. Ingolme

    cookie coding

    Remove the echo statement. The header has to be sent before any output, which includes all echo statements. In this case, the echo statement can be removed because the location header does the redirect. If you are working with sessions, you have to call session_write_close() before sending a redirect header.
  16. Ingolme

    cookie coding

    The PHP manual says prior to any output. The reason being that it has to be in the HTTP headers section. If you have studied the HTTP protocol it should be clear. An HTTP response consists of two sections: The headers and the body. The headers provide information about the data being sent, such as the amount of bytes, the file type and also cookies. After the headers goes two line breaks and then the body. The body is the actual file contents. In order to be efficient, PHP goes sending data back to the client while it is still processing, which means that as soon as any content is printed, whether it be HTML or anything else, it immediately sends the two line breaks and enters the body section of the HTTP response. Once those two line breaks have been sent it is impossible to go back an send any more headers to the client because whatever you send is going to be considered part of the body. While PHP is usually used to send HTML, it can also send any other kind of content, like image data, a video or an excel file. PHP can output content of any kind, so saying that headers have to be sent before the <html> tag just covers the specific case that the first part of your output is the string "<html>". The general case is that the headers have to be sent prior to any output.
  17. Ingolme

    cookie coding

    The setcookie() call has to be done before any HTML is printed, even before the <!DOCTYPE> declaration, because cookies are sent with the headers which have to go before the content.
  18. You probably should go through the Javascript tutorial and become familiar with it. If there's still something you need help with after that then you can ask about it here.
  19. Without seeing any code I can't give an answer. If I had to guess I would say that the stylesheet version on your local server is probably different than on the live website. Another possibility is that there's some kind of dark overlay on the page. Open the developer tools in your browser and inspect the elements on the page to see more information.
  20. Ingolme

    cookie coding

    It makes no sense to set the same cookie twice in the same script. The first line will be ignored.
  21. Ingolme

    cookie coding

    To delete a cookie, set its expiry date to a past date. If you set the same cookie twice the first one will be ignored. You're not actually deleting the cookie, you're giving it a different value.
  22. The browser will do validation if you use the <form> element's submit event. Do not use the click event.
  23. Google will index the page when it finds it.
  24. Your requirements were not clear. You asked to "make the output of the cURL call visible in the file that produces it" but it's not clear what "visible" means in this context. My interpretation was that you wanted the curl data visible to the script itself instead of being passed on straight to the client. The idea behind that would be that the script can manipulate the data before sending it to the client. It seems that is not what you are looking for. Seeing that you've changed the method to GET, I suspect that you wanted to see the output in your browser by sending a GET request to the script. If your code is designed to only show content when POST data is available then you have to send POST data to see the content.
  25. I don't have an iPhone with me and can't reproduce it on my emulators, so I'll have to make a guess. It might have something to do with setting the width to "-webkit-auto". At best that would do nothing and at worst it's going to behave unpredictably. Remove the -webkit-auto rule because there will never be a circumstance where it is needed. My second guess would be that it has something to do with the OS's button styles. You should set appearance/-webkit-appearance property so that it behaves like a regular element, like this: #pc_signup form input[type="submit"] { -webkit-appearance: none; apperance: none; } On the topic of -webkit- prefixed rules, they must always go above the real rule, so that browsers that support both will use the most updated version of the rule. I have no idea what you mean by "bubbling" in the context of CSS.
×
×
  • Create New...