Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. Have you checked the network tab of your browser's develper tools to see what's in the response? If you can see what the response is, try printing out the value of some of the variables to see what you're getting.
  2. I've checked google's cache for your website: http://webcache.googleusercontent.com/search?sclient=psy-ab&q=cache%3Abrauli.cl&oq=cache%3Abrauli.cl&gs_l=serp.3...23583.24367.0.24565.6.6.0.0.0.0.122.456.3j2.5.0....1...1c.1.64.psy-ab..1.0.0.z82uRrvpp7U&pbx=1 The meta description tag is in the source code, so I suspect Google didn't like it and decided to find more substantial content. Try making a longer, more descriptive description and see what happens.
  3. My guess is that, like bootstrap, the grid system is using floated elements. There should be a grid wrapper class of some sort to prevent this problem.
  4. The asterisk selects all elements, the comma is used to apply multiple selectors to the same set of rules. When properly indented the code should look like this: html { box-sizing:border-box } *, *:before, *:after { box-sizing:inherit }
  5. Try to debug it. Find out why it's not giving the right value.
  6. Do you understand what the code is doing?
  7. I'm not saying your question was immature, arguing and insulting other forum members is immature. If somebody is being rude it's best to just report it and not reply.
  8. There are several issues with your code. You're overwriting the variable $sql and $row inside the loop that's using those variables for iteration, you're also overwriting the value of $total on each iteration. Your code looks much more complicated than it needs to be. You should read the SQL tutorial. Assuming you don't have a "quantity" field, the function can be as simple as one SQL query with a JOIN and using the SUM() function. function total_price() { global $db; $ip = getIp(); $query = $db->prepare(' SELECT SUM(p.product_price) AS total FROM cart AS c JOIN product AS p ON p.product_id = c.p_id WHERE c.ip_add = :ip '); $query->bindParam(':ip', $ip); $query->execute(); $row = $query->fetch(PDO::FETCH_ASSOC); if($row) { $total = (float) $row['total']; } else { $total = 0; } return $total; } In the case that there's a quantity field, just change the SUM() function to multiply price by quantity: SELECT SUM(p.product_price * c.quantity) AS total FROM cart AS c JOIN product AS p ON p.product_id = c.p_id WHERE c.ip_add = :ip
  9. You're both being immature. Unfortunately there isn't a tool like that because it would not be able to create good selectors for the rules. There's no way to know what the intention of the author was from just inline styles.
  10. I would assume product_id is unique, so there's only going to be one record in the database with that ID. That means that the sum of all the query results is only going to be the price of that product. I don't know the structure of your database and I don't know what sum you're trying to get, so I can't help any further until you can clarify.
  11. Your issue is that you keep overwriting the array here: $product_price = array($row["product_price"]); You should be adding the value to the array: $product_price = array(); foreach($sql as $row) { $product_price[] = $row["product_price"]; } But you can get the total straight from SQL: $get_sum = $db->prepare('SELECT SUM(product_price) AS total FROM product WHERE product_id = ?'); $get_sum->execute(array($product_id)); if($data = $get_sum->fetch(PDO::FETCH_ASSOC)) { $total = $data['total']; } Your code is vulnerable to hacking, you should research prepared statements.
  12. Loop through the rows and store them in an array: $results = array(); while($row = mysqli_fetch_assoc($result)) { $results[] = $row; } Your current code is vulnerable to hacking. You must use prepared statements.
  13. Oh, it's an iframe, I would recommend against using those. But to answer your question, set the target attribute of the links: <a target="_blank" href=""> These are the four reserved values for the target attribute: _blank: Opens new tab or window. _self: Default. Opens in current frame or window. _parent: Opens in the parent frame or window. _top: Opens in the current browser window. Using any other value will open the link in a window or frame with the specified name.
  14. There isn't a document.onload method, are you using window.onload? What do you mean by "specific intervals"? Do you have a script running periodically checking the value of screen.availaHeight? screen.availaHeight is not really that useful because the screen object gives information about the user's screen instead of the browser window. You can use window.innerHeight to get the size of the window.
  15. I haven't been able to verify that files from Google Drive can actually be used to host website resources. Some browsers may not execute files if the server did not send a Javascript MIME type header and Google Drive is most likely either sending "text/plain" or "application/octet-stream". When I try to open the file in my browser it actually loads Google's web application for viewing text files, so I can't imagine that browsers would have an easy time parsing Javascript out of that. You shouldn't be creating your own HTML elements, if you need to style something differently, use an ID or class name on a validHTML element.
  16. AJAX is restricted from cross-domain requests unless you own the server you're requesting from or you can convince the owner to grant you permission. For a server to grant you permission it has to send an Access-Control-Allow-Origin HTTP header with your domain name as a value. There's a detailed explanation here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS I tried to connect to the URL you provided but it does not work, there are issues with it, so that's probably part of the problem as well.
  17. Ingolme

    Http-equiv

    There is no default value. If you don't need the attribute then don't use it. http-equiv refers to the HTTP header that the meta tag is suggesting to the browser.
  18. If you properly indent your code, you'll find that your code keeps reloading the window before it gets to the part of the code that counts down. The offending line is window.location.reload(); function countdown(yr,m,d,hr,min){ theyear=yr;themonth=m;theday=d;thehour=hr;theminute=min; // ... var todaym=today.getMonth(); // ... if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=0){ // ... return; } else { // ... window.location.reload(); setTimeout("countdown(theyear,themonth,theday,thehour,theminute)",1000); } } Aside from that, this code looks a little more complicated than it needs to be. Since you have global variables, don't bother passing parameters to the countdown function. Then you can simplify it like this: function countdown() { // ... // ... setTimeout(countdown, 1000); } Using a string in setTimeout and setInterval is inefficient.
  19. I'm not sure if it can be done, but the solution would probably have been easier if you had the grouping data in attributes. In XML, the element name should be used to indicate the type of data and not actually contain data in itself. <rec number="1" letter="B"> <accNo>123</accNo> <accName>abc</accName> </rec> <rec number="1" letter="B"> <accNo>123</accNo> <accValue>100</accValue> </rec>
  20. Try setting the preload attribute on your audio element. (Described here: https://developer.mozilla.org/en/docs/Web/HTML/Element/audio) <audio preload id="media-video" ... > The reference indicates that if the preload attribute is not present, each browser will decide what to do on its own. Whether or not this fixes your issue, you should be doing it. It looks like browsers may ignore the attribute:
  21. What's the HTML code for your media element?
  22. It sounds like the mobile device doesn't start downloading the file until the play button is clicked.
  23. Check the canplay and canplaythrough events. You seemed to have trouble getting them to work on mobile devices, but perhaps there was something else wrong. https://developer.mozilla.org/en-US/docs/Web/Events/canplay https://developer.mozilla.org/en-US/docs/Web/Events/canplaythrough It looks like "canplay" only fires if the media is loading slower than it can be played, which is probably why it's not firing on your device. If that's the cause of the problem then canplaythrough should work. You can use both events. mediaPlayer.addEventListener("canplay", hideLoading); mediaPlayer.addEventListener("canplaythrough", hideLoading); function hideLoading() { document.getElementsByClassName("loader")[0].style.display = "none"; }
  24. I would just use the <audio> element. If you want to keep track of clicks, make the player invisible and add click events to other elements to control the player, though I'm pretty sure a lot of the more basic events are supported by mobile devices. The name "jPlayer" reminds me of an old flash-based video player. If it's what I'm thinking of, it would certainly not work on mobile devices.
×
×
  • Create New...