Jump to content

Don E

Members
  • Posts

    996
  • Joined

  • Last visited

Everything posted by Don E

  1. Try giving the left values like the following: document.getElementById("nav").style.left = -251 + "px"; document.getElementById("nodes").style.left = 0 + "px"; document.getElementById("nodes").style.left = 251 + "px"; document.getElementById("nav").style.left = 0 + "px"; Also for the if conditions, you can try just checking the number itself without double quotes(string), like: else if (navLeft == -251)
  2. Don E

    coding problem

    Looks like the if statement is missing closing brace: }
  3. Remove the following in red and see if you still get the error:<?php//code to register student<form method='POST' action='<?php echo $_SERVER['PHP_SELF']; ?>'><p>Name <input name="name" /></p><p>E-mail <input name="email" /></p><button type="submit">Save</button></form> <?phpif (count($_POST) > 0){insert($_POST, 'students');ob_clean();header('LOCATION: '.ROOT.'/students/list.php');}?> ?>
  4. When the window loads, you have to set your global variables to what you want them to be set to, so that they can be accessible to functions etc. So for example: <script type="text/javascript">var mun; window.onload = function() { mun = document.getElementById("mun"); } function muncul() { mun.style.display = "block"; }</script>
  5. Everything seems to be okay. Is there more to the code than just that? What exactly is on line 5?
  6. Try puting a semicolon after: echo $_SERVER['PHP_SELF'];
  7. I can try to explain a way to what you're attempting to do with 'click' event and then you can try to attempt it so that you can get an idea. Here's a scenario/hint: A light switch(the click). A light switch when on(true), illuminates a room(box grows), when off(false), no light(box ungrows).
  8. Don E

    DOM

    Welcome. I got the same warnings too when I tried www.w3schools.com. I am not entirely sure if it is because of unclosed anchors, but it may be so. I just ran their site through w3 validator and got some warnings/errors. If you try http:www.w3.org ( $DOM->loadHTMLFile('http://www.w3.org'); ) though, you will get no warnings and get the results you're looking for.
  9. Don E

    DOM

    I think the load method is for xml files. For html pages, try: $DOM->loadHTMLFile(); You don't need the file_get_contents() function. Just enter the address in the loadHTMLFile function as a string. ie: $DOM->loadHTMLFile('http://www.w3schools.com');
  10. I added a few lines of code. Try re-running the above again and see if that's what you were referring to.
  11. Hey Dark, Based on your post, I put together some code real quick demonstrating what I think you're referring to. Just copy it to a text editor and save. Tested in Chrome, Firebox, and Safari. <!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Box Grow</title><style type="text/css">#box { width: 100px; height: 100px; margin: 0 auto; background-color: lightblue;}</style><script type="text/javascript">var box;var speed = 5;var timer;window.onload = function(){ box = document.getElementById('box'); box.addEventListener('mouseover', setGrow, false); box.addEventListener('mouseout', setUngrow, false); } function setGrow(){ clearInterval(timer); if(box.offsetHeight == 100) { timer = setInterval(grow, 10); } else if(box.offsetHeight > 100) { timer = setInterval(grow, 10); } } function setUngrow(){ clearInterval(timer); if(box.offsetHeight > 100) { timer = setInterval(unGrow, 10); } } function grow(){ box.style.height = parseInt(box.offsetHeight + speed) + "px" ; box.style.width = parseInt(box.offsetWidth + speed) + "px";} function unGrow(){ box.style.height = parseInt(box.offsetHeight - speed) + "px"; box.style.width = parseInt(box.offsetWidth - speed) + "px"; if(box.offsetHeight <= 100 && box.offsetWidth <= 100 ) { clearInterval(timer); }}</script> </head><body> <div id="box"></div> </body></html> I'm sure there are other ways to demonstrate the above but hopefully it gives you an idea.
  12. Are you doing this all on your home server or on an actual host server? If you're working on your home server, make sure you "restart" your server after whenever updating the php.ini file.
  13. Probably be a good idea to contact your host provider if anything.
  14. When it comes to the above, I use this site: http://www.unitconversion.org/unit_converter/data-storage.html Very useful.
  15. var p just contains the value to document.getElementById('pageNumber').value, not a reference to it. That's why when you did p = 1, it doesn't get populated on the webpage.
  16. Check out this link(post): http://w3schools.invisionzone.com/index.php?showtopic=44106&view=findpost&p=245750 as well as the posts after regarding sessions and the error you're experiencing.
  17. Hey everyone, Here today in the United States it's Thanksgiving and I thought I would take a moment to give thanks to be able to have such a wonderful place to go to when it comes to webdesign/development. Big thanks goes especially to the moderators. Once again, thank you all who make this forum possible(regular members as well)!
  18. You can use the rename() function to rename a file. As for adding to a file name, don't think your example would work. This is probably the proper way: $_FILES['file']['name'] . 1935; but this is what it's going to look like: mypicture.jpg1935 for example.
  19. jemz, Sometime ago I created the same thing. This is how it works or similar to: When you click on the link, you start a few things going on. First you will notice the "loader" bar( the green box) appear at the top center of the page. This is probably a gif image using CSS positioning to place it there and become visible by using display: block for example. A settimeout will cause this to be displayed for about a second or two. The settimeout's function parameter then calls the function that either 'sets up' the login box to appear or the actual function itself. Most likely a setup type function because with this function you set certain CSS properties of the login box in place for it to appear along with having the partially dimmed background element appear behind the login-box giving the impression that everything in the background is disabled(ie, by setting the z-index of the dimmed and login-box elements to their appropriate values) and the only thing you can do is type in the login-box. The last line in the function you have a setinterval where it's function parameter will be set to repeatedly call another function that makes the login-box fade in by it's CSS opacity property. Hopefully this gives you an idea.
  20. Because most computers today have Microsoft Windows. Windows comes with Internet Explorer installed and no other browser until the user installs another browser but most average users don't 'think' to do that because they are accustomed to Internet Explorer and really don't know or think there is a difference in using another browser. The average internet user does not know that browsers render differently compared to other browsers. Most internet users are not aware of this and/or don't care and basically just want what a website is suppose to give them when visiting; that's all that really matters to an average internet user. Like Facebook, as long as they can see their friends comments, likes, read messages etc, that's all that matters regardless of the browser they are using.I often tell people I know personally to use other browsers and they look at me like "what's the difference?" Some install other browsers but I noticed that many still use IE regardless because of being accustomed to using IE when first getting their computer since it had IE installed when getting their computer.
  21. Hey Gong, Check out this http://w3schools.invisionzone.com/index.php?showtopic=42187 It may give you some insight on your question.
  22. DW was basically created for people who have little or no coding skills, but this doesn't mean a skilled person can not use it. Most skilled designers/developers use/work only in the 'Code' view. There it's basically a text editor where you can do anything you want just like any other editor basically. So as for DW being a good tool or not, it depends on the user because DW offers you many ways to do things. So for example, if a user is not too skilled, they most likely are going to work in the 'Design' view. There it's basically like a wysiwyg and DW will automatically generate the source code for you. The problem with this though is that some of the generated code can be outdated or considered bad practice code, but that may depend on the version you're using. If an older version, chances are it will generate outdated or bad practice code, but if it's a new version, most likely it will generate code that applies to today's standards. I like DW for the way it organizes my files/sites, built in FTP, and proven to be very stable. Whenever I use it, I only work in the 'Code' view side of town. I wish that Adobe would make a 'lite' version of it where it's basically like any text editor without the wysisyg part of the program and all those extra plugins it has etc.But in the end.. niche said it best: "do it yourself. You'll be glad you did."
  23. JSG,Lets say a text file looks like this:Hello My name is BobWhat's your lastname?What's your favorite color?To change 'Bob' to 'Tom', I did this: <?php $lines = file('testfile.txt'); $file = "testfile.txt"; $words = explode(' ', $lines[0]); $words[4] = 'Tom'; $lines[0] = implode(' ', $words); file_put_contents($file, $lines);?> This is what the file looks after:Hello My name is TomWhat's your lastname?What's your favorite color?No new line after Tom. When adding this: $words[4] = 'Tom' . "\n"; still get the same results. Having implode("\n", $lines); right before file_put_contents doesn't seem to do the trick either. Thanks.
  24. Exactly what Ingolme mean't.
  25. Don E

    ZendCon

    Hey JSG, Were you a featured speaker? Also, is ZendCon always in Santa Clara? Thanks.
×
×
  • Create New...