Jump to content

roopurt18

Staff Alumni
  • Posts

    3,746
  • Joined

  • Last visited

    Never

Everything posted by roopurt18

  1. This is not a fault of JavaScript the language; this is the fault of Mozilla and Microsoft the companies. The solution is quite simple anyways - Don't add functionality that only works in one browser and not the other. For example, document.all is an IE-only so don't write any code that depends solely on it. Things like XHR (or AJAX) are supported the same in all of the latest browsers and can still be accomplished in IE6 and lower with a proprietary method. Since you should have a factory function that creates the XHR object for you, you can wrap up all the complexities (and they're not really that complex in the first place) inside this function; then your client code just asks for an XHR and doesn't care how it is created. Taking things further, IE uses one event model while the other browsers use the DOM L2 model; this can make event handling a PITA. I took the time, however, to learn the event models to some detail and wrote my own JavaScript Events interface that I use in my client applications. My client code just says Events.addEvent( 'elementID', 'click', clickHandler ) and the interface hides all the complexities for me. BTW, I used to be in the same camp as the JavaScript naysayers until I took the time to really learn the language.
  2. How is JavaScript buggy? Every JavaScript program I've ever written has done exactly what it was supposed to do, every time without fail, and works in every mainstream browser. I can only conclude that if you feel JavaScript is buggy then you do not have enough knowledge on how to use it properly.
  3. Care to provide a concrete example?
  4. I was doing some typing tests last night online to get used to where the keys were. I switched back to qwerty but I'll move back and forth between the two as time permits.
  5. Thanks to you I'm trying it out and it's difficult. Go-Go 10 WPM!
  6. Please don't double post, even if you put the original in the wrong place. I've responded to your original thread. http://www.phpfreaks.com/forums/index.php/topic,194784.msg877214.html#msg877214
  7. $pattern = '/^[a-zA-Z]([a-zA-Z0-9]|[:punct:]){5}$/'; If you want the PW to be between 6 and Y chars in length, change {5} to {5,Y}
  8. I finally got around to reading this; thanks for posting it. I think the guy went a little overkill in how he fixed the image in IE6 though, in his final example.
  9. Displays wrong year: http://www.valid.gr/worldcalendar/yearly_list.php?yr=2005
  10. I don't think so. The original problem would have been something like this: One table stores a master-list of something: master_records id, name, type The items in the master_records table can be joined with any number of other tables depending on the `type` column. It's assumed these tables all follow the same layout structure. /* When type='SURVEY' */ survey_detail id, master_id, ... /* When type='ORDER' */ order_detail id, master_id, ... To pull from the tables: SELECT * FROM `master_records` m INNER JOIN `survey_detail` d ON m.`id`=d.`master_id`; SELECT * FROM `master_records` m INNER JOIN `order_detail` d ON m.`id`=d.`master_id`; Both queries are the same, the only thing that changes is the join table. So it makes sense to take out the part that varies in terms of maintenance and debugging. But if the query built in the CONCAT function selects into a temporary table, I can then select from that temporary table as the last step. The name of the temporary table is irrelevant. /* now determine which table to use dynamically */ SET @myStmt := CONCAT( 'CREATE TEMPORARY TABLE `tmp_whatever` ', 'SELECT 1 AS `foo`, t.`id` FROM `wv_user` ', 'INNER JOIN ', IF( NULL IS NULL, '`byr_surveys`', '`byr_surveys_response`' ), ' t ON t.`id`=1 WHERE 1 LIMIT 1' ); /* prepare the statement */ PREPARE tmpStmt FROM @myStmt; /* execute the statement */ EXECUTE tmpStmt; DEALLOCATE PREPARE tmpStmt; SELECT * FROM `tmp_whatever`; This originally came up in IRC; I've never actually had a need to do anything like this. I don't particularly like this approach anyways; it feels so wrong. Also, I'm fairly proficient in MySQL but there are definitely features I'm unaware of, so maybe there's a best way to accomplish this same thing already.
  11. I was looking over my old posts and when this one came up I was hit with a brainstorm. I changed the dynamically built query to CREATE TEMPORARY TABLE `tmp_dynamic` SELECT ... and added a SELECT * FROM `tmp_dynamic` as my final query. It seemed to work although I didn't play with it very long. Anyways, it seems like a long, over-blown way to accomplish something that might be better left as application logic or a stored procedure anyways.
  12. <div class="g"><!--m--><h2 class="r"><a onmousedown="return clk(this.href,'','','res','1','')" class="l" href="http://disneyland.disney.go.com/"><b>Disneyland</b> Resort | Welcome To The Magic!</a></h2><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td class="j"><div class="std">The <b>Disneyland</b> Resort is the perfect place to spend a fun-filled day the entire family will enjoy.<br/><span class="a"><b>disneyland</b>.disney.go.com/ - 72k</span> - <nobr><a onmousedown="return clk(this.href,'','','clnk','1','')" href="http://209.85.207.104/search?q=cache:UvETNgp6OAcJ:disneyland.disney.go.com/+disneyland&hl=en&ct=clnk&cd=1&gl=us&client=firefox-a" class="fl">Cached</a> - <a href="/search?hl=en&safe=off&client=firefox-a&rls=org.mozilla:en-US:official&hs=k21&q=related:disneyland.disney.go.com/" class="fl">Similar pages</a> - <span class="bl"><a onclick="return gnb._add(this,'http://disneyland.disney.go.com/')" href="#" class="fl">Note this</a></span></nobr><br/><table class="slk"><tbody><tr><td><div><a href="/url?q=http://disneyworld.disney.go.com/services/en_US/BookingGenie/redirectDlr&sa=X&oi=smap&resnum=1&ct=result&cd=1&usg=AFQjCNF5fJtFYVd6BEtANMHeZb6arRBl3A">Tickets And Reservations</a></div><div><a href="/url?q=http://disneyland.disney.go.com/disneyland/en_US/parks/landing%3Fname%3DDisneylandParkLandingPage&sa=X&oi=smap&resnum=1&ct=result&cd=2&usg=AFQjCNGUjddKXnXy7o0-ns_MDjqU4GFa-A">Park</a></div><div><a href="/url?q=http://disneyland.disney.go.com/disneyland/en_US/calendar/monthly/monthly%3Fname%3DCalendarMonthlyPage&sa=X&oi=smap&resnum=1&ct=result&cd=3&usg=AFQjCNFpVadtraQvYERGToqwH56QNnTxIA">Calendar</a></div><div><a href="/url?q=http://disneyland.disney.go.com/disneyland/en_US/reserve/ticketListing%3Fname%3DTicketListingPage&sa=X&oi=smap&resnum=1&ct=result&cd=4&usg=AFQjCNE8YrYfoZTfiMAWVcVDQrKEDPimFQ">Tickets Only</a></div></td><td style="padding-left: 20px;"><div><a href="/url?q=http://disneyland.disney.go.com/disneyland/en_US/parks/overview%3Fname%3DDisneylandResortParksOverviewPage&sa=X&oi=smap&resnum=1&ct=result&cd=5&usg=AFQjCNG4dIDwvArzQ82-D6TxVaBTzl4VVA">Theme Parks</a></div><div><a href="/url?q=http://disneyland.disney.go.com/disneyland/en_US/hotels/overview%3Fname%3DHotelsOverviewPage&sa=X&oi=smap&resnum=1&ct=result&cd=6&usg=AFQjCNE7tuKfQX72ClOd3pOKaL5N2dOBwg">Hotels</a></div><div><a href="/url?q=https://secure.disney.go.com/disneyland/en_US/ap/gated/landing%3Fname%3DAnnualPassholderLandingPage&sa=X&oi=smap&resnum=1&ct=result&cd=7&usg=AFQjCNFsbu4dOFfcV12OXByly0wd3F2ttA">Annual Passholders</a></div><div><a href="/url?q=http://disneyland.disney.go.com/disneyland/en_US/transportation/landing%3Fname%3DGettingToTheResortPage&sa=X&oi=smap&resnum=1&ct=result&cd=8&usg=AFQjCNHLOglrzEUuP7goeitwxFEi7dx5Uw">Driving Directions</a></div></td></tr><tr><td colspan="2"><a href="/search?hl=en&safe=off&client=firefox-a&rls=org.mozilla:en-US:official&hs=k21&q=+site:go.com+disneyland&sa=X&oi=smap&resnum=1&ct=more-results" class="fl">More results from go.com »</a></td></tr></tbody></table></div><!--n--></td></tr></tbody></table></div> That's the Google source according to Firebug. If you want to know how to make your site show up like that in Google, I think a sitemap helps.
  13. I would say when the file is originally added it goes in uncompressed. Run a cron job every 7 days and compress any files that have no been active in that period. Or some other criteria. Basically aim for a middle ground. If you compress everything you'll waste too much CPU resources and bog the system down. If you don't compress the old stuff you'll waste unnecessary disk space. Then again, a few hundred dollars will get you hundreds of gigs of storage space so it might be cheaper to just add a HDD than the hourly cost of you writing this new code.
  14. This particular site uses Java and certificates to allow the user to log in. If you don't have IE6 then the site thinks your browser doesn't support 128-bit encryption and poo-poos all over the place. I've tried many things, such as switching the user agent, but not specifically modifying the headers. The site is a PITA to interact with. This is it BTW http://www.loweslink.com/login.html
  15. Depending on what you're doing, an accurate progress bar can be very hard to make. I don't know if a comment on the sheer number of updates is fair. My Ubuntu box wants to update itself every time I turn it on; the difference is that the Ubuntu update works on the OS and all installed programs and is noninvasive. Also, it has always irked me that Window's components seem to be so tightly coupled. For a long time and still to some degree, the slightest change in windows requires an entire system restart. Better operating systems just restart the component that changed and broadcast the changes to the rest of the system and over any network it's attached to. (edit) There are also some people who can not update past IE6. My parents, for example, are installers for Lowes. Lowes has a website that requires IE6 and there is absolutely no way around it. Believe me I've tried everything.
  16. It does no such thing. include() opens and runs the specified file. If the file echoes HTML, then it will be dumped into the calling script, but it doesn't have to echo anything.
  17. Possibly. I was hoping for a way to do it without creating a procedure.
  18. So you're checking the mime/type provided by the browser? You realize that is not secure? You should be using either finfo (fileinfo) or trying to manipulate the image with one of the built in PHP GD functions and verify that it is an actual image file.
  19. How do you make sure they are only uploading png, gif, etc?
  20. TBH I'm not sure. Just curious, what do people upload into this folder?
  21. Say what? Just put the bare minimum of files into public_html so if things break the most someone sees is: <?php include('path/to/application/that/is/outside/public_html/index.php'); ?> as opposed to <?php $dbuser = 'user'; $dbpass = 'pass'; // other vital info ?> Any and all user input should be validated. Verify that images are in fact images (instead of scripts) and clean anything before it goes into the database. If you want to learn more about PHP security, then google it or buy some books off amazon.com. It's a BIG topic.
  22. It can occasionally happen that PHP breaks and Apache serves up the raw PHP source instead of sending the scripts through the PHP interpretor. This is one more reason why it's generally advised to keep your PHP code outside of public_html or www. If your scripts follow faulty security practices then it's also possible for individuals to upload PHP scripts that act as web interfaces to your server's command line. Basically a root kit. If they manage that there's no telling what they can accomplish.
  23. I'd say it depends on what you're trying to accomplish. I received a large amount of spam in the comments on my site. 99% of the spam followed a specific pattern so I just routed everything through a central script, checked if they were attempting to POST, and if the post matched the pattern. If it matches I just redirect them elsewhere. No captchas and no spam for weeks now.
×
×
  • 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.