|
fletcher posted:I've had a dedicated server for a few years from them and I've registered all my domains through them, never really had an issue. I think the main complaint about GoDaddy is they are pretty aggressive with selling poo poo. You won't be able to talk to them on the phone without them trying to get you to renew poo poo in advance, and you can't buy a domain through their website without them trying to nickel and dime you every step of the way. I'm guessing this is why they are the most popular registrar though. Gotta make money, right? Their dedicated servers are somewhat better than their shared hosting, although there are still several companies I'd prefer to lease from than GoDaddy. As for the mail problem, last I remember, GoDaddy requires all automated mail to use a particular mail server, which their shared servers aren't configured to use from the PHP mail() function. You should be able to configure a mail library that supports SMTP, like PHPMailer or SwiftMail, to use their required configuration. Search their FAQ. It's in there somewhere.
|
# ¿ Apr 13, 2010 02:27 |
|
|
# ¿ May 16, 2024 10:51 |
|
drcru posted:True, how do you guys do it? I've never tried before. What exactly do you need, whether it's more or less than what PHP provides, or just plain different? For example, in the template system I use for my framework, one of its primary benefits is to guarantee well-formed XML. Maybe you give a poo poo about that, maybe you don't. Or maybe you just want to limit what your designers can do in the view portion of an MVC architecture. Like you want to make sure that arbitary SQL queries aren't executed at render time. That's a worthwhile goal, but do you need to enforce it in a secondary/proprietary domain language, or is a mandated convention good enough? Lots of people will tell you that PHP is already a templating language, so you might as well use it directly instead of adding another layer to it. They're kinda right, but here's the rub: PHP, straight out the box, is an astoundingly lovely templating language. Anyone who works with MVC in PHP long enough will eventually want a more practical way to abstract the view, and the only people who think "plain PHP is good enough" are either inexperienced hacks or Rasmus Lerdorf himself. Smarty is a lovely alternative because it's just PHP with a different syntax. Useful for limiting what can be performed in a view, but so bad at it that most implementations let you embed PHP into the templates anyway. Long story short: there's no way to make this story short. Here be dragons.
|
# ¿ Apr 25, 2010 08:08 |
|
gwar3k1 posted:I haven't looked into templating, but if short tags are removed, how do you output dynamic content without also producing the html on the fly? immediate answer: <?echo $variable?> and <?= $variable?> are the same when short tags (i.e. <?= ?>) are permissible short answer: i output dynamic content by using mature libraries that actually do important stuff like sanitization long answer: holy poo poo, are you serious? is the state of online php tutorials still that loving terrible, or did you stop reading them in 1998?
|
# ¿ Apr 28, 2010 02:23 |
|
KuruMonkey posted:Don't save the actual image data itself in a db. Save the image as a file, store the path to that file in the db. this this this this this this this
|
# ¿ Aug 11, 2010 03:06 |
|
Mackerel, the Thief posted:This seems a bit complicated to me. Why not simply reference the text directly in the function and use the md5 hash of the string as the lookup key on the table? A fixed key can be useful, for example, in case the REQUEST_LOGIN phrase changes from "Login required" to "Please log in to continue."
|
# ¿ Aug 24, 2010 21:48 |
|
Plorkyeran posted:Well yes, and I already agreed that there are potential performance issues and that you should hash them if it does turn out to be a problem, and I would rather hope that anyone working on a site large enough that the performance impacts are foregone would have to ask basic questions about how to handle translations. Is there some problem caused by very long keys other than potential slow performance and the extra storage space? Potential slow performance is much more likely to be a problem than extra storage space. Also, 400-character keys are just a big pain in the rear end to work with. A key like "terms of service" is going to be a lot easier to remember, and a lot more contextually relevant whenever the copy needs to change, than a paragraph of legalese.
|
# ¿ Aug 25, 2010 09:11 |
|
Lumpy posted:If they can change the file you are using now, they can change a file like this: My concern about letting them update a PHP script is that typos could cause fatal errors. If a non-technical user sees a web page that looks like this: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /var/www/html/errors.php on line 384 ...it might as well be an air horn commanding them to have a panic attack.
|
# ¿ Aug 31, 2010 23:33 |
|
Doctor rear end in a top hat posted:Now that I've made myself look like an idiot, I should mention that there's only one scenario I've used it for. The fact that your example is too trivial to expose much of an attack vector doesn't change the fact that it's a terrible habit with the potential to open crippling security holes. It is not safer than turning on register_globals. Please do not recommend it.
|
# ¿ Sep 7, 2010 15:02 |
|
Golbez posted:You don't have to declare anything in PHP. $i = 5, $s = 'fnord', etc. With strict errors enabled, referencing an undefined variable triggers a notice. Also, as McGlockenshire demonstrated, it can cause unexpected problems elsewhere and make your code harder to debug. You can get away with it, but it's not best practice.
|
# ¿ Sep 15, 2010 23:14 |
|
Golbez posted:Referencing, yes. Setting to, no. If I did "echo $foo[1]" before declaring $foo, that'd throw a notice. But doing "$foo[1] = 'bar'" won't throw an error, even if $foo hasn't been declared. So far as I know. Yeah, you're right. Setting $foo[] or even $foo[1] will quietly declare $foo as an array. But that doesn't change the case where $foo is unset because the loop that would have populated it never iterated.
|
# ¿ Sep 16, 2010 18:38 |
|
Unacknowledged posted:I'm using a form to distribute free / paid copies of my band's new album. I've got my file headers setup correctly as far as I can tell, however, the transfers almost always get cut off. The file sizes of the 3 different zips range from 68MB-454MB, however none of the transfers of these files ever complete, so I don't think the size is relevant (though what the hell do I know). Also, I'm only sending 1 at a time in case my wording is bad. It sounds like the script is timing out. The default time limit is usually 30 seconds. You should be able to change max_execution_time in php.ini or use the set_time_limit() function. http://us.php.net/function.set-time-limit
|
# ¿ Sep 28, 2010 05:18 |
|
McGlockenshire posted:You don't need no steenking template engine. The rant is prehistoric but accurate. prehistoric, yes. accurate, no. php tries to be a programming language and a templating language at the same time, and that's why it sucks. you need to use a framework to fix its liabilities. it could be an existing framework like codeigniter, or it could be something you accidentally start building out of sheer necessity. by the time your framework is stable, you'll realize that php in the view is too likely to gently caress it up, so you might as well plan a dsl from the get-go and save yourself infinite tears... even if your dsl is just a subset of php that the framework sanitizes "php everywhere" is the worst thing you could recommend for an application with wide deployment. the second worst is smarty
|
# ¿ Feb 25, 2011 04:47 |
|
McGlockenshire posted:Implementing a template language or even a freaking dsl on top of a language that does a perfectly adequate job at templating is just as insane as saying that you "need" to use a framework. That's the rub, though. I think PHP is a sloppy and unwieldy language for templates. Maybe it's just personal preference, but I'd rather have a templating system between the controller and the view. I suppose you don't "need" to use a framework, but the practicality of a framework increases with the complexity of the project. bobthecheese posted:OK, in terms of templating systems that I've actually LIKED, phpTAL is an oft-forgotten option. I agree. phpTAL's a good one.
|
# ¿ Feb 25, 2011 16:06 |
|
KuruMonkey posted:1: frameworks and template engines are not the same thing; saying using one is dumb does not imply saying that using the other is dumb. I mentioned both because I was responding to this: mcGlockenShire posted:Implementing a template language or even a freaking dsl on top of a language that does a perfectly adequate job at templating is just as insane as saying that you "need" to use a framework. KuruMonkey posted:2: re-implementing a subset of PHP's features in PHP but meanwhile inventing a new syntax to do it with, and parsing that syntax in PHP, is both dumb and redundant. Using PHP for templates is dumb and fragile.
|
# ¿ Feb 25, 2011 17:51 |
|
SETEC Astronomy posted:Sorry, I'm at work right now, so I can't verify it. I appreciate your humoring me, though. Based on your description of what you're doing, I suspect that you would be better served by session variables. Maybe I'm wrong, but if you're willing to go into more detail about what you're trying to do, someone might be able to recommend a better (and MORE SECURE) solution.
|
# ¿ Mar 2, 2011 02:54 |
|
Hammerite posted:Actually - scratch this comment. I've never used the mysql library and I'm not 100% confident that what I wrote here is true. MySQL accepts quoted numbers and treats non-numeric strings as zero.
|
# ¿ Mar 15, 2011 19:38 |
|
Black Eagle posted:Changed to decimal and updated the table. Works now. Why wasn't it working? I'd guess it's a precision error. Floats are only accurate to a certain degree of precision. (One obvious example: the precise value of 1/3 is impossible to store as a terminating [hexa]decimal, so it gets rounded to 0.33333333333333. Close, but not exact.) Because of this, precision errors sometimes occur during data type conversions, especially when they're getting passed between different systems. In other words, the representation of 1.2 that came from PHP may not be exactly equal to the representation of 1.2 that got stored in MySQL.
|
# ¿ Jun 13, 2011 00:46 |
|
Doctor rear end in a top hat posted:PHP tries to be 'helpful' and assumes you meant the string 'bareword', which would evaluate to true. I've read numerous times that this 'feature' is going to be removed in upcoming versions. I think they're hesitant because a lot of terrible programmers use this and their poo poo will break. It's definitely a dumb "feature" but at least it triggers an E_NOTICE.
|
# ¿ Jun 23, 2011 17:33 |
|
Yay posted:This latter method demonstrates why your original code won't throw errors (though it may throw warnings/notices; I really can't remember) php:<? function foo() {} function bar($baz) {} foo('bar'); // No errors bar(); // Throws a "missing argument" warning (in 5.3, at least) ?>
|
# ¿ Sep 21, 2011 20:36 |
|
Optimus Prime Ribs posted:Is it not possible to create a reference to a function in PHP? Yes, but the variable needs to be a string representation of the function name: php:<? $fooFunc = 'foo'; $barFunc = 'bar'; ?>
|
# ¿ Sep 21, 2011 21:16 |
|
Optimus Prime Ribs posted:All right, that makes sense. Hahaha, I wouldn't have been surprised if that worked, but apparently it doesn't. The string has to be in a variable, not a literal or a constant.
|
# ¿ Sep 21, 2011 21:30 |
|
Knyteguy posted:Those CI functions do sanitize the form data (for the most part). $this->input()->post() does NOT sanitize for queries. You should either escape the values or use query binding (http://codeigniter.com/user_guide/database/queries.html).
|
# ¿ Mar 27, 2012 13:20 |
|
Fleur Bleu posted:I'm just looking things up as I go along, so I started with mysqli. If I have enough time I'll try and do everything in PDO instead. The manual has a lot of options, which is good, but I lack the knowledge to make the right choices. Mysqli also supports parameterized queries (although I prefer PDO's syntax). You're better off using those instead of escaping all the input and building the raw statement in code.
|
# ¿ Oct 23, 2012 21:22 |
|
The Gripper posted:There's one thing about mysqli_stmt_bind_param() that can just gently caress right off: the first paramater being $types. YES. I've used a wrapper around Mysqli that treats every parameter like a string, and I don't think there's even one example of the conversion causing different results. It's a completely worthless interface wart.
|
# ¿ Oct 24, 2012 02:01 |
|
Golbez posted:You're thinking of the ID that identifies the session. We're talking about a check number that gets saved to the session. $_SESSION is server-side, it never goes to the cookie. In the example that DarkLotus provided and baquerd referenced, the token is a hash of session_id(), which is constant for the duration of the session.
|
# ¿ Oct 31, 2012 20:19 |
|
The Gripper posted:I think if you make multiple inputs with the same name, PHP will create an array from the $_GET or $_POST vars where duplicates are available. So really all you'd need to do is duplicate an <input ...> </input> block with the same name and submit away. Close. If they have the same name, the value in $_GET/$_POST will simply be the last one received; but if you bracket the end of it (e.g., <input type="text" name="website[]" />), all the values will be appended to an array. php:<?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { print_r($_POST); } ?> <form action="" method="post"> <input type="hidden" name="foo" value="one" /> <input type="hidden" name="foo" value="two" /> <input type="hidden" name="bar[]" value="one" /> <input type="hidden" name="bar[]" value="two" /> <input type="submit" value="Post" /> </form> code:
|
# ¿ Jan 23, 2013 01:57 |
|
teethgrinder posted:Does anyone have a suggestion for a(n API) documenter? Been messing around with phpDocumenter, but it's kind of low-rent. My boss wants something that looks like Yii's: http://www.yiiframework.com/doc/api/ Zym has a nice template for phpDocumentor that's similar to Yii's design: http://zymengine.com/dev/news/30-phpdoc-extjs-converter-template
|
# ¿ Mar 6, 2013 23:29 |
|
mooky posted:I want to use it to send notifications to users regarding their account. An opt-in SMS message option. Twilio can give you a dedicated number starting at $1 a month. A shortcode is a four-to-five-digit number you can use for SMS instead of a phone number, like the ones American Idol uses for voting. They start around $1000 a month. There's a PHP SDK for the Twilio API. Very easy to use. I got a trial account and had a demo app working in a few hours.
|
# ¿ Apr 20, 2013 03:29 |
|
IcedPee posted:I don't foresee it being a very big deal. This seems... familiar. And not in a good way You're best off mirroring your production environment as closely as possible. If it's a LAMP, set up a LAMP for development. A WAMP might come close enough, but you'll probably run into platform exceptions every now and then. If you're a big fan of unnecessary cross-platform debugging against a unique production environment and endless futility headaches, go ahead and use IIS.
|
# ¿ Nov 7, 2013 21:37 |
|
|
# ¿ May 16, 2024 10:51 |
|
Vintersorg posted:Any recommendations for PDF generation? One of the guys here used to use FPDF but I am reading about TCPDF being a better alternative. I've had good luck generating PDFs from HTML with dompdf.
|
# ¿ Nov 26, 2013 17:46 |