trq
Staff Alumni-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Everything posted by trq
-
Looking for best practice regarding paths in include/require
trq replied to martin05rc's topic in PHP Coding Help
You need to be careful when setting your include path that you don't wipe out what was originally in there. This may prevent you from using things like pear. So, instead of.... <?php set_include_path($_SERVER['DOCUMENT_ROOT']); ?> You might want..... <?php set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT']); ?> I would also be more inclined to actually put the common directory on my path if that's where all your common functionality lives. -
Script to Remove Footer if accessed from a different domain
trq replied to datoshway's topic in PHP Coding Help
No, that would not work. Firstly, because $_SERVER['HTTP_REFERER'] should always be set, and secondly, because it has nothing to do with determining what domain your site is being accessed on. Did you read my previous reply? -
ps_show_boxed has nothing to do with html. Yes, you warp your results in whatever html is needed to create the effect your looking for.
-
Looking for best practice regarding paths in include/require
trq replied to martin05rc's topic in PHP Coding Help
You would be much better of looking into set_include_path then putting all your libraries within your include path. -
Oh, and no, you can't leave that line blank. You would need a pattern that matches all. See http://www.perlcode.org/tutorials/procmail/regular_expressions.pod As for standard in, see http://php.net/manual/en/features.commandline.io-streams.php
-
I believe you would also need to use the global procmailrc file not just the one within your ~/ directory.
-
Script to Remove Footer if accessed from a different domain
trq replied to datoshway's topic in PHP Coding Help
You can check for the domain name using $_SERVER['SERVER_NAME'] -
echo it. Then in jQuery you need to create a function to handle the response.
-
Is there a way to have multiple instances of 'while'?
trq replied to soma56's topic in PHP Coding Help
Scripts execute from top to bottom, what exactly do you expect to happen? -
The second line is where the pattern matching happens. You'll find plenty of tutorials around for this. The contents of the email will show up in the standard in of your php script.
-
There should be plenty of examples of this around on the net, but basically, in ~/.procmailrc you use patterns to match email addresses (or subject lines) and determin what to do with the email (generally sending them to a different inbox). This can be used to pipe an email to a php script. eg; :0: * ^To.whatever@foo.com | /usr/local/bin/script.php
-
Building website on windows localhost, will it work on linux server?
trq replied to shortysbest's topic in Linux
WAMP uses the same php as (most of) the rest of us. -
Help installing php on virtual server
trq replied to ben2468's topic in PHP Installation and Configuration
Assuming your talking about a VPS you need to login to that machine and install php. You can't simply map it to a network drive and execute an installer to get it installed. You need to provide much more information because at the moment, the steps you have described do not make allot of sense. -
Where? You don't.
-
Again, you are not calling the parents __construct().
-
Yeah I am, I just missed copying and pasting it on the site. If your not going to post your actual code we can't help. Were not here to play guess.
-
Post your current code.
-
This has nothing to do with php. You'll want to look at the 'sticky bit' setting on the directories in question.
-
Yes, more than likely such a script exists. However, this board is for help with code, not help looking for it.
-
In reality, you really should learn php progressively. Starting with the basics then moving forward to more advanced stuff. Jumping all over the place learning this and that is a recipe for picking up bad habits and poor practices. There's a free book/wiki in my signature (Hudzilla) that's pretty good.
-
There is an Include directive available within the Apache config files. This directive also allows wildcards. So, you could use something like.... Include /var/www/vhosts/*.conf Within your httpd.conf file. This would make it much easier as you could now use php to simply create new .conf files (one for each vhost) within /var/www/vhosts This is similar to how my CMS used to work.
-
The web doesn't really work like that. Your response is generally built and then sent. You can muck around with output buffering but its pretty unreliable at best.
-
Looks like you want to take a look at imap.