Jump to content

tibberous

Members
  • Posts

    1,187
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by tibberous

  1. Happened to us - our designer got a virus that stole his FTP login. Whats weird is that it didn't show up right away. I think they steal the ftp passwords, the attack later on. Look through your files. You probably have something like thumbnail.php that's just an eval(base64_decode("gf46uy45h6n67n6rmrnw45h... or something similar.
  2. Or put logmein on the host computer, login as needed to get the new ip. Or create a service on the remote computer that posts it's IP to a server every couple minutes.
  3. I'm having a weird problem. We are using Google business email. I am using htmlMimeMail5 to send off gmail's smtp server off port 587. A client isn't getting email from the system, he has a Comcast business account. If I login to gmail, and send it from our account, he gets it. If I send it from the system, he doesn't. If I send it from the system, to me, it works. Only thing I can figure is that maybe htmlMimeMail is adding some headers that Comcast doesn't like, but that gmail doesn't care about. Anyone know how I can debug this? I'm not sure what to do from this point. htmlMineMail has been updated to Rmail. I'll update and hope it fixes everything - otherwise, I'm a little bit at a loss.
  4. I think what you want is something like basecamp, but with exams. Basecamp, if you didn't know, is a project colab too - you can share files, create timelines, create to-do lists, assign tasks ect. See if this list of basecamp alternatives doesn't help you out: http://pm-sherpa.com/features/basecamp-alternatives/ But like ignace said, it isn't that hard to do in straight PHP if you got a couple weeks.
  5. Does anyone have a good auto detect / update / install script? Right now, I just send people to : get.adobe.com/flashplayer, but even that seems too hard.
  6. I am looking for the little phone / fax icons that you put in put in front of the numbers on a website. I've seen them on a hundred sites, and now I can't find them. Just looking for little gray, 12x12 - 16x16 images. Anyone know what I'm talking about / have a set?
  7. I am making a CMS. I want the user to be able to enter their address and get a Google map to their location. http://maps.google.com/maps?oe=utf-8&ie=UTF8&q=$addr+$city+$state+$zip&fb=1&gl=us&hq=$addr&hnear=$city,+$state+$zip&source=embed&output=embed Using this as the iframe source works SOMETIMES. I think it only works if it matches exactly with Googles database. Does anyone know of a better way to do this?
  8. I got it, you do a foreach($matches[0] as $match), then you str_replace, but you send in count as 1, to match sure it one for one replaces. Edit: this doesn't work. Count returns the number of matches =/ I thought it worked like the limit param in the explode function.
  9. I'm trying to go through a document and replace all the UBB tags with different values. I can preg match the tags, but I don't quit remember how to do the replacement. Tags are like: ect. Anyone have a basic example I can go from? I know I've done it before, just can't think tonight.
  10. Always do OOP! That's what they taught me in into to Java!! Just kidding. Personally, I always use procedural, but this isn't a right or wrong type question. The one advantage to always doing procedural (besides performance) is that you don't have to spend much time worrying about how you are going to structure everything. Everything is a function. Utility functions take arguments and return a value or error code, 'action' functions just access globals and return the message they want to show up on the page. The important thing is to find a way that works and not get caught up in how some else says you should program. Java is a perfect example of how bad a language gets when you try to do everything through objects, but some people would swear it is the greatest language ever written. It's as much preference as anything.
  11. Fixed. The trick is to not include jqeury.js...
  12. function onButton(){ alert('here'); $.get('index.php', {}, function(j){ alert('j'); }); } Shouldn't this load index.php, pass no variables, and print the letter j once it succeeds? It is printing 'here', but the callback is never getting called.
  13. Yeah - an ex-coworker of mine had some kind of shitty, object-based mysql library he used. Thing made so many querys, and didn't work with anything more complex than a select or insert statement. I HATE when people try and wrap core features of the language. I have a general.php file I use in projects, but it's just general utility functions that PHP doesn't have.
  14. If your really interested in optimization, you might want to focus on the mysql end of it. Trying to improve 'general performance' is a waste of time. There are times where a huge database can cause you issues though, few things you might want to look at are: - MySQL database indexes - Proper hierarchical data storage (which is hard as fuck) http://dev.mysql.com/tech-resources/articles/hierarchical-data.html - Pre-caching / lookup table creation with and without cron scripts The key to good optimization is to only optimize the stuff that is slow enough to be an issue. Did you read xylex's sig? "The greatest inefficiencies come from solving problems you will never have. -Rasmus" PHP is fast, performance is only an issue in rare situations, and as servers become faster, optimization is only going to become less and less important.
  15. Do what I do - type with one hand and leave the other one on the mouse. You'd be amazed at how fast you will eventually be able to type with one hand - and since you rarely type long runs of text start-to-finish, the ability click more than makes up for the speed difference in typing.
  16. Use UEStudio instead - it doesn't even have CTRL+Tab, but you can click the tabs with your mouse.
  17. What does the script do that it's 2700 lines long? I can count on 1 hand the times I've actually needed to optimize something in PHP - and normally just by adding indexs to tables. Who cares that it takes .05 seconds? If it works, be happy.
  18. I'm looking for a library / database I can use to see if a user is a bot. I found this site, but it is a long way from what I need: http://www.botsvsbrowsers.com/category/1/index.html
  19. class OnePlusOneSimpleEchoInPhp { const STDOUT = 'php://output'; const OUTPUT = '1+1'; public static function output() { file_put_contents(self::STDOUT, self::OUTPUT); } } OnePlusOneSimpleEchoInPhp::output(); I think this is the simplest example I could think of how to do this effectively And yet still more efficient than java...
  20. Good thinking neil, but xylex got it right! Good job xylex!
  21. I have a cron script that is just supposed to send me an email every hour. I added this line to /etc/crontab 01 * * * * root run-parts php /daemons/hourly.php Then I reset cron. If I run the command: php /daemons/hourly.php in putty, I get the email. Any idea why the cron isn't sending it?
  22. Here is the same function, only setup to return an array of ids, rather than print. Little bit more useful, imo. function get_children($parent, $level) { // retrieve all children of $parent $children = array(); $result = mysql_query('SELECT `id` FROM `pages` WHERE `Owner`="'.$parent.'";'); while ($row = mysql_fetch_array($result)) { $children[] = $row['id']; $children = array_merge($children, get_children($row['id'], $level+1)); } return $children; } get_children($id, 0);
  23. id Name Owner 1 Root 0 2 Child 1 3 Child 1 4 Level-2-Child 2 So, I want to get an element, then get all elements that are either direct or indirect children of it. So - getChildren(2) should return 2 and 4, because 4 is a direct child of 2. And getChildren(1) should return 1, 2, 3, 4 because all items are a child of root. I'm pretty sure it needs to be done with a recursive function. Can someone help me out?
×
×
  • 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.