Jump to content

thescientist

Moderator
  • Posts

    8,682
  • Joined

  • Last visited

Everything posted by thescientist

  1. looks everyone here just applied for the job for you.
  2. As JSG has pointed out, that is simply not true. It is up to the developer to use the tools at his disposal to build and solid architecture and foundation for their application. I write interactive television applications all day and they are written in JS. Our applications span very large networks and while we don't necessarily have to worry about supporting browsers, code maintainability is an every present influence on our work. We rely on following accepted and useful design patterns as well as unit testing, combined with build tools (Maven/Ant) and VCS (SVN/Git). I have built libraries and API's in JS for our clients to use with their other applications. I like to find some of the best influences of classical programming and mesh them with a lot of the power that Javascript offers. Everyday I am learning something new and my co-workers and I are always finding better ways to write our code. I assure that Javascript is definitely capable of supporting a large application and can still be maintainable and also easy for onboarding new developers. As with any software project, it really is how you start it. I'm sure it's just as easy to have a Java application blow up in your face just as easily if you don't plan well.
  3. The PHP page could do it itself, or you could have Javascript on the page update the counter. Either way, you need some persistant form of storage, either a file, or a DB. That requires a server-side language, regardless.
  4. Upload your file to a host that supports PHP, or install Apache/PHP locally or IIS/PHP locally or just get an AMP stack; i.e. WAMP. Then either put your files in the www or htdocs folder, start Apache, and view the files over localhost (if local). Most of this basic information is available right in the tutorials.http://www.w3schools...p/php_intro.asp
  5. are you asking how to change the incrementation to be sequential instead of random? Also, why don't you just create the array's with value's already inside them?i.e.var link = ['imagepath1.jpg', 'imagepath2.jpg', 'etc', 'etc']; The simple solution would something like this. i += 1; But you are going to need to have actual next and previous functions to increment/decrement the index (since . You should be able to find plenty of javascript slideshow examples online that will give you a basic idea of how to do this. Also, I would advise against using document.write
  6. good point Ingolme. Maybe it depends on the browser then. Anyway, here's the updated code. var lname = ''; lname = prompt("what is your last name?","");lname = lname.charAt(0).toUpperCase() + lname.substr(1); alert("Your last name is " + lname); http://jsfiddle.net/f95VL/
  7. you can always start at the sourcehttp://us3.php.net/oop
  8. there must be something else in your code then (or there are errors you aren't checking for), because that example works.http://jsfiddle.net/ujpPB/
  9. read the documentation. You will see that those functions have a return value, and that is what you are assigning to lname. Consider something like this: var lname = ''; lname = prompt("what is your last name?","");lname = lname[0].toUpperCase() + lname.substr(1); alert("Your last name is " + lname);
  10. not in the least. MBP's are pretty powerful, and have the advantage of being portable, which allows me to work from home, or anywhere for that matter.
  11. I work with a MacBook Pro, running OSX Snow Leopard. (and external monitor at work) I work with Eclipse for work projects, and Netbeans for personal projects. I use VirtualBox to run Windows (XP/7, IE7,8,9) for when the need arises.
  12. Like JSG said... set $catID ONCE and then use it. You still have stuff like this in your code. if(isset($catID)){ $query = "SELECT * FROM shop_items WHERE FK_catID = " . $_GET['cat_id'];}else { $query = "SELECT * FROM shop_items";}$result = mysql_query($query)or die(mysql_error()); He said to check for the value and use $catID accordingly if($catID != 0){ $query = "SELECT * FROM shop_items WHERE FK_catID = " . $catID;}else { $query = "SELECT * FROM shop_items";}$result = mysql_query($query)or die(mysql_error()); just use $catID. I would have figured by now you would understand the undefined index error, because the cause has and solution been the same everytime.
  13. I figured as much. to that I will simply reply... if you don't what that means, then say so. All modern browsers have an error console, and support the console.log method. simple googles searches will yield some information on how to open the error console in your particular browser. then add logging statements to your code to track its execution flow and look for errors.
  14. I'm pretty sure we've gone over this before, but's let do it one more time.... $catID = $_GET['cat_id']; //don't do this. that's why you use isset. you will always get an error here if cat_id is not in $_GET//if($_GET['cat_id'] == "")//why aren't you using cat_id if it's provided? this all looks backwards. you should use cat_id if it's set, else you shouldn'tif(isset($_GET['cat_id'])){ $query = "SELECT * FROM shop_items"; $result = mysql_query($query)or die(mysql_error());}else { $query = "SELECT * FROM shop_items WHERE FK_catID = $catID"; $result = mysql_query($query)or die(mysql_error());} so to break it down again, you almost had it here but you're still doing it backwards. I'm pretty sure this what I've suggested to you in the past if(isset($_GET['cat_id'])){ $query = "SELECT * FROM shop_items WHERE FK_catID = " . $_GET['cat_id'];}else { $query = "SELECT * FROM shop_items";}$result = mysql_query($query)or die(mysql_error());
  15. are you checking for errors? have you tried any debugging to see what code gets executed, and what doesn't? i.e. at what point the code stops.
  16. So I assume you already have a business plan then, and the website is just acting as the marketing/sales strategy? Just to be clear, I'm not trying to say this isn't legitimate, but any business opportunity should certainly be vetted publicly for the benefit of all those interested in participating.
  17. It sounds like using a server-side include (like PHP) or AJAX might be more practical ways of being able to inject content straight into a page with templated markup already made.
  18. thescientist

    Styling Forms

    it's not purism, it's semantics. also, you need more markup to display a table.
  19. I'm a little confused myself. Are you saying you believe there is more to add to the tutorials, are you just looking for guidance from the members? If the later, I believe niche has summed it up well the past times.
  20. link? What browser are you using?
  21. thescientist

    LOGIN AJAX

    I don't get the problem either. You have the code (if/else), you know what you want to output. What exactly are you asking for help with?
  22. have you read any of the tutorials?http://www.w3schools.com/ajax/default.asp
  23. You would probably have to create your own mapping to do that, i.e. $month = 'january';$frenchMonthMapper = array( 'january' => 'janvier', 'february' => 'fevrier', ... 'december' => 'decembre'); echo $frenchMonthMapper[$month];
×
×
  • Create New...