Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. okay, the problem with php is that php parses everything and then sends the output (if any) back to the client. So, it is not a "real-time" scripting language. But there are some tricks you can do to fake it, depending on your needs. One trick is flushing what's currently in the output buffer to the browser before the script is done processing. You can do that by echoing whatever message you want, then using ob_flush, then send out the emails. So the message will display before the script is actually done sending emails.
  2. problem is the line before it is missing a ; it helps if you actually post what the error is (or you know, actually read the error).
  3. You can echo out a "loading" or "processing" message and use ob_flush to send it to the browser before the script is done executing. Or you could use js/ajax to send the form info bits at a time, displaying progress bar or whatever, as each batch gets sent.
  4. how about posting how you tried to implement that solution.
  5. I would suggest using proper flash object/param/embed html. different browsers load it up differently. Google imbedding swf.
  6. The point Daniel was making is that no, there is no way for a server-side language to directly check if a file exists on the user's computer. Javascript has limited capabilities for this, but user has to have permissions set to allow for it. Also, as Dan pointed out, you can use Java to make an applet (or similar item, like an ActiveX control). But that involves the user allowing it to run and giving it permission to do it. So basically to make a long story short, no, there is nothing available for a server to just check what's on a user's computer without them knowing. And no, javascript cannot somehow utilize a form file field (the "browse" button thing you mentioned). It is programmed not to be able to. If you're trying to be sneaky about it, I suggest you write some applet or activeX control or some browser addon or some stand-alone app that's novel or hip or "useful" and get the user to click on some ToS with really fine print very obscurely written, that says your little "widget" can/will do something like that. That is, if you have no problem sleeping at night doing that sort of thing.
  7. and don't forget to make it reset if user enters in right name/pw.
  8. the same way you loaded the iframe up in the first place. Only add the var to it echo "<iframe src='blah.php?variable=" . $variable ."'></iframe>";
  9. how should we know whether the string is a series or not? That's just random data to someone on the outside. You need to explain what in the string makes it a series or not. Same thing with your question about whether its a release or not. Sure, I could tell that the last 2 don't have dots in it, so check if there's dots in there, but that may or may not help you. How would I know whether releases in general would have dots in them or not? It's all just random arbitrary data to us outsiders. In other words, you need to explicitly define what constitutes a series and release.
  10. QFT.
  11. considering he forgot the semicolon on the line before the echo, it won't even do that.
  12. in your database > table where you setup the column you can assign a default value. I'm kind of curious as to why you are hardcoding an array only to turn around and implode it though...why not just format it the way you want to to begin with...
  13. constants you can redefine are called variables.
  14. so..you can't decide whether this is a php or sql question, so you opt for option #3: post in the site comments forum that practically jumps right off your screen screaming at you DON'T POST CODING PROBLEMS HERE. brilliant. I have a sneaking suspicion I know what the real issue is... thread closed.
  15. "level system" is pretty ambiguous... care to be more specific?
  16. http://www.phpfreaks.com/tutorial/php-add-text-to-image
  17. 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.
  18. I believe thorpe is working on something like that right now. Don't have an ETA or anything.
  19. 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.
  20. 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.
  21. Basic Database Handling
  22. 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; } ?>
  23. 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:
×
×
  • 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.