Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. What is happening and what did you expect it to do? Did you get any error messages? Have you printed the variables to see if they contain the values you want them to? If you're using the header() to redirect you're risking the session variables not getting saved. To guarantee the session variables being saved, call session_write_close() before redirecting.
  2. Ingolme

    w3-opacity problem

    Opacity is an inherited property, the opacity of an element is relative to the opacity of its parent. You should not set the opacity of the parent, instead use an rgba color for the background and use transparent pngs for any background images.
  3. You should set up your site to use IE's modern rendering engine. Add this meta tag to your page: <meta http-equiv="X-UA-Compatible" content="IE=edge"> All websites today are using that to make sure IE supports modern technologies.
  4. I don't have any information about your data source.
  5. "posturl" is never given a value.
  6. AJAX doesn't read XML data, it just downloads the XML document from the server. XML is read using the XML DOM. JSON is just a Javascript object (JavaScript Object Notation), reading it is as simple as reading the properties of the Javascript object it returns. Learn about objects here: https://www.w3schools.com/js/js_objects.asp Sometimes JSON is given as a string, you can use JSON.parse() to turn a string into an object.
  7. The code seems to be literally printing out the content of the email is sent. This is causing the headers to be sent too early. All this content should not be printed: 2017-03-05 05:15:33 CLIENT -> SERVER: EHLO pwebk.com 2017-03-05 05:15:33 CLIENT -> SERVER: AUTH LOGIN 2017-03-05 05:15:33 CLIENT -> SERVER: aW5mb0Bwd2Viay5jb20= 2017-03-05 05:15:33 CLIENT -> SERVER: RXN0aGVyNzIqMDcyMA== 2017-03-05 05:15:33 CLIENT -> SERVER: MAIL FROM: 2017-03-05 05:15:33 CLIENT -> SERVER: RCPT TO: 2017-03-05 05:15:33 CLIENT -> SERVER: DATA 2017-03-05 05:15:33 CLIENT -> SERVER: Date: Sat, 4 Mar 2017 23:15:32 -0600 2017-03-05 05:15:33 CLIENT -> SERVER: To: Patwan Website Solutions 2017-03-05 05:15:33 CLIENT -> SERVER: From: Martin njoguman 2017-03-05 05:15:33 CLIENT -> SERVER: Reply-To: Martin njoguman 2017-03-05 05:15:33 CLIENT -> SERVER: Subject: Contact Form 2017-03-05 05:15:33 CLIENT -> SERVER: Message-ID: <7bb49a9bd9cf546606a19fd015414116@pwebk.com> 2017-03-05 05:15:33 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.16 (https://github.com/PHPMailer/PHPMailer) 2017-03-05 05:15:33 CLIENT -> SERVER: MIME-Version: 1.0 2017-03-05 05:15:33 CLIENT -> SERVER: Content-Type: text/html; charset=iso-8859-1 2017-03-05 05:15:33 CLIENT -> SERVER: 2017-03-05 05:15:33 CLIENT -> SERVER: Name: Martin njoguman Phone: 123456 Email: mndungu739@gmail.com Subject: Website Design , 2017-03-05 05:15:33 CLIENT -> SERVER: Branding Message: Deqagst 2017-03-05 05:15:33 CLIENT -> SERVER: 2017-03-05 05:15:33 CLIENT -> SERVER: . 2017-03-05 05:15:33 CLIENT -> SERVER: QUIT You have to find out what's printing that and stop it.
  8. No, it's not even consistent among different browsers. A technique I've done to customize the dropdown arrow is to set the appearance to "none" and then set a background image as the arrow. select { -webkit-appearance: none; -moz-appearance: none; appearance: none; border: 1px solid #CCC; border-radius: 4px; padding-right: 32px; background: url(arrow.png) right no-repeat; } There are other possible solutions. You could use the ::after pseudo-element to make a CSS triangle.
  9. You're trying to send a header here: header('Location:thank_you.php'); but content has already been output so it's not allowed. The error message tells you exactly where the output started: All of the content you're showing right before the warning is what's giving you that warning.
  10. Your problem is that you're specifically telling it to show an error when the input is not "1", "2" or "3". That also happens when input is "exit"
  11. If you just want to write to the console then console.log() is all you need. innerHTML is just for putting content on the page. You should use curly braces { } on all of your code blocks and properly indent them, otherwise your code is hard to read and is more likely to have mistakes since it's not clear where the blocks of code end. For proper indentation: Every opening brace must be followed by a line break Closing braces must be the first printable character on their line Closing braces must be at the same level of indentation as the opening brace that it belongs to Content between braces is indented one level further You don't need to use the === operator for comparison unless you really care that the type of data is a string.
  12. The reason document.write() is not working in your code is because you've capitalized "Document". Javascript is case sensitive, "a" and "A" are two different variables. Your Javascript console should have shown an error indicating that "Document" is undefined. You're still comparing one to null on this line: if (one === null) {console.warn ("You need to first enter a String")} Could you please describe what each symbol means in the following line of your code? If you don't understand what it's doing then you're not writing code properly: for(i = 0; i<res.one; i++) Please read about some of the following properties and methods: element.innerHTML: https://www.w3schools.com/jsref/prop_html_innerhtml.asp document.getElementById(): https://www.w3schools.com/jsref/met_document_getelementbyid.asp string.split(): https://www.w3schools.com/jsref/jsref_split.asp array.join(): https://www.w3schools.com/jsref/jsref_join.asp
  13. Every string has a length property. You can loop through the array check the length of the string and append something to it based on the length. Once you're done, you can turn the array back into a string using the join() method.
  14. PHP has an iteration loop called foreach(). You can go through elements in any kind of array as in the following demonstration. <?php foreach($array as $index=> $item) { ?> <tr> <?php foreach($item as $key => $value) { ?> <td><?php echo $value; ?></td> <?php } ?> </tr> <?php } ?>
  15. Facebook uses the <meta property="og:title"> tag to determine the title of the page. If that's not available it will probably check the <title> or <h1> tags. Since I don't know the code on your page I can't tell you exactly what the problem is.
  16. Before trying to understand how it works in Javascript you should learn what it is in a properly structured language first. I'm finding plenty of explanations about it with a simple search https://www.google.ca/search?q=oop+polymorphism+explained Javascript is very peculiar and does not implement polymorphism very well. If you don't know what polymorphism is in a better language, you'll never understand what it is in Javascript.
  17. The reason why columns all have different heights is because they only expand as far as the content within them. The "columns" are not actually columns, they're just boxes that happen to be next to each other. None of the boxes are aware that the other boxes exist, so they can't update their height based on what's next to them. The easiest way to solve that with just CSS is to set a fixed height for the boxes. but if any of the content exceeds that height it will overflow. If you make the height very large to prevent that then you'll have a lot of empty unused space on the page. A second solution is use use display: table-cell, wrapped in an element with display: table-row and a parent with display: table. This is effective, but you should use media queries to set the display back to block for smaller screens. Tables have never worked well on mobile devices. A more modern approach is to use flexbox. Internet Explorer has only recently supported it, so you'll have to keep that in mind if you care about supporting Internet Explorer. Aside from that, I personally have disagreements with how the flexbox specification is built. The most basic box model is broken by the flexbox module and you have to wrestle with it to get it to behave responsively. By detauls it would rather show a horizontal scroll bar than allow the content within it to be rearranged to fit a small screen. You could just get Javascript to find the largest of the columns and update the height of the others accordingly. Overall, equal height columns are really complicated to work with in CSS, which is why practically nobody uses them.
  18. If the browser doesn't natively do it, there's no way to protect the property. I would operate under the assumption that nobody's messing with window properties. If it's your own code that's overriding the property then fix it. If you're dealing with somebody else's code that does that, you'll have to either rewrite it or stop using it. I cannot imagine a situation where any developer would override these properties, if they're doing so, their code is not worth using.
  19. You have a stray "for" in the line preceding the prompt. You should press F12 to open the console. it will point out Javascript errors like this one.
  20. Doing it programmatically would be hard. If you know beforehand how many you want in each column you can have four columns with the items placed in each one: <div class="col-sm-3"> Column 1 <div> Item 1 </div> <div> Item 2 </div> </div> <div class="col-sm-3"> Column 2 <div> Item 1 </div> <div> Item 2 </div> </div> <div class="col-sm-3"> Column 3 <div> Item 1 </div> <div> Item 2 </div> </div> <div class="col-sm-3"> Column 4 <div> Item 1 </div> <div> Item 2 </div> </div> To do it programmatically, in your loop you can divide the total items by 4, every time that amount of items has been placed in a column, create a new column. There's also a Javascript library called Masonry that arranges pages like that quickly and easily.
  21. I'm not noticing that issue. I'm able to view the page in IE8. Which HTTP error are you getting? Even if there was an issue, it is not worth the effort to support IE8, nobody uses it. I only go as far back as supporting IE9 on my sites and that's already a stretch.
  22. There can be no more than 9 turns on the board, if nobody has won and less than 9 turns have passed then the game is still in progress. INCOMPLETE would be a constant meaning the same thing as -2 did in your previous code. There's no need to test for empty, since having three empty slots in a row doesn't end the game.
  23. The overlap is caused by the negative margin.
  24. Real programming languages are very complicated. Languages like HTML, CSS and even Javascript are simple in comparison. Oracle has an official tutorial for Java here: https://docs.oracle.com/javase/tutorial/
  25. Ingolme

    Is this safe?

    The getimagesize() function right in your code will tell you the size of the uploaded image. Hackers can put anything they want in an image, but since the image is not an executable file it won't do anything. Make sure that the uploaded file name has a known file extension. As long as the extension is of an image type, programs will not execute the file.
×
×
  • Create New...