nt to stderr instead of stdout.
You need to redirect stderr output to stdout in the command...
exec('apache2ctl graceful 2>&1', $output, $exit);
Also, in my experience it's better to provide the full path to anything
you shell out to from PHP, especially if it's go
it does not
exist but is there a way of wrapping in in a switch statement or funtion so
the variable is only used when $_REQUEST['text_size']; actually exists.
http://php.net/isset
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jochem Maas wrote:
heck it's monday what you expect ;-) (I have the same excuse for fridays)
I use the same excuse Tuesday to Thursday, I find that, on balance, it
works better for me.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.ph
27;foo' once.
seems like whatever Dave's problem was it's actually down to
missing ctor args.
Indeed, my bad. When I think about it it actually doesn't make sense for
it to be called. Seems to me like the OP needs to be using the __wakeup
magic method to re-initialise his object
class Foo
{
public __construct($param = null)
{
if (!is_null($param))
{
// Parameter passed, do something with it
}
}
}
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
how you intend to use these arrays to give a definite answer.
As far as scope goes, if you want to create these variables in the
global scope, create them as elements of the $GLOBALS array
[http://php.net/manual/en/reserved.variables.php#reserved.variables.globals].
-Stut
--
PHP General Mai
??
And just in case you do find some mug willing to work for you for
nothing, if you're going to be releasing the source you need to do that
before asking them to find holes. Having the source code makes it a lot
easier.
-Stut
--
PHP General Mailing List (http://www.php.net/)
T
Ok, just to shut you all up, I managed to convince the OP earlier today,
but it never made it to the list...
Michael wrote:
At 02:58 AM 11/17/2006 , Stut wrote:
Michael wrote:
This will be my last post on this thread of discussion.
Thanks to all who replied, I have it figured out
start();
// If needed you can set up vars used by player.php here
include('player.php');
$code = ob_get_contents();
ob_end_clean();
That will capture any output from player.php and stuff it into $code.
Much nicer than anything else suggested so far.
-Stut
--
PHP General Mailing List (htt
o undo the formatting?
As another test, I did settype($fee2, "float")then the gettype($fee2) and
got 'float' on the standalone page and NULL on my Smarty page.
Sounds like a question for the Smarty mailing list.
-Stut
--
PHP General Mailing List (http://www.php.net
of any other reason that would work
remotely but not locally.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
#x27;m not sure what you mean by "in my display price". Please elaborate?
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
displayed as
expected...
http://dev.stut.net/php/pitcher.php
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
2 and
true, 3 and true, etc.
3) to get feedback from the community and deepen my understanding of PHP.
I'm trying ;)
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ct that the value
you are comparing has come from strpos, it is a basic language feature.
And it's not my opinion, it's a fact.
If that doesn't make it clear then I really don't know what will.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
g this behavior PLEASE let me know, I
am no PHP "Guru" and I have no ego, and will humbly retract this post if I am
wrong. I would just like to know WHY and WHERE I am wrong :)=
You're not doing anything wrong, you're just not quite getting the
meaning of === and !== as op
!== works , why does === not?
I think you need to re-read the docs for ===.
0 !== false
0 == false
1 == true
1 !== true
only...
false === false
and
true === true
The === and !== check both value and type, so 0 and false are different.
Hope that helped.
-Stut
--
PHP
rt time
* go back in the array from that point to find your 5
* if you hit the start of the array, go down a day, repeat the glob and
start from the end of the new array
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
nternal
private vars differently and have __get() translate the external name to
the internal name.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
y the
time it fails they've already replaced your index.php and potentially
installed a rootkit, backdoors and whatever else (depending, of course,
on how locked down the web server is and your file permissions).
Hope that makes sense now.
-Stut
--
PHP General Mailing List (http://www.p
moron (and probably have little morons for kids), and live
like a moron and spam like a moron you still have enough brains to figure out how to use
present day software
I seem to deal with a lot of customers who could provide a lot of
evidence for the opposition to that assertion!
-St
\)?
$dir = dirname(__FILE__);
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Stut wrote:
This is a question of design, not a question of whether to use OOP.
For example, in several of the sites I maintain I have classes that
inherit from a base class called Table. The base class provides a lot
of the basic methods for working on a table (think ActiveRecord). It
also
erver) would have contained a virus.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
one of nearly 100 that get included in a script has taught me that there
is no greater feature in PHP!! I never use a closing ?> if PHP script is
the last thing in a file - less headaches all around.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://
ing
like this in the internet, but can't remember where :(
XML is not a protocol, but that's really not the point.
Have a look at the CURL functions: http://php.net/curl
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
eaning the outer
loop will never end since it gets reset in the inner loop.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
only at the FIRST comma.
explode(',', $line, 2);
http://php.net/explode
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
f the think-tank that is this
list?
There is no way to get the client date/time/timezone on the server-side
unless you have something on the client to give it to you, Javascript
being the obvious example.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://
tion
bypasses that setting and gets the timezone as set on the machine.
Example: http://dev.stut.net/php/date.php
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
e the
server datetime not the client.
-Stut
On 11/3/06, Dotan Cohen <[EMAIL PROTECTED]> wrote:
How does php decide what timezone a user is in? Although I am in
Haifa, Israel (GMT+2), when I go to a page with date("e") I get
"America/New_York" displayed.
To confirm, could
tatus response. Try swapping your two header calls.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
morally abhorent, rather better as in more money - although
if
you can achieve both all the better for you :-)
Plus, being forced to use Windows is not a reason not to use Apache!!
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lace the words rather than just the strings then you
need to look at preg_replace (http://php.net/preg_replace) and you'll
need to decorate the strings in $noiseArray with the appropriate
characters to make them the search pattern you need - full details on
the preg_replace manual page.
-Stut
of code rather than fixing
it according to several other previous posts...
"^".$noiseArray."$"
Happy happy joy joy, oh look, the spring's broken. Doing!!
-Stut (slightly drunk, but feeling generally good about the world)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
doing a lot with each element of the
array it's easier to do it without using array_walk.
foreach ($arr as $key => $val)
$arr[$key] = "\\b".$val."\\b";
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
you need - full details on
the preg_replace manual page.
Hope that made sense.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ikely to find a better source of help
than the 'official' PHP lists, but I really don't care enough about
where you go for help.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
eed to set the socket non-blocking after
the connect. You cannot do a non-blocking connect.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
t doesn't matter.
Small suggestion though... rather than falling back to the evils of
mod_rewrite, enable multiviews and you can have URLs such as...
staff/engineering/data.json
Or whatever filename you want.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
span a chunk of text within a block. Divs are intended to describe the
block.
Not really relevant to the discussion, but worth pointing out.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
but a different host
header for each domain. Requests for each domain will then be directed
to that same site.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
each file, find assignments to the $arrHede array and pull
out the values. Have you even tried to do that yet? We're not here to
write scripts for you. Try it and come back if/when you have problems.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
== "2" ) }
2
} ELSE {
2
}
?>
etc.
Dang that's painful!! Try this...
'.$day.'';
}
?>
I added a value to the options (you knew that was missing right?).
Obviously you need to output the and outside this
loop.
-Stut
--
PHP General Mailing List
get stdout and stderr messages ?
The 2>&1 syntax redirects stderr to stdout, it does not do anything with
stdout. So yes, you will still also get stdout messages.
This no longer has anything to do with PHP. I suggest you Google for
info on Linux pipes.
-Stut
--
PHP General Mailing List
uuu - < test.php 2>&1",$out,$bin);
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
tedd wrote:
Interesting.
So a php server-side php script can establish a two-way communication
with a client-side php script -- do you have an example?
http://php.net/sockets
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
levels. If you really want to do it put in the
research - everything you need can be found with your favourite search
engine, you just need to put the effort in to pull it all together.
-Stut
- Original Message ----- From: "Stut" <[EMAIL PROTECTED]>
To: "Mark McWh
Zbigniew Szalbot wrote:
STFWNN!!
Ok, don't know what it means but will google, lesson learnt ;)
You could Google that too, but I don't believe the NN is very common.
Stands for Search the Effing Web Numb Nuts.
Glad I could help.
-Stut
--
PHP General Mailing List (http://www.ph
.htaccess file would look like?
For exmaple, would I need to put register_globals = on in .htaccess to
make it work for a given directory?
STFWNN!!
http://www.google.co.uk/search?q=change+php+configuration+htaccess
Many thanks for your advice!
No problem.
Warm regards,
Same to you.
-Stut
Rob Kritzer wrote:
Is it possible to FTP a folder and all it's content? I can do a file at a
time, but not a folder.
Also there is times when I will not know the folder name, so I would
like it
to just upload everything it finds in the folder I set.
Is this possilbe?
Yes[1][2].
-Stu
locations. Do someting with
ip to location databases put into sql, generate a web page from that data
then convert to pdf.
Somebody needs weeding off their PDF habit. I mean, seriously, why the
obsession?
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http
nology such as ActiveX and the ability to
bypass any active content security or convince your visitors to give you
permission to spy on them.
So, as I said previously, no.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
;s very difficult to get the right solution to a problem when all you
provide is examples. If you want accurate help please provide an
accurate description of the problem you're trying to solve rather than a
few before and afters.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
then it's almost certainly permission-related.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
;)
{
include('french.htm');
}
else
{
include('english.htm');
}
However, if you don't care about their preferred language, and want to
serve french.htm if they specify french at all in their language
preferences then what you've got will do that.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Richard Lynch wrote:
On Sat, October 14, 2006 4:09 am, Stut wrote:
Richard: AFAIK there is no way to know this under windows without
writing an extension to tell you.
Sounds like you actually know how to do this... :-)
Would such an extension be cross-platform to all PHP installs, or
Windows
class.
-->--inc.php-->--
--use.php-->--
foo(); // This will not work
print foo(); // But this will
--<---<--
This will not work! foo() is actually defined at the global scope.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
K there is no way to know this under windows without
writing an extension to tell you.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ed Lazor wrote:
On Oct 12, 2006, at 4:36 PM, Stut wrote:
If I then go on to create an admin interface for the users, I would
create another completely separate class called UserCollection to
handle more than one user. I may at that point choose to expose any
data-massaging methods in User to
Tony Marston wrote:
"Stut" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
My general approach to designing a system is data-centric. I tend to start
by defining the database schema since getting that clear in my head tends
to lead me to a decent desig
static instance.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ed Lazor wrote:
On Oct 12, 2006, at 12:15 PM, Stut wrote:
As such you cannot start designing a solution unless you know how the
data/entities are going to be used.
Doesn't this mean that your design breaks when the behavior or use of
the data/entities changes?
You may end up refact
cannot
start designing a solution unless you know how the data/entities are
going to be used. OOP in PHP cannot start with basic building blocks, at
least not if you want a system that performs reasonably well.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
that causes you to re-evaluate the way you to things has to be
worthwhile.
Anyways, some of that probably didn't make much sense, so I need to
write some code now.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
the structure
and protection through the syntax (PHP4 sucked for this, PHP5 is better).
When you actually think about it, OOP is not a methadology - it's a
syntax. OOD is the methadology. Ramble... ramble... ramble... over!
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
s on customer data.
You avoid duplication of code. As a result you can ensure data integrity
because there is only one route to read and write it.
If this is not what you think OOP is all about, do please enlighten us
as to the error of our ways.
-Stut
--
PHP General Mailing List (http://www.p
you get /r/ requests routed to a referral tracker (several options
for that), map "joesblog" to a referrer, log the hit and redirect.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
t
(plus I'd have to look it up and you can do that just as well as I can).
Of course that would need you to have root on the server in the first place.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
concern you could generate a
temporary FTP user from a PHP script that will get removed after, say,
24 hours. How you would do this will vary depending on the FTP server
you are using.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Bradley,
There are words to describe people like you, but this list tends to be
quite clean so I'll refrain.
Bradley, meet /dev/null, I hope you'll be very happy together!
-Stut
(I'm thinking this fscker has set up an automated response system -
someone at PHP must be able
ways to attempt to do this, but bear in mind the
fundamental fact that nothing that comes from the client-side is
reliable. Anything you store there can be comprimised and should not be
used to bypass security checks if security is at all important in your
application.
-Stut
--
PHP General Ma
get this for output?
>
>
> Hello World
>
> '; ?>
>
Apache has not been set up correctly to run this file as PHP. Have a
look at the installation section of the PHP manual - odds are you'll
find the answer there: http://php.net/install
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
? If not then a
better solution is to drop the images in a folder that is then
transferred by a script cron'd by the user that has everything required
to do the scp.
To be frank, anything is better than giving the user that Apache runs as
any more permissions than you have to.
-Stut
--
Mário Gamito wrote:
Yes, but what i was looking for is the best solution for the users to
choose their language.
The same principals apply as to how you organise the customised strings.
Whether the language selection is automatic or manual is surely
peripheral to the point.
-Stut
Tony
d/create/delete/copy/move folders
-change/modify file/folder perms/privs
-etc..
Google for php file manager - there are lots of them around, but
remember that they are 1) a huge security risk, and 2) limited by the
filesystem permissions of the web server user.
-Stut
--
PHP General Mai
e to use it.
However, it would almost certainly be quicker to learn C.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Kenneth Andresen wrote:
> What I would like to know is if there are some lists of all these base
> domains, or maybe some function already doing what I would like to do?
A full list of gTLDs and ccTLDs can be found here:
http://www.iana.org/domain-names.htm
-Stut
--
PHP General Mailin
from the start of it, what's left is the affiliate identifier. Process
as you like.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jon Anderson wrote:
Stut wrote:
How bored am I?
This bored: http://dev.stut.net/phpspeed/
Server is running PHP 5.1.2 (really should upgrade that) with no
caches of any sort.
Just looking through the source, could you try changing the first
example to put the output all on one line? It
tedd wrote:
At 4:56 PM +0100 9/11/06, Stut wrote:
How bored am I?
This bored: http://dev.stut.net/phpspeed/
Server is running PHP 5.1.2 (really should upgrade that) with no
caches of any sort.
-Stut
Which begs the question, does it make much of a difference? (not you
being bored, but
dmits
multiple arguments, and as the numbers will show, (or at least they do
in my machine), they are the second best option.
Done, but again it doesn't seem to make any significant difference to
the performance.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, v
How bored am I?
This bored: http://dev.stut.net/phpspeed/
Server is running PHP 5.1.2 (really should upgrade that) with no caches
of any sort.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
e of validation than performance. I
felt your post was confusing so I'm sure others did too.
'Nuff pissing.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
user to send you dodgy
data... if its source is outside your control you need to handle it
accordingly no matter how unlikely you think it is that it will be
changed between you setting it and getting it back.
Data from any of the superglobals should be treated the same - trust
none of them
s [EMAIL PROTECTED] - see
example 3 on the PHP manual page for mail.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
the second parameter.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
html, is that right? What email client are you checking the email with?
Does it allow you to view the raw email? Does it look right? If all else
fails I think your best bet is to contact the author of the class.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
you could modify the URL so it doesn't have the
?. I do this using the Apache MultiViews option and a URL similar to
/image/123.gif. That actually runs /image.php which pulls the
REQUEST_URI server variable apart to get the required image. Do both and
you should be good for all browsers.
Unfortunately, due to the lead shield that surrounds all PHP code I
cannot see it from here. I suggest your next step would be to remove
said shield by emailing the relevant parts to the list. Then we may be
able to bring our collective skills together to assist in solving your
problem.
ngs. The way you're doing
it will work but it's probably not very efficient. This is what I use...
$valid = (strcmp($needle, substr($haystack, 0, strlen($needle))) == 0);
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ryan A wrote:
Maybe APC (August php cart :D )
How about SPECS - Simple [PHP|Pluggable] E-Commerce System.
I have a few thoughts about this idea and will put something together
later today.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net
David Tulloh wrote:
echo "".$string{0}."".substr($string, 1);
I could be mistaken, but I seem to remember reading somewhere that using
that syntax to access characters in a string has been removed from PHP6.
I suggest you use $string[0] instead.
-Stut
--
PHP Genera
ly massive security hole you're
building?
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
username
and password you get from the browser - this is a massive security hole.
See http://php.net/mysql_real_escape_string about that one.
As far as securing the password goes, the most common approach is to
store the MD5 hash in the DB. What you want is something like this...
-Stut
beginning of
a function definition.
No, PHP does not allow userland to create superglobals. However, all
global variables can be accessed through the $GLOBALS superglobal.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ross wrote:
I want to get a positive resuly comparing
Apple with aPPLE
or CaR with car
anyone know if there is a built in php function?
http://php.net/strcasecmp
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
s counting and outputting a session array there is nothing
special about them - they are the same as any other array variable. This
means you can use foreach, print_r, var_dump, etc on them.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
afe.
alas no joy.
There are only 2 other possibilities I can think of...
1) PHP CLI is not installed correctly
2) The mount you are executing it on is mounted noexec
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
g in the script are DOS not UNIX - have
you been editing the file on Windows and then uploading it? Easiest way
to check is to open the file with vi and check for ^M on the end of the
lines. If it's there, remove it from the first line and try again.
-Stut
--
PHP General Maili
1101 - 1200 of 1370 matches
Mail list logo