Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. I don't see an element with id "traceMsg" in your code. That HTML element needs to exist on the page. You also should use += if you don't want to overwrite previous messages. document.getElementById("traceMsg").innerHTML += oneTraceLine
  2. What code did you use for adding a transition to the font color?
  3. The easiest alternative is innerHTML, but there are other methods using the DOM.
  4. The query has errors in it. You are supposed to have literal question marks which act as placeholders for data. Don't just copy code without knowing what it does. Read this article about prepared statements to understand what the example code I gave you does: http://php.net/manual/en/pdo.prepared-statements.php
  5. You should not use document.write() because when called after the initial page load it will erase everything that is currently on the page before writing its output.
  6. This code is very insecure. MD5 is very easy to crack these days and the mysql_ library is deprecated. See the severe warnings on the PHP manual. On MD5 hashing: http://php.net/md5 On the mysql extension: http://php.net/mysql_query If you don't heed these warnings your site will be hacked. With that out of the way, if the password is coming from a file then hash the value that came out of the file $pdo = new PDO( /* Database connection parameters */ ); $file = file('userData.txt'); $query = $pdo->prepare('INSERT into tbl_User(ID, FName, LName, Email, Password) values (?, ?, ?, ?, ?)'); foreach($file as $row) { $milestone = explode(';',$row); $milestone[4] = password_hash($milestone[4], PASSWORD_DEFAULT); $query->execute($milestone); }
  7. The curly braces are not required. The real problem seems to be that the server is not running the PHP code which has nothing to do with PHP syntax.
  8. You can learn about the % operator here: http://www.w3schools.com/jsref/jsref_operators.asp Math.floor() rounds decimal numbers down. http://www.w3schools.com/jsref/jsref_floor.asp Dealing with dates is complicated, which is why most programming languages provide date functions or objects. Javascript has the Date() object. Perhaps you should find the Stellarium documentation to see if it has an alternative. If it doesn't then you will have to build your own date object.
  9. It looks like your server is not executing PHP at all. Did you give the file a .php extension and is it running on a server with PHP installed?
  10. This is my approach to the problem: // Parameters var hours = 0 var minutes = 50 var seconds = 7 var duration = 24 * 60 * 60; // Algorithm var start = hours * 3600 + minutes * 60 + seconds; var end = start + duration; var h, m, s; for(var time = start; time < end; time++) { h = Math.floor(time / 3600); m = Math.floor(time / 60) % 60; s = time % 60; core.output("hours " + h + " minutes " + m +" seconds " + s ); core.wait(.4); }
  11. If you put seconds++ before the if() statement it won't get to 60. The reason minutes never gets above 1 is that every time 'seconds' reaches 60 it resets the minutes to zero, then adds one.
  12. The main question is when do you want the loop to stop? Does it stop at 23:59:59 or does it continue until 24 hours later? Does this counter cycle hours or is 25 a valid value? There must be some other goal for this other than to write known values into a text file, because there is no practical reason to do that.
  13. Why are you using for loops? That's going to output everything immediately all at the same time. I need to know more about your ultimate goal before I can provide a real solution.
  14. You can't use just MS Access, you need to choose a programming language.
  15. Stack Overflow has strict question policies because if you don't ask the right question people can't give you a correct answer. I deal with enough malformed questions on this forum to know that. An important part of getting the information you want is knowing how to ask questions.
  16. Just use a CSS selector that can target those images ( table img would probably work) and then set their vertical-align property to "middle".
  17. If the animation is a GIF file you can just use absolute positioning for it. You probably should use a <div> instead of <p> and then have <p> elements inside just for text. HTML <div class="peeking"> <p>Content here</div> <img class="corner" src="animation.gif"> </div> CSS .peeking { background-color: #EAEAEA; width: 800px; height: 800px; position: relative; /* This is important */ } .peeking img { position: absolute; top: 0; width: 80px; height: auto; right: -80px; } If the animation is not a GIF, we need to know exactly how you plan to make the animation.
  18. In XHTML transitional the browser runs in "almost standards" mode. This mode behave almost exactly like standards compliant mode, except that images inside table cells have the space below them stripped. You can correct this with CSS by setting the image's vertical-align property to "middle". Your page takes a really long time to load. If you want your page to load faster you're going to have to resize all those image files in an image editor to make them as small as they display on the page. You should consider fixing all validation errors given by the W3C validator: https://validator.w3.org/
  19. A page break is only a concept in printed documents. You can use CSS page-break-after You'll need to wrap the phone numbers in an HTML element and apply the CSS rule to that.
  20. First I need to know what the error messages say. Error messages contain vital information required to solve the problem. If I were you I would remove that file you just uploaded and replace it with something that has your database login information removed. At a first look these things in your script need to be fixed: session_start() must be before any HTML or echo statements on the page. session_register() is deprecated. Just remove all those lines and just do normal $_SESSION assignments. mysql_error() is deprecated and won't do anything since you're using mysqli in the rest of your code. Your SQL query needs to be updated to select all the fields you want to store. The data you're looking for is not in the $_REQUEST array, it's in the $row array which contains the information that was loaded from the database. It is preferable to not use $_REQUEST. Use $_POST or $_GET depending on where your data is coming from.
  21. No, the access control header is not necessary if the XML file is on the same server as the page that is requesting it. All you need to do is have both files on a server. Download XAMPP or something similar and set up a test server on your own computer.
  22. If you're hosted on GoDaddy then the server is not the issue, it's some content on your websites.
  23. I would create a folder in the filesystem for each user and store the path to that folder in the database. It would be useful to base the folder name on the user's name, but stripping out any characters that aren't letters numbers and hyphens and making the name lowercase.
  24. I don't have time right now, but somebody would have to analyze the content of every page on your site to find anything potentially harmful.
×
×
  • Create New...