-
Posts
15,266 -
Joined
-
Last visited
-
Days Won
431
Everything posted by requinix
-
There are two lines there. TWO LINES. How can you not proofread them?
-
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
-
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.
-
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.
-
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.
-
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.
-
Change input name on selection change in a drop down
requinix replied to ebolt007's topic in Javascript Help
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. -
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!
-
$_SESSION['session key'] = $variable; Am I missing the question?
-
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).
-
You're doing file_get_contents() on a directory. Think about that.
-
Problems joining three tables and grouping by and having count
requinix replied to raymond_feliciano's topic in MySQL Help
Multiplication, not addition. 2 studies * 3 prescriptions = 6 rows. -
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.
-
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.
-
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.
-
Only the owner of a file can change its permissions.
-
Maximum execution time of 30 seconds exceeded
requinix replied to kranthy's topic in PHP Coding Help
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? -
To start with, /\*(\d+)\*/
-
Trying to get this PHP upload code to rename the file.
requinix replied to Vinlock's topic in PHP Coding Help
Uh yeah, I did too. $uploadDir + $targetFile = $targetDir, right? -
Which directory structure / naming convention do you prefer?
requinix replied to trq's topic in Miscellaneous
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) -
Which directory structure / naming convention do you prefer?
requinix replied to trq's topic in Miscellaneous
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) -
Trying to get this PHP upload code to rename the file.
requinix replied to Vinlock's topic in PHP Coding Help
$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). -
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);
-
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.