Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. You're doing file_get_contents() on a directory. Think about that.
  2. Then you didn't set it in the right place. Are you sure it was the right php.ini? What does phpinfo() say about the INI files parsed (at the top) and the various settings (in a big section later)?
  3. Multiplication, not addition. 2 studies * 3 prescriptions = 6 rows.
  4. Yeah, that's about it. The rewriting turns the friendly URL into something that PHP can deal with (more easily), then the script uses $_GET and such to do whatever it needs to do.
  5. You also need to manually chmod 0777 the parent folder (the one in which you're creating the uploads/ folder). Don't forget to change it back to 0755 when you're done.
  6. You're calling htmlspecialchars() or htmlentities() too many times. The only time you should ever call those functions is immediately before you output something into HTML/XML. Not when you put stuff into the database. Not just after pulling it out. Right at the moment you echo or print out the strings.
  7. Only the owner of a file can change its permissions.
  8. That is one of the few error messages where the line number (generally) doesn't matter. Your script that times out - what does it do?
  9. To start with, /\*(\d+)\*/
  10. Uh yeah, I did too. $uploadDir + $targetFile = $targetDir, right?
  11. That's what I'd do. Not just for the name collision: if you used just one of those somewhere you'd have to alias it anyways because a name like "Standard" isn't helpful. use Proem\Service\StandardServiceManager, // unless there's a lot of Managers I'd remove the namespace level for them Proem\Signal\StandardSignalManager, Proem\Filter\StandardFilterManager; (though personally for those types of classes I prefer a -Base suffix over a Standard- prefix, like ServiceManagerBase, if even anything at all)
  12. I'm not sure how much I can comment on what you have now but I think I like the current structure more than the original. It took me a while to realize that namespaces aren't just about class paths but about grouping of classes; to take what I have as an example, /Mvc/Controls/Control.php (\Mvc\Controls namespace, Control class) makes more sense to me than /Mvc/Control.php (\Mvc namespace, Control class). Couple other miscellaneous comments on what I do: - I also name interfaces as IInterface and traits as TTrait (I'm writing for 5.4) so it's obvious what things are - I even name files as (class|interface|trait).name.php, but it's the first time I've done something like that so I might change that later I don't have very many files to show off as the current version of my framework is still quite young and very specialized, but here's my version of the original (and shorter) file list: /lib/Proem/Api - /Assets - class.Asset.php (abstract? base class of IAsset) - class.AssetManager.php - interface.IAsset.php - /Chains - class.Chain.php (abstract? base class of IChain) - class.ChainEvent.php - interface.IChain.php - /Events - class.Event.php (abstract? base class) - class.EventManager.php - /Utility - /Options - class.Option.php (abstract? base class) - class.OptionsCollection.php (convention I've borrowed from .NET) - class.Callback.php - class.Queue.php - class.Autoloader.php - Proem.php (sounds like a bootstrap/prepend file)
  13. $targetdir is what you need to modify. Keep in mind that $uploadDir is just "/images/" and the $_FILES bit is just a filename (with an extension).
  14. Well... you don't need it. $first_number = $_REQUEST['price']; $second_number = 20; $sum_total = $first_number + $second_number; $direct_text = 'The two variables added together = '; print ($direct_text . $sum_total);
  15. Why are you quoting the price as if it were about to go into a database? Because it's not about to go into a database.
  16. Rewrite what and why?
  17. Actually yes: look at the initial characters of the outputted hash (how many of which depends on the hashing algorithm). But you did notice that you can pass crypt() your own salt, right?
  18. If the string actually includes "renderOptions" then you're pulling from the wrong page. You should be getting strictly JSON back: {"results":[{"locations":[{"latLng":{"lng":-112.35984,"lat":34.58752},.....
  19. You wouldn't have to use eval() for it. Just access it through the window object. window["itm" + i].model Ah, the flexibility of JavaScript.
  20. The namespace does add a bit of complexity, but it's still easier to deal with it than to use an array. $xml = new SimpleXMLElement( card 12345KKLS 709750ba-b9b6-44c4-9812 70 USD 2011-05-11T07:41:44.957 4 e0c66bae-c423-43c6-b896 50 USD 2011-05-11T07:42:13.55 2 XML , 0, false); $xml->registerXPathNamespace("ns", current($xml->getDocNamespaces())); $node = current($xml->xpath("//ns:Payment[ns:StatusID=4]"));
  21. Just like in PHP, don't use multiple numbered variables - use an array. // create the various objects var porche = new Object(); porche.make = "porche"; porche.model = "boxter"; // put them into an array itm = [porche]; // then loop over it for (var k in itm) { $("#writer").append(itm[k].model + " "); }
  22. Have you written any code to actually get the information from the database? What is it?
  23. I myself am a fan of doing as much work in PHP as is reasonable, so $start = mktime(0, 0, 0); $end = mktime(23, 59, 59); $query = "SELECT * FROM contacts WHERE lastupdated BETWEEN $start AND $end";
  24. That's an okay query if you get one day's events at a time. But it means ~30 queries just for that. SELECT * FROM calendar WHERE `date` >= first of the month AND `date` That will get you everything in one query. Inside your for loop you need to iterate over that resultset. Keeping the [code=php:0]$row_Recordset1 = mysql_fetch_assoc($Recordset1);
  25. Well yeah. All your code does is get one single row. And it might not even be in the time range you're displaying. You need the right query, one that only pulls events from the database if they're on the calendar you're trying to show, and then you need some logic in the for loop to advance through the rows as you advance through the days. So what query do you think you should use? It needs a WHERE and an ORDER BY at a minimum.
×
×
  • 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.