Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. The browser developer tools will allow you to see what selectors are affecting the style of an element.
  2. Ingolme

    user log in

    Do you have a MySQL server set up and does it have a user "root" with no password? If you're on a web host you might need to findout their SQL server address, it's not always "localhost". Simply connecting to the database won't do anything to log users in, though.
  3. It looks like you have an extra closing brace at the end of your code that shouldn't be there. If your code were indented properly it would be easy to catch that.
  4. That's one of the things you need to do to make the website responsive. I don't know how your site is coded, so I can't tell for sure if it's the only thing you need to do to fix the problem.
  5. There is no quick fix, you must apply the principles of responsive design to your HTML and CSS code.
  6. Like I mentioned earlier, you have line breaks being sent from the server. You don't really need to separate your code into multiple PHP blocks, put it all within the same <?php ?> block and make sure there are no spaces or line breaks preceding it.
  7. There are two things about location headers. 1. For all headers in general, they must be sent before any content is displayed. This portion of code is display a few line breaks, so the header won't work: {?><?php 2. The location header should have an absolute URL including "http:" and the full domain name
  8. I notice them updating their website frequently, so while they're not very communicative they do seem to listen to suggestions.
  9. I'm not part of the W3Schools staff, I just manage the forums, I have no responsibility or control over the website.
  10. You're right, I don't think anybody would refer to the algorithms used by crypt() as encryption algorithms. I'm quite sure nobody is using crypt() for encryption either, because if they did they'd find out pretty fast that they are not able to retrieve the information they just "encrypted". I see you edited your post, at first I was quite confused as to why you signed up to the W3Schools forum just to tell the world that PHP's crypt() function is not for encryption, you would have access to a lot more people by writing a note on the PHP manual's crypt() page On the W3Schools website, you can scroll to the bottom of the page and click on the "REPORT ERROR" link if you think the content of the page is incorrect.
  11. You're half right. It's a hashing function and, by extension, a one-way encryption function.
  12. Like I said earlier, use getAttribute() for comparing the src. This is working for me: <script>function hide(){ if(document.getElementById("arrow").getAttribute("src") == "arrowup.png"){ document.getElementById("arrow").src = "arrowdown.png"; document.getElementById("box").style.display = "none"; } else { document.getElementById("arrow").src= "arrowup.png"; document.getElementById("box").style.display = "block"; }}</script><img id="arrow" onclick="hide()" src="arrowdown.png" alt="Arrow"><div id="box" style="display:none;">Content</div>
  13. I think the idea was that, knowing what it's called, you could search for information about it. https://www.google.ca/?gfe_rd=cr&ei=q268VbiPJMOC8Qf1jZzoCA&gws_rd=ssl#q=URL+rewriting
  14. I can't see anything in that fragment of code that could cause it to go wrong. Have you checked for error messages in the Javascript console?
  15. I think it's probably that the src attribute contains a full path to the image rather than just the string you gave it. Perhaps try this: if(document.getElementById("image").getAttribute("src") == "arrowup.png") {
  16. Like this: switch( { case 1: case 4: // Do something break;}
  17. That's not a question, that's code. Is the code doing what you want it to? If it isn't, then what is it actually doing and what did you want it to do? Since you're treating the elements of array p like numbers, you shouldn't put them in quotation marks: p = [.95, .90, .85, .05, .10, .15]; Be sure to declare all your variables with the var keyword like this var w = 1920;var h = 1080; The indentation in your code is confusing. The else if statement should be nested at the same level as the if that preceded it. This also looks like a good place for a switch statement instead of all those if conditions. switch( { case 1: return [x*p[3],y*p[0]]; case 2: return [x*p[4],y*p[1]]; case 3: return [x*p[5],y*p[2]];} I've changed the indentation of your current code to make it more readable: function xyFinal(){ function variable(x,y){ if(b==1){ return [x*p[3],y*p[0]]; }else if(b==2){ return [x*p[4],y*p[1]]; }else if(b==3){ return [x*p[5],y*p[2]]; } } var o = variable(w,h); if(c==1){ return o; }else if(c==2){ return [w/2,o[1]]; }else if(c==3){ return [w-o[0],o[1]]; }} v=xyFinal();x=v[0];y=v[1];[x,y]; That [x,y] at the end of your code isn't really doing anything because you're not returning it or printing it.
  18. That happens because the elements have position: absolute in their style. The person who made that is not following responsive design principles. The right way to do it would be to give them percentage widths and float them to the left.
  19. Ingolme

    Center the Module

    The <center> tag was deprecated in 1999 with the advent of HTML 4.01. It's about time you updated your knowledge.
  20. Setting the max-width to 800px and the left and right margins to "auto" should give the result you're looking for.
  21. File paths are case sensitive. "Images" isn't the same as "images". Make sure you specified the path correctly.
  22. Then you need a different editor. HTML, Javascript and PHP do not work with curly quotes. There are a lot of free code editors out there. I use Notepad++.
  23. It looks like you're using curly quotes for your attribute <img src=“Images/otters.png” alt=“Photograph of a sea otter floating in water” /> Perhaps some browsers are forgiving and interpret them as standard quotation marks, but other browsers consider the quotes to be part of the file name.
  24. cURL can get the HTTP headers and HTML code that the website provides, but it won't show you the actual page, because that's what a browser is for.
×
×
  • Create New...