Jump to content

obsidian

Staff Alumni
  • Posts

    3,202
  • Joined

  • Last visited

About obsidian

  • Birthday 02/15/1980

Contact Methods

  • AIM
    hensonggarth
  • MSN
    hensong2007@hotmail.com
  • Website URL
    http://www.guahanweb.com

Profile Information

  • Gender
    Male
  • Location
    Seattle, WA

obsidian's Achievements

Member

Member (2/5)

0

Reputation

  1. Base href can be very useful when working in the confines of a larger scale system (such as a CMS) when different environments are needed. For instance, in a preview or dev environment, being able to set the base href to a location where all scratch versions of pages (and everything else, for that matter) reside can be extremely useful. Additionally, if you set all the links in an application to the web root by using absolute paths, you run into the problem of that application always having to be installed at the web root. Setting the base href can be very useful to overcome this challenge by allowing the base href to be a configuration variable so that all links within a given code base will reference the same base. So, as you can see, there are definitely viable reasons to use the tag, although it is definitely not always the best solution for path fixes, especially when using in-page anchors.
  2. Try something like this, replacing your variables or values where appropriate: <?php $sql = mysql_query("SELECT COUNT(post_id) FROM posts WHERE DATE(post_time) = CURDATE() AND posted_by = $user_id"); if (mysql_num_rows($sql) == 0) { // User has not posted today, so show the link } ?>
  3. Also, please don't confuse Java with JavaScript. Java, as was just mentioned, is a fully featured programming language while JavaScript in web is simply a client side scripting language to add some dynamic elements to the page. JavaScript would be much more comparable to flash than Java.
  4. The difference between Dreamweaver and other IDEs, in my opinion, is that Dreamweaver is geared towards the common user while other IDEs expect that you will set up your own local/remote information - whether that be SFTP or CSV/SVN. As mentioned previously, nearly every IDE offers the support to do what you are mentioning, but you have to set it up manually to your own specifications. I would add NetBeans as another free IDE to look at as well.
  5. Correct, although, as with PHP, that definition is setting a default value for the optional parameter. You can provide a dictionary as a parameter to be assigned to the member variable items instead of letting an empty one be assigned, if you choose.
  6. First, self is the referencing term for the current object, just like $this in PHP. What is odd is that, in Python, you have to always define your member variables as passing the object itself as the first argument (which is done by default); hence the appearance of the "self" in the __init()__ function. The self.items = items line actually assigns the passed parameter of items to an instance variable within the object itself. And, no, the return is not specifically needed.
  7. Yes and no. To solely rely on JavaScript is a bad idea for the reasons provided; however, many users will prefer to be warned of faulty data before they have to leave the page, so using some JavaScript validation in conjunction with PHP validation on the receiving end is definitely a good idea. Now, in answer to the original post, I don't see where you are actually calling the validation on submit. You have the validate_form and validate_email functions defined, but you never attach the validation to the form submit event. The easiest way to do this is to call your function in the onsubmit attribute of the form tag. Remember that if you return FALSE from an onsubmit, the form will not process: <script type="text/javascript"> function my_simple_validation (field) { if (field.value == '') { alert('You must fill in required fields!'); return false; // This is where you tell the form not to submit } return true; // if we pass, submit the form } </script> <form name="my_form" action="process.php" method="post" onsubmit="return my_simple_validation(this.email);"> ... Obviously, this is generic code, but it should give you the principles needed. Good luck!
  8. Definitely one of the best references. Keep in mind, though, that sometimes trapping the keystroke is often not enough. You may need to set yourself up with a listener on a specific object so that the event is only fired in certain situations.
  9. Yes, the square braces with the nested 'i' you are attempting to put in your text is the BBCode for italic, so it gets parsed out. So, with the start3 sub i, is your problem fixed, or do you still have a question?
  10. Well, first of all, to hide them, you simply would attach a class with the CSS attribute of "display: none" ... then, when there is a focus given to the last textarea, you can display the next one in line. Something like this should get you in the right direction: First, create our textboxes and generate helpful IDs to use: <?php for ($i = 1; $i <= 50; $i++) { echo "<textarea name=\"mybox[]\" cols=\"60\" rows=\"8\" id=\"textbox-{$i}\" onfocus=\"showNextBox({$i});\""; echo ($i > 5) ? ' class="hidden"' : ' class="shown"'; echo "></textarea>\n"; } ?> Then, the supporting CSS to hide and show the boxes: .hidden { display: none; } .shown { display: block; } Finally, we write our JavaScript showNextBox() function to support the code above: function showNextBox(i) { var id = 'textbox-' + (i + 1); // Next incremental box var el = document.getElementById(id); el.className = 'shown'; } Hope this helps.
  11. I personally think it is well worth learning. I've done the basic curve for learning LISP myself, and it definitely helps with breaking down the larger problems into manageable chunks. The implementation of LISP is a bit confusing at first, but I have been rather impressed with its speed and ease of learning. I also like the way they encourage you to learn proper use of the lambda notation: (every #'(lambda (n) (not (oddp n))) '(2 4 6 8 10)) Very cool stuff
  12. This may be old news to some, but I have recently (in the last month) been introduced to the world of the Google App Engine. I had looked into Python a little in the past, but with this amazing tool, I have given it a second glance, and I have to say that I'm rather impressed with the power it has - even for web applications. I have always wanted to write a little tactics style game using AJAX and JavaScript animation for fun, and in a matter of just a couple days, I've been able to write Python classes to support the mapping and basic unit mechanisms and movement. Has anyone else delved into the world of Python for web (with or without Google App Engine) and found any good resources? It seems like this might be a good language to add to my skill set, and it has proven extremely easy to learn thus far. I'm interested to hear any input or discoveries from others in the community as well.
  13. I second that. Lilypond is a wonderful app for any musician.
  14. You really can't find a bounce rate unless you know exactly how many pages came from each individual user. Your number of page hits really doesn't apply to the bounce rate average, since "bounce" is actually like a boolean for each user. So, if you have hits per user, you could calculate it if you're careful.
  15. I don't think that is possible. If you use Google Analytics, you'll notice that it is simply an inclusion and call to a Google API. If the user has JavaScript turned off, the call never gets made to the API. If, on the other hand, you are referring to the browser capabilities tab labeled Java Support, it is just that - not JavaScript.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.