Jump to content

monkeysaurus

Member
  • Posts

    104
  • Joined

  • Last visited

Everything posted by monkeysaurus

  1. Now, this is just an observation, but... In the code above, each of your echo statements reads "Handling Event1". You have changed that in the actual code? What error message are you getting?
  2. Feck, I'm in the same position, LW. It's been so long since I worked without jQuery, I'm not sure what's going on here. I suspect, though I could be wrong, that you might be running into cross browser difficulties. Do you have the page online anywhere where we could take a look at it? Oh, and Flex? Are you having a giraffe?
  3. No problem. Looking at your original example, a couple of things come to mind. Try / catch loops, although useful, are pretty slow in PHP. Although they're a really useful feature, it's much more common in the real world (in my experience) to use conditional (if/else) logic to catch errors. Also, in your example, '$e' would be an instance of the error object, which has the method getMessage(). A little bit like how $fido is an instance of the dog object, and has the method bark().
  4. The -> symbol is used to access fields and methods in object oriented PHP. Consider the following code (you might want to download it and try it yourself): <?php class Dog{ private $name = ''; public function __construct($name) { $this->name=$name; } public function getName(){ return $this->name; } public function bark(){ return 'Woof Woof!'; } } $fido = new Dog('Fido'); echo $fido->bark(); // outputs Woof Woof! echo "My dog's name is ".$fido->getName(); // My dog's name is Fido ?> By the way, PHP only gained decent OO features with version 5, which thankfully, is becoming more common now. Version 5.3 and the upcoming version 6 promise even better OO support. For a good primer on OOP in PHP, check out these videos: http://www.killerphp.com/tutorials/object-oriented-php/ Hope that makes sense. Good luck with job-hunting, and please ask if you have any more questions.
  5. There's no Ajax without javascript. Death to obtrusive javascript mixed in with HTML? Couldn't agree more.
  6. Just had a bit of a play with this one - here's my solution: http://johnmccollum.co.uk/datepicker/ Bear in mind that the datepicker can be skinned to whatever colour scheme your website uses. Also, I used British date formatting because...I'm British.
  7. There's no ajax here, since the browser won't be talking to the server inbetween page requests. This can, and should be handled with pure javascript. If you're not using a framework (pure javascript), you could use the onchange event rather than using the onClick event. My preferred solution would be to use the jQuery UI datepicker; it allows you to easily specify a callback function when a date is selected. In this case, the callback function would figure out the new date and update field 'B' for you. You can check out the Datepicker here.
  8. FYI, it doesn't display correctly in Chrome or Opera either. Damn all those standards compliant browsers! If I were you, I'd rethink my approach. You'll be fighting the tide otherwise.
  9. The star is just a short hand way of way of selecting every element on the page and applying a margin and padding of zero to them. The star is just a selector, like any other: *{ margin:0; padding:0 } div#content{ margin:0; /*This div already has a margin of zero due to the rule above*/ } This is quite a slow process, and there are better ways of reseting CSS - check out the Yahoo reset CSS, for example.
  10. You're welcome Accrington. Hope it's useful. And to the HTML zealots here...you need XHTML for this one! ... ... ... ... ... ... (I think)
  11. The proper, semantic way to mark up mathematics is to use....MathML! It is a recommendation of the W3C, and it is certainly the way to go for more complex stuff. Wikipedia has an excellent article with examples here. Predictably, IE only supports MathML with a plugin, so depending on your audience, this may or may not be the best solution.
  12. I would suggest looking into the GD image library. This would allow you to create an image on the fly (with the text specified by the user). This image could then be passed to flash to create the e-card. Most hosts have the GD image library installed for PHP by default; you can read the documentation for it here. You probably want to use something like imagettftext(). I would warn you; this probably won't be easy.
  13. My preferred editors aren't mentioned here - thought I would share. Windows - Komodo (commercial) / Komodo Edit (free) Linux - Geany In particular, Komodo features intellisense for JQuery out of the box - excellent stuff. Also, the free version of Visual Studio, Visual Web Developer, is excellent if you are starting to learn asp.net on a budget.
  14. I've worked on databases up to 400MB on my own machine without problems. However on a production server, I've seen PHPMyAdmin choke on a database about 50Mb in size. We had to allocate more RAM to it on the server. I realise that's a slightly different issue, just thought I'd mention it. I checked out sqlbuddy last night. Although it was nice and fast, I was getting PHP errors and warnings all over the place. (It was MySql server running on Ubuntu). I can't trust a production database to that! Anyone else seeing these problems?
  15. That's good to hear. Variable names can be upper or lower case, although you should be consistent. I would suggest looking into camel case. Variable names are case sensitive, so $variable isn't the same as $VARIABLE or $Variable. Pick a convention and stick to it. For the superglobals ($_GET, $_POST, $_COOKIE, $_REQUEST, $_FILES etc) you should be using caps, or it won't work (as we found out ). The superglobal arrays are variables like any other, and so are case sensitive. I should have clocked that earlier, but it's almost midnight here. (That's my excuse and I'm sticking to it!) All the best! John
  16. One more thing - try putting this at the top of testlandpage.php, before anything else, and let us know what is printed: <?php print_r($_POST);?>
  17. jbwebdesign, you can see the form code on the link that was posted. That's really strange, everything looks correct. And when I use Tamper Data to view the request being sent, the variables are being POSTed properly - so it must be a problem on the receiving page. Two things I can suggest though it shouldn't make any difference: Try changing '$_post' to '$_POST'. Try concatenation instead of using the variables directly - like this: print 'The first name is:'. $name_first .' '; And let us know what happens.
  18. You can use mysql_insert_id to retrieve the last ID generated by an insert operation (provided that the id field auto-increments). You could then use this for your second insert. It is possible to use joins in conjunction with updates and deletes, but I've never used join with insert before. I don't think it's possible, although I stand to be corrected on that. (Anyone?)
  19. Hi, there's no need for you to have the following lines of code: $_post['name_first']; $_post['name_last']; $_post['email_address']; $_post['comment']; You can safely delete those. Provided your form fields have the names 'name_first', 'name_last', 'email_address', and 'comment', your form should now work as expected.
  20. print $name_first . "-" . print $name_last . "-" . $street_address ; should be: print $name_first . "-" . $name_last . "-" . $street_address ; Using the rest of your code, this will output: tristan-bethe-sauerlandstraat
  21. Here is a list of the latest critical security issues for firefox, when they were reported, and when they were fixed: Bug id 451680 - reported 21/8/2008 - fixed 16/12/2008 Bug id 464998 - reported 14/11/2008 - fixed 16/12/2008 (Can't find info for the third critical bug, here's some more info going back to the last few releases) Bug id 456896 - reported 24/09/2008 - fixed 12/11/2008 Bug id 436741 - reported 31/05/2008 - fixed 23/09/2008 Draw from these whatever you want. You can browse release notes here. Microsoft list their security bulletins here, but they don't make a whole lot of sense to me - I can't find any dates. I wouldn't think they'd take much longer than the dates listed above, though. That's actually one of the things I love about open source; the process is transparent, and there are many more pairs of eyes looking at the code. That's why I use open source, not because I believe I'm 100% safe.
  22. Almost 1.5 billion people use the internet. (source). Firefox's market share is conservatively estimated to be 28% (source) That's 409,817,061 reasons to exploit the small market share software! I hear what you're saying. My point is just that no-one can afford to be complacent when it comes to security. Or, to your point, rely on security though obscurity. (edit - that firefox market share number is for Europe - actual market share is probably closer to the 21-22% range, but still - I stand by my point.)
  23. Interesting that on the same day Mozilla released Firefox 3.0.5, which fixed 8 security loopholes that had been alive for around a month. (Three of those were rated critical). I didn't see that reported on BBC news. I'm all for a bit of Microsoft bashing, but let's not kid ourselves that any browser is 100% secure - that's a sure way to get your credit card details stolen.
×
×
  • Create New...