Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. lol make a bot that scans through your email detecting potentials gogogo
  2. my patterns will work whether or not there is a name.
  3. looking through those...page hit counters. Those were totally 90's.
  4. though you'd probably want to use $i+1 because $i starts at 0 not 1.
  5. only thing i really see wrong here is that it should be <br> or <br/> by itself, one for each line break you want, not </br> (linebreak tag does not have open and closing tags, it is a single tag).
  6. you said it works on localhost but on on a remote server...is your database and connection info the same on the remote server as it is on your localhost, same user/pw stored in db, etc..?
  7. well I don't see anything in that code that would cap it at 9...do you even have more than 9 articles to display?
  8. meta tag name is misspelled. it's meta not metta.
  9. would be better if you showed the code actually outputting the text, but you probably need to be using nl2br or simply wrapping your text with <pre>...</pre> tag.
  10. would help if you explained what exactly it is that you're trying to accomplish.
  11. okay that latest error is because you should be using $this->title not $this->$title (same with $end and $name)
  12. A file has to be read in order to be served, and this will take a certain amount of resources, regardless of which method you choose to read and/or serve it. Some functions will read and load the entire file into memory (like file or file_get_contents), others like fread can read and put into memory a file as little as 1 byte at a time. re: limiting download speeds with php Interesting question, never really seen that come up before...not really sure what all you would do to limit download speeds with php...sure, you can simulate/fake it easy enough using one of the above reading functions and having php sleep a bit in intervals and flush the output buffer, but IMO that's not really the same thing. Not sure true connection speed capping is even possible with php. Maybe it is possible using sockets. I'm thinking as far as limiting download speeds, you would probably use something like php to create a system (like membership system) to determine which speed a user should be downloading at, and then employing something else on the server to actually limit the connection speed..a shell script or some other server command/setting or something, not sure.
  13. so ex2.php is in the same directory as that script that is running that code?
  14. IMO you should simplify it by breaking it down into multiple regexes. Instead of trying to match parenthesis and hyphens and spaces that may or may not be there, simply match anything between [ and ] and then strip non-numbers out. This will also help you in the future, in case other phone number formats are introduced. Example: $subject = "Subject: SMS from John Doe [(123) 457-7890]"; preg_match('~Subject:[^\[]*\[([^\]]*)\]~','$subject,$number); $number = preg_replace('~[^0-9]~','',$number[1]); As for the email address... you say you have From: "Don Ingram" <[email protected]> and you just want the green part? $subject = 'From: "Don Ingram" <[email protected]>'; preg_match('~From:[^<]*<([^>]*)>~',$subject,$email); $email = $email[1];
  15. Okay then a car in the 50's or 30's or something. Still, same principle. Point being that there were plenty of well designed sites back in the day, using the tools that were available at the time.
  16. I don't really think "web 1.0" was all about the stereotypical cheese... there were (are) plenty of good "web 1.0" sites that did not have those things. That's like saying all cars built in 90's were cheesy and stupid eyesores. Or songs, etc..
  17. $class = ($c % 2 == 0) ? "alt1" : "alt2"; $c++; echo '<table class="listOfShows listOfShowsFirst"><tr> <td class="'.$class.'"> <a href="videos.php?id=' . $id . '">'. $title . '</a> </td> </tr>';
  18. FYI, the issue here is that you are putting a php method (and variable) inside single quotes ('...'). PHP does not parse syntax/variables in single quotes, it treats it as plain text. You can get php to parse a variable inside quotes if you use double quotes ("..."), but it won't parse the php function, so you have to break out of the quotes and concatenate as BlueSkyIS has shown. @bibby: your solution won't work because long2ip() is a php function. You will have to move long2ip() to wrap around $ip and just use %s in the query string.
  19. .josh

    Flash

    If you are referring to that big image changing thing on the page, that is called an image slider or slideshow. It was done with javascript, more specifically, with the jquery framework. Buttons etc.. are done with normal html/css/js. If you google "jquery slideshow" you will find a ton of tutorials on how to do this sort of thing.
  20. afaik you cannot do this. Once a file is compiled into swf, I don't think there's any way to uncompile it to original flv. Even within adobe flash, all it will do is make the swf into a self-contained object to be put in a frame or within another object/symbol or whatever.
  21. doing 11-11-2011 should be fine, just wrap it in quotes. And yeah, since you want it to be the "defaule" date, call it right after the first code you have (the dateFormat).
  22. I have never in my life ever seen someone need to use more than 99 groups, or even 50...or even 10. Most patterns use 0-5 groups. Beyond that, it is usually far more beneficial to be breaking down the data (with or without regex) into smaller chunks of data to work with...or going back and rethinking how you are storing that data in the first place.. I have once or twice seen a regex that used upwards of 10 and one time I think I used almost 20 groups for a particularly complex pattern for someone (it was parsing some custom serialized multi-dim array, matching only certain areas of the subject if other areas matched, etc.. ) but TBH it was more out of me trying to be cool and get all the data out in one regex than doing things the "better" way in the first place (particularly pushing back and saying 'store your shit better'). IOW, if you really think you need anywhere near that many captured groups, the chances are overwhelmingly likely that you are going about storing the data and/or approaching the regex in the wrong way. I have yet to see any evidence from real world examples/problems where you would actually ever need anywhere near that many groups.
  23. I can't make any sarcastic remarks. I've taken off pretty much this entire month while Phil continues to work
  24. that's the same pattern except with different delimiters... yes, you can use more than / as a pattern delimiter in php but / works just fine, there is no need to change the pattern.
  25. Giving someone what they pay for isn't cheating them. If I go to McDonalds, and buy a hamburger, they didn't 'cheat' me. They gave me what they reasonably could for $1, while still making a profit. Did they give me best possible hamburger? No. There is a market for $1 hamburgers same as there is for $50 hamburgers. All I'm saying is you shouldn't make out a $1 burger like it's a $50 burger. Plenty of customers only really need a skinned/customized 3rd party CMS. I know plenty of people who make a full time living off of doing nothing but custom word press installs. That's FINE, as long as you are honest with the customer about what they are getting and what you are charging them for. While this may be true, that doesn't justify YOU ripping a client off. "They get screwed no matter what, better the money in my pocket than someone else's" is, IMO, not ethical. If you have no issue with that (and I know plenty of people who don't have issue with that) then whatever gets you off, as long as you understand that philosophy does not earn you respect in many circles or from many people. Then don't charge $1000 for a $5000 job. I'm not suggesting you charge $1 for a $50 burger. Being a freelancer is more than just being a programmer, it's running a business. A 1-man business in most cases, but it is still a business. Running a business is more than just writing code. It is about setting expectations, negotiating something that works for both sides, project management, account management, etc... if you want to make a real career out of freelancing, I highly suggest you invest in a few business courses. There's a reason why full fledged companies charge $100+/hr (my company charges $250/hr BASE, just for consulting). Projects take more than just handing someone some code. If you want to freelance, cut out the middleman "boss" and make more money for yourself, that's FINE, but you can't just ignore the other stuff that goes into completing a project than the code. This is the primary reason prefab customizable CMS/Template systems exist in the first place. It makes it easier for you to focus less on the code and more on the rest of your freelance business - and charging accordingly. And that's fine, if that is what you are advertising, and you are charging accordingly. Yes.
×
×
  • 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.