Jump to content

requinix

Administrators
  • Posts

    15,266
  • Joined

  • Last visited

  • Days Won

    431

Everything posted by requinix

  1. There are two lines there. TWO LINES. How can you not proofread them?
  2. This topic has been moved to mod_rewrite because that's where it belongs. Even though it has a really, really ridiculously easy answer. http://www.phpfreaks.com/forums/index.php?topic=359931.0
  3. Putting aside the fact that it's stupid, it's not even possible. You cannot log someone into a site that isn't yours. The closest you can get is basically proxying the site but that's a very bad idea, and quite possibly against the ToS.
  4. You're outputting a whole bunch of HTML before you even get to the image resizing part. That's not good. Move it to the very beginning - before the HTML, before the header, before any code that would output something.
  5. Uh no. It should be $getspdi. However the $getspd = mysql_fetch_array($getspdi); line is a problem. It'll make the loop skip the first row in the resultset. Get rid of it.
  6. The only time the address bar will change URL is if in a RewriteRule you (a) use the [R] flag or (b) give a full destination URL including http:// and whatnot. So if you don't do either of those then the URL as shown to the user will not change.
  7. I don't understand why you have to change the input name. Can't you just figure that out in the script? It's not like the form submission can be trusted anyways.
  8. 1. Add a wildcard DNS entry for *.domain.com that points to www.domain.com. 2. In your .htaccess, do URL rewriting with the added stipulation that the hostname (%{HTTP_HOST}) must match the "www.([a-z0-9]+).domain.com" pattern. You can pass the name to your PHP script with %1, or have it determine the hostname itself. 3. ??? 4. Profit!
  9. $_SESSION['session key'] = $variable; Am I missing the question?
  10. Use file_exists when building the list. Or track in the table whether the file should or should not exist (and if they should always then there's something wrong).
  11. You're doing file_get_contents() on a directory. Think about that.
  12. 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)?
  13. Multiplication, not addition. 2 studies * 3 prescriptions = 6 rows.
  14. 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.
  15. 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.
  16. 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.
  17. Only the owner of a file can change its permissions.
  18. 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?
  19. To start with, /\*(\d+)\*/
  20. Uh yeah, I did too. $uploadDir + $targetFile = $targetDir, right?
  21. 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)
  22. 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)
  23. $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).
  24. 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);
  25. 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.
×
×
  • 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.