Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. use single quotes instead of backticks.
  2. str_replace needs to have the \n wrapped in double quotes not single. Alternatively, you can use trim
  3. Dude seriously, stop pulling numbers out your ass. $600 for an apartment? Maybe an efficiency in a really bad side of town in some areas of the country. $150 for food. Yeah, you can swing that, eating beans and rice, ramen, etc.. $50 for water and electricity? ROFLMAO. Dude where do you live I'm totally moving there. My electricity and water runs a minimum of $300 a month, and that's during the 'off' seasons, when they aren't jacking up the prices extra high because it's summer and people are using more air conditioning, or winter and people are using more heater. My bill has been as high as $700. Sure, turning on the a/c isn't necessary, but you just try going through the winter without the heat. Esp when you live in an area where it get below 0 and stay that way for weeks on end. $15 for bike insurance? Yes, because everybody drives motorcycles and gets the same rate as you. You may be able to live w/out a car, depending on where you live, but you'll probably just make up for it in other transportation costs, like bus, taxi, train, whatever. But you probably will have to have a car of some kind, and insurance is higher. Oh and you're numbers are also assuming you are living by yourself. What about if you have a family? Efficiency won't cut it. Motorcycle won't cut it. Bills go up, esp food. I spend $150 a week on food and trust me, it ain't no steak and potatoes. Utilities go up. Dude you obviously don't know what you're talking about. Living sheltered or else you're too young, haven't been out there yet. p.s.- the min. wage only recently went up to $7.25. It was at $5.15 and only got bumped up recently.
  4. uh, no they can't. Maybe if you apply for all kinds of govt. assistance or have like 100 roommates. I've spent most my life in that bracket, I know. There's a reason why govt. turns around and gives out handouts. Because min. wage is not enough. And no I'm not talkin' about not getting to dine out and shit. I'm talking about eating beans and rice, ramen shit 24/7.
  5. Americans don't care if you are not an American (or 'native' american). We're actually pretty big on equality, regardless of race, religion, nationality, blahblah. I suspect mostly because we are sue-happy, but whatever. 2 biggest caveats are: 1) "Less than perfect" communication skills. Strong communication skills are always a necessity, no matter what profession you are in, but it becomes even more essential when you are doing "distance" jobs. Body language is a significant part of communication. With that out of the picture, it becomes a lot more important to be able to convey meaning solely through words (and understand, as well). If people have a hard time understanding you and visa versa, then yes, you are going to have a hard time getting work or working efficiently. 2) Working for a fraction of the price as everybody else. We don't hate you because you're <insert some nationality here>, we hate you because you're undercutting us! If you are living in America you will quickly realize that you will not be able to live off that extremely low rate. It simply costs a lot more to live here. Working for like $2.15/hr won't cut it. Hell, even working for the U.S. federal minimum wage won't cut it around here. But it's nothing personal. We don't think foreigners are *evil* for doing that. But that don't make it any better on our end. On that note, you will actually find it harder (relatively speaking) to get this kind of work in America, because you are in America. You will have to become more of a salesman to sell yourself, instead of relying on being able to charge less. You will have to focus on building a reputation, word-of-mouth, etc.. In other words, you will have to excel at that first point: communication.
  6. well it looks like you're putting all of the html into a single variable anyways, so instead of using that fopen and fread in a loop, just use file_get_contents
  7. did you actually read your error? It tells you what the problem is. fopen expects 2 parameters and you are only giving it one. Pretty self-explanatory. The other 2 errors are being caused because of fopen failing.
  8. Okay so I'm not sure what you're asking. Are you wanting to know how your script would save the info and then use it to connect to the db later? You would have your install script generate a config script/file with the info in it, saved to wherever (outside of the public dir). Then your script would have the config file included when it needs it.
  9. last time I checked, wordpress does not set db info in the install. You have to set that up yourself and provide wordpress with the info...
  10. <?php There you go. That's where you start.
  11. haha yeah...I worked in a produce warehouse for a while. I've seen some pretty spectacular shit happen before, forklifts dropping shit from top shelves, pallet trucks rammed into each other (lots of ice and water on floors of produce warehouse). Whole racks toppling over. All kinds of crazy cool shit. Seen lots of people get hurt (myself included...) but no deaths.
  12. I had a ps3. It broke. I waffled about whether to get a 360 or ps3 and ultimately I decided on ps3 because they have a tendency to pump out more rpgs, and also the whole blue-ray thing seemed kinda cool at the time. I then got a wii. I was very disappointed. I mean, there are some games on it that are okay. But..meh. Although I admit I am excited about the new mario game coming out in a couple weeks.
  13. http://www.phpfreaks.com/tutorial/php-basic-database-handling
  14. "level system" is pretty ambiguous... care to be more specific?
  15. http://www.phpfreaks.com/tutorial/php-add-text-to-image
  16. GENERAL RULES AND GUIDELINES FOR POSTING This forum is not meant to be a formal freelance service system. It is available for those who wish to seek out services or work from other people, as a courtesy to the members of the phpfreaks community. phpfreaks.com does not specialize in freelance services. This forum is an informal mechanism, as a courtesy to the community. We have no formal mechanism in place (like escrow) to guarantee payment, refund, work done, etc... phpfreaks.com shall not be held responsible for any losses you incur. we have never and continue to not act as any kind of mediator or verification/compensation source for people/organizations who use those forums. We will not be held responsible/liable for any damages, loss, etc. that occur from use of those forums. If you hire someone and they rip you off, don't come crying to us. If someone hires you and they rip you off, don't come crying to us. Those forums are a convenience. If you want something more official that offers guarantees, go to a real freelance site! If you have any questions regarding the freelance forum, feel free to ask them here. RULES: WHERE TO POST:If you want to offer your services, post in the Service Offerings sub-forum.If you want to offer a job or position of employment, post in the Job Offerings sub-forum. DO NOT post your 'resume' in job posting threads. You must directly contact the person you wish to reply to. The only reason replies are allowed is to ask for clarification/details about the job. Failure to adhere to this rule will result in all kinds of things, like you getting banned, or us disallowing replies. DO NOT make more than one thread offering your services. You can edit/reply to your thread to reflect additions/changes. DO NOT post advertisements to other sites offering freelance system services. For example, rentacoder.com, odesk.com, etc.. we have no partiality for or against those sites, but posts such as those are regarded as advertisement, which is against our main site rules. We fully acknowledge that this freelance system is limited, but we aren't here to provide free advertising for other places. If you prefer to do actual business through one of those sites, please specify in direct contacts with the person. You are allowed, as a freelancer or freelance company, to post a link to your personal portfolio/company to those sites, or a site that you own. But general promotions to those other sites are not allowed. GUIDELINES: When posting in the freelancing forum it's important that you provide a way for users to contact you. They will not be able to reply to your topics so they need a way to contact you privately. This can be using PMs, emails, any type of instant messaging service (MSN, Gtalk, AIM, Jabber, etc.) or however you see fit.The more specific you are about your skills, previous experience(s), availability, rates, etc.. the better your chances of getting serious inquiries. Posting vague "I'm available for anything and everything" might get more inquiries on average, but there's a good chance that it will come to nothing, based on any number of things that you could have posted here in the first place. Better to receive 10 emails from people who have some idea of your qualifications/terms, than 100 emails that don't.Be honest about your skills. All day long we see people posting about how they jumped on a job and bit off more than they could chew. They tell the client they can do everything they need and more, promise them the moon, and then promptly crap their pants about 5 minutes into it. Don't be that person! Some people get lucky and figure it out. Some people get lucky and get help that figures it out. Most people end up having to give up the project. Which leads us to....Wasting people's time and money. You waste the client's time. You waste your own time. That bad rep will more than likely come back to haunt you. All day long we get people trying to get us to delete their posts because they don't want their skeletons to come out of the closet (no we won't hide them for you). So be smart! Do the simplest easiest thing to avoid all this headache: be truthful about your skills. If you feel that being truthful will limit your potential clients, then get off your bum and hit the books. You can't seriously be in the business of trying to con people, are you?Be very clear about what you are doing. Some clients know your job, and are just looking for extra set of hands. Most do not, and therefore seek someone who does. Therefore, if you want to avoid headaches, it is your responsibility to be very clear about what it is you're going to do. What you're willing to do. What kind of support you offer after the fact, etc... on that note..Be up front and thorough about your prices. Take a look at the situation. Quote a price for it. Quote prices for things that might come up later. The more you have to go back later saying that xyz was unforseen or xyz wasn't part of the deal, regardless of whether or not you are in the right, the more you are going to come off as shady, to the client. It's like when you take your car to a mechanic and that funny noise goes from being one little $50 thing to a $2000 rebuild because the mechanic kept coming back to you saying something else is wrong. That stuff may indeed be needed, but the fact that you didn't think about it and let them know ahead of time speaks volumes about your skills as a coder. Some things just aren't foreseeable. Most things are.
  17. I believe thorpe is working on something like that right now. Don't have an ETA or anything.
  18. How about a captcha tutorial? Lots of them around, but we're supposed to be a resource, right? I may do it myself, if someone else doesn't volunteer.
  19. Honestly I don't really see anybody writing a tutorial like that on a technical level (actual code). Maybe on some kind of abstract level, like conveying general principles and program flow and good design, advice and pitfalls, etc.. but most tutorials that involve actual code are for teaching how to make building blocks. Things like forums and blogs and cms' are more like actual buildings, not building blocks. If you sit down and break down for instance all the things in a forum, you will quite easily find tutorials for just about all of those 'building blocks.' I suggest you either do that, or maybe find an open source version of one of those things and jump into it, instead.
  20. Basic Database Handling
  21. okay I thought I'd make a new post instead of editing the last one, since it's on a new page. Okay, It's all about.. Bride of Franky! <?php $relatives = array('mother', 'father', 'sister', 'brother','uncle', 'auntie'); $verbs = array('dislikes', 'sits on', 'licks', 'sucks', 'looks like', 'does', 'discusses the pros and cons of Web 2.0', 'loves', 'caresses', 'slides onto', 'hates', 'kisses', 'learns PHP with', 'has an AJAX interface with'); $animals = array('dogs', 'cats', 'horses', 'birds', 'giraffes', 'elephants', 'hippos', 'hamsters', 'gerbils', 'monkeys'); $adjectives = array('abhorrent','abject','abnormal','abrasive','absorbed','absurd', 'abusive','acrid','agonizing','ambiguous','ancient','apathetic', 'average','bad','barbarous','bawdy','belligerent','berserk', 'bizarre','black','boorish','brash','brawny','burly', 'callous','cold','colossal','combative','crabby','craven', 'crazy','creepy','crooked','cynical','demonic','deranged', 'devilish','direful','dirty','disagreeable','draconian','drunk', 'dysfunctional','erratic','evasive','evil','filthy','flippant', 'gaudy','giant','gigantic','greedy','grotesque','grouchy', 'gruesome','grumpy','guiltless','hellish','horrible','huge', 'hulking','icky','immense','irate','jaded','jittery', 'macho','maddening','malicious','mammoth','maniacal','massive', 'mighty','mindless','moaning','moldy','murky','mysterious', 'nasty','nauseating','noxious','oafish','obscene','psychotic', 'rabid','ruthless','sassy','scary','smelly','snobbish', 'snotty','spooky','threatening','tightfisted','tough','towering', 'trashy','ugly','unbecoming','unsightly','vagabond','vengeful', 'venomous','vulgar','wicked','wrathful','wretched'); function insult($secondary_person) { global $relatives; global $verbs; global $animals; $r_size = sizeof($relatives) - 1; $v_size = sizeof($verbs) - 1; $a_size = sizeof($animals) - 1; $r_rand = rand(0, $r_size); $v_rand1 = rand(0, $v_size); $v_rand2 = rand(0, $v_size); $a_rand = rand(0, $a_size); $insult = "Your {$relatives[$r_rand]} {$verbs[$v_rand1]} $secondary_person and {$verbs[$v_rand1]} {$animals[$a_rand]}"; return $insult; } class Greeting { function Greeting() { echo "Hello World!"; } } interface Singleton { public static function getInstance(); } interface Actor { public function speak(); public function meet($person); public function eat($animalArr); } abstract class Intestant_Abstract { abstract public function input($input); abstract public function output(); } class Stomach extends Intestant_Abstract implements Singleton { private static $instance; public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new self; } return self::$instance; } private function __construct(){ } public $kilosOfFood; public function input($input){ $this->kilosOfFood += strlen($input); echo 'Franky liky to eats '.$input.'..<br />'; if($this->kilosOfFood > (strlen(implode('',$GLOBALS['animals']))/1.5)){ $this->output(); } } public function output(){ echo '<br />Bhaarf..<br />'; } } class Guts implements ArrayAccess, Singleton { private static $instance; public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new self; } return self::$instance; } private function __construct(){ } private $intestants; public function add($name){ $this->intestants[$name] = call_user_func(array($name, 'getInstance')); } public function remove($key) { unset($this->intestants[$key]); } public function offsetExists($offset) { return isset($this->intestants[$offset]); } public function offsetGet($offset) { return $this->intestants[$offset]; } public function offsetSet($name, $value) { $this->add($name); } public function offsetUnset($offset) { unset($this->intestants[$offset]); } } class Franky implements Actor { private $person; public function meet($person){ $this->person = $person; } function eat($animals){ shuffle($animals); $guts = Guts::getInstance(); $guts->add('Stomach'); $guts['Stomach']->input(next($animals)); } public function speak($insult_them = false){ if($this->person == null){ $greet = new Greeting(); echo '<br />'; } else { echo 'Hello '.$this->person.'!<br />'; if ($insult_them) { echo insult($this->person) . '<br />'; } } } } if (isset($_POST['relativeName'])) { $relativeName = $_POST['relativeName']; $relativeType = $_POST['relativeType']; $h = new Franky; $h->speak(); $h->meet($relativeName); $h->speak(true); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); $monstername = $adjectives[array_rand($adjectives)]; echo "<br/>Franky wants to marry your $relativeType.<br/>"; echo "$relativeName will join the monster family and<br/>"; echo "$relativeName's monster name will be $relativeName the $monstername.<br/>"; } else { $person = $relatives[array_rand($relatives)]; echo <<<FORMINT What's your $person's name?<br/> <form action = '{$_SERVER['PHP_SELF']}' method = 'post'> <input type = 'text' name = 'relativeName' size = '10'> <input type = 'hidden' name = 'relativeType' value = '$person'> <input type = 'submit' value = 'submit'> </form> FORMINT; } ?>
  22. Yeah I meant no php5 on account of some people maybe people unable to test it if they don't have it installed, yes. But who cares. Cheating? Bah! I don't consider that cheating. In fact, I'm surprised the original "hello world" is still there. Why? Because I can put "Jesus" into the input field and it will in essence be do the same thing as before. p.s. - rewriting code to run more efficiently or "better" is okay too. I'm certainly not the most php saavy person here; for instance you guys' OOP skills are much better than mine. So if you feel like "Franky" is somehow being crippled because of his internals, rewriting/reorganizing is okay - to an extent. We don't want complete rewrites every single post, I guess. But, well..well for instance, exactly how redbull turned the simple "hello world" into a method inside a class. LoL, I ran the code and this is what I got:
  23. crap. i meant to say no php5 as well. oh well. i can do that. i guess if someone can't do php5 then tough titties. okay do you guys' posts ^ mean to serve as placeholders or what? nevermind, i will decide for you. unless your thread specificially states "placeholder/whatever" then it doesn't count as a placeholder. okay i just added something quick cuz i have to go soon: <?php $relatives = array('mother', 'father', 'sister', 'brother','uncle', 'auntie'); $verbs = array('dislikes', 'sits on', 'licks', 'sucks', 'looks like', 'does', 'discusses the pros and cons of Web 2.0', 'loves', 'caresses', 'slides onto', 'hates', 'kisses', 'learns PHP with', 'has an AJAX interface with'); $animals = array('dogs', 'cats', 'horses', 'birds', 'giraffes', 'elephants', 'hippos', 'hamsters', 'gerbils', 'monkeys'); function insult($secondary_person) { global $relatives; global $verbs; global $animals; $r_size = sizeof($relatives) - 1; $v_size = sizeof($verbs) - 1; $a_size = sizeof($animals) - 1; $r_rand = rand(0, $r_size); $v_rand1 = rand(0, $v_size); $v_rand2 = rand(0, $v_size); $a_rand = rand(0, $a_size); $insult = "Your {$relatives[$r_rand]} {$verbs[$v_rand1]} $secondary_person and {$verbs[$v_rand1]} {$animals[$a_rand]}"; return $insult; } class Greeting { function Greeting() { echo "Hello World!"; } } interface Actor { public function speak(); public function meet($person); } class Franky implements Actor { private $person; public function meet($person){ $this->person = $person; } public function speak($insult_them = false){ if($this->person == null){ $greet = new Greeting(); echo '<br />'; } else { echo 'Hello '.$this->person.'!<br />'; if ($insult_them) { echo insult($this->person) . '<br />'; } } } } if ($_POST['name']) { $h = new Franky; $h->speak(); $h->meet($_POST['name']); $h->speak(true); } else { echo <<<FORMINT What's your best friend's name?<br/> <form action = '{$_SERVER['PHP_SELF']}' method = 'post'> <input type = 'text' name = 'name' size = '10'> <input type = 'submit' value = 'submit'> </form> FORMINT; } ?>
×
×
  • 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.