Yes, you will need four ellipses, arcs, or similar shapes -- but they'll all be
the SAME except for the center, so make that a function probably.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> I'll add that if you went the JS route, then it would just be
> replicating the system time, ie replicating the Windows clock.
Actually, I did this thing once where I included the server time from PHP in
the JS, then calculate the difference, then use JS to show the actual current
"time"
And vice-versa:
Any PHP functionality that needs to be called from Java can be a web service
using whatever weapon you find suitable.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Zero real experience, but what I hear is that the Java / PHP bridges are a bit
brittle and difficult to shore up properly...
You may want to consider going with HTTP REST / RPC services instead, as those
are quite solid, and you can get what you want.
Note that this is all hearsay on my pa
There are functions/settings in pcntl docs about how to "listen" for specific
signals.
If you don't listen for -9, maybe you don't get it.
http://php.net/manual/en/function.pcntl-signal.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
I prefer to deal with the issues locally, or have a documented behaviour with
return values and error details available, much like most of PHP
extensions/internals.
try/catch ends up with weird code organization, imho, especially when you can
only really handle some exceptions.
For real f
> there is an art to using them, they compliment 'traditional' error
> handling, and I agree they can hinder if used badly.
I don't think I've ever seen Exceptions used well...
Invariably, I end up having to write a wrapper function around every function
implemented and catch all the Excep
> catch-all?
Yes, with lots of spam filtering, including a custom one in PHP.
Got tired of waiting for webmail to run its filters.
PHP cron job on the server with IMAP.
Comes in handy for web sign-ups and the following spam -- And for identifying
spammers. I don't work with spammers.
In general, if you are trying to get DB connections to work in a hybrid
situation, and no native driver is behaving, try ODBC.
It's crude, slow, and not pretty, but it should work.
You can set it up so that you can go back later and dink around with drivers
and re-compiling, but at least h
Are you perhaps storing the session data in a DB?
If the field type is, say, text, and you put something large in $_SESSION,
you'll have truncated data, the session manager can't unserialize it, and you
will have a silent failure when they try to do their next task -- They get
logged out and
>> Apparently, it's time for me to take on a project manager job and quit
>> coding...
>>
>> Oddly enough, I've been thinking I might like to do that, though more
>> of an architect/manager role, really...
>>
>
>didn't you already ma
ESTJ
Apparently, it's time for me to take on a project manager job and quit coding...
Oddly enough, I've been thinking I might like to do that, though more of an
architect/manager role, really...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.ne
There is no reference to index '2' in that line 19.
What is the next line?
Something which expects at least 3 elements in the URI, perhaps?...
[Hint, hint]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I doubt that you can use re-direct and do what you want, since a re-direct does
just that:
re-direct the USER to the URL.
What you *could* do is get rid of the re-direct and just
include('scriptfile.php'); by using ForceType on imagefile.jpg to be
application/x-httpd-php
Then scriptfile.
I think it means Rob has to bake us all some brownies and ship 'em out to us...
:-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
It is not the case that they are running your old PHP code.
Their messages may be passing through your filters.
Save one of them and try it yourself, with a lot of debug "echo" statements or
whatever you like.
They may be accessing your old PHP file still on your server, if you left it
be
One way to balance the author's need to have nice-looking output, and your need
to keep the content/html under control is to provide the authors with a variety
of template layouts with varying number/placement/sizes of images and blocks of
text.
Build a half-dozen of them, allow only ASCII t
What it is depends on what encryption routines you have installed.
The algorithm to authenticate detects the algorithm based on the hash.
32-char : MD5
$1$ : SHA-1
$2$ : SHA-2
etc.
(Apologies if I got my tokens/algorithms wrong)
If you just toss MD5s in there, it should work,
> Doesn't anybody use prepared statements these days? It even helps MySQL
> AND Oracle cache an execution plan...
Forgive me if I'm wrong, but:
Caching an execution plan for a prepared statement that is run only once in the
script is just overhead, no?
Or can it actually re-use the same
> The charset: latin1 and the collation: latin1_swedish_ci.
Trivia quiz at a MySQL presentation at my Chicago PHP User Group a few year ago
comes in handy!
The defaults for MySQL are actually latin1_swedish as that is the native
language of the original developer, (?Monty Widenus?)
This
In olden times, of PHP 3, you could for sure use ->x and [x] interchangeably,
as an Object then was little more than a C struct with a couple functions
tacked on, as was an array.
I think PHP 3 Object may actually have been implemented as a PHP array with
some additional C functions on it, c
You can only interpolate ONE level of array or object indirection in a string.
WORKS:
"... $foo[x] ..."
"... $foo->x ..."
FAILS:
"... $foo[x][y] ..."
"... $foo->x->y ..." //almost for sure it fails, never tried...
You can use curly braces in side a string to evaluate something:
WOR
I think if they didn't want us to use expressions in the case, then they
wouldn't have put support into the language for that.
I daresay you are reading more into the text than was intended...
I certainly have found switch(true) with complex expressions for case quite
handy and very clear
Hard to say without knowing the data structures...
You can't do a simple count of the holidays and add that, because you might end
up with yet another holiday in the result.
Start at 12/23 and want to add 6 business days.
You find 1 holiday in between, so you add 7 business days and end
touch foo.txt
chmod 000 foo.txt
rm foo.txt
rm: remove write-protected regular empty file `foo.txt'?
So the behaviour is at least partially shell/profile dependent...
I have no idea how this would affect PHP unlink, if at all.
ymmv
naiaa
ianasg [*]
[*] sg: shell guru
--
PHP Ge
For now, as already said, go with PayPal or similar.
Do not store the CC#s in your DB or anywhere at all, for any length of time.
Not in the SESSION either. Get it and send it to PayPal and wipe it out with
http://php.net/unset all in one single HTTP request.
For long-term, to learn more,
Not only do you need to check the return value of chmod to see if it worked,
but also, I *think*:
The file withing the directory can have entirely different permissions, and
making the directory world writable won't help that, I don't think...
I could be wrong, and a 000 file in a 777 dir
For starters, three calls to header("Content-type: "); is just plain silly :-)
Read this for sure:
http://php.net/header
You may find this interesting, or not, to pick the right Content-type
http://richardlynch.blogspot.com/2006/06/php-downloads-content-disposition.html
--
PHP Genera
> are you really ever in a situation where some HTML weenie is coding
> HTML pages and you're somewhere else doing the PHP work?
Yes.
I have been there several times, and am there now.
In a well-run organization with good communication and a decent framework, it
works out well.
Other
> You actually mean application/xml not text/xml
That depends on if you want the Userland RSS standard or the Other [blanking on
name] RSS standard.
Unfortunately, the RSS camps are still at war over syntax and required
elements, and there are 9 mutually-incompatible often-used versions of
Google for BBCode.
It's just str_replace(array('[b]','[/b]'),array('',''),$text) in the end.
And it's not really going to be any better than just letting them type and
if that is needed.
Your sanitization process will be the same no matter what, and will have the
same flaws/risks eith
You should be able to fairly quickly fopen/fread/fseek/fread and compare the
opening/ending XML tags.
If it's well-formed XML, it should be trivial to detect an incomplete file
versus a complete one.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.n
> $ mv hello-world.php hello-world.html
Isn't this backwards?...
:-)
39% seems awfully high overhead for what is essentially an extra readfile.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Short Answer:
You can't.
:-)
http://en.wikipedia.org/wiki/CMYK
Long Answer:
You probably can, but not in some way that makes sense to discuss here on
PHP-general.
The external links in the above article should get you started.
--
PHP General Mailing List (http://www.php.net/)
To
I'm talking about having PHP rip through .html files without any
inside of them.
You added
Don't do that. :-)
ln -s foo.html foo.php
Surf to both and time it.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
With all due respect, Eric, you're not testing what we're discussing.
A "real" CLI test would be more like:
time cat foo.html
time php -q foo.html
I.E., how long does PHP take to read/write foo.html without breaking into PHP
"mode" for static HTML.
Of course, it's still a lousy bench
>> Rule #1.
>> Never, ever, ever, alter the user's input, EXCEPT for
>> sanitizing/filtering.
>
>Probably shouldn't recommend sanitizing then. Only validate & reject. :P
mea culpa
I meant ESCAPING, of course.
If it doesn't pass sanitizing/filtering, it's probably better to just "reje
The browser cheerfully rendering a badly-broken JPEG is quite common, if it can
figure out what the JPEG was supposed to have been.
(Think bad HTML and quirks mode.)
So you really want to validate it with something more strict than a browser.
--
PHP General Mailing List (http://www.php.ne
The slowdown of just running raw HTML through PHP was once benchmarked as about
5 to 10 %.
You could, in theory, use .htaccess and to ForceType specific .html
files as PHP, while leaving the rest of your .html files as static.
I am not recommending this, just being pedantic. :-)
Defini
I know there was an OSS package that took any URL and made a screenshot of it...
Thumbnailer or somesuch?...
Commercial folks do it.
http://browsercam.com/
Compare cost to dev costs for roll your own...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://w
Do other images work?
Open and re-save the image.
Strip out comments and EXIF data while you are at it -- Some versions of GD had
problems with EXIF/comments as I recall.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Rule #1.
Never, ever, ever, alter the user's input, EXCEPT for sanitizing/filtering.
Specifically, do NOT add tags in place of newlines.
Store the newlines.
Upon OUTPUT, you can use nl2br() to get tags.
Or str_replace if you want instead.
This is crucial as a habit, down the road, whe
Try it with just one "/" at the start of the xpath.
"/anbieter/immobilie/..."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
You'll have to use Ajax to make another HTTP request.
HTTP is not really designed for this, and it will make the site quite sluggish
most likely...
You should certainly make it an async call and not slow users down with this
"feature".
--
PHP General Mailing List (http://www.php.net/)
> Fact is if you want to be secure just disconnect you're machine from
> the internet, remove cd/dvd/floppy drives and unplug the keyboard.
You forgot to cut the internal USB cables.
:-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.ph
XML in PHP4? Don't. :-)
It was very painful and with all kinds of quirks, from my limited experience.
PHP5 was a breeze.
Consider hosting a quick/easy service on a PHP5 box to convert XML to PHP
serialized data or something as well. Could be less painful.
Or just upgrade, since PHP4
As I recall, PHP CLI overrides the error_log setting and uses STDERR by design.
You'll have to re-direct it elsewhere in the shell.
Or a custom error_handler that uses a specific file name in error_log call.
Using error_log alone will not help.
--
PHP General Mailing List (http://www.
Irrespective of the GTK2 bit, PHP can connect just fine with other servers
using sockets and stream wrappers and good ol' file_get_contents on a URL.
Whether you can tweak those in useful ways at fast enough speeds to do what you
want is more up to your skill than PHP's feature-set.
--
PH
If register_globals is "on" (ewww!) at otherhost.com, then "?safe_flag" on the
URL will get in.
This is one of the reasons why register_globals should be OFF.
NOTE:
The code you gave does not describe the circumstances whereby $safe_flag is
"set". There could be all manner of other issue
It is the wrong list to ask.
The answer is that the YouTube API does not support that.
You'll have to merge and sort in PHP.
I recommend you cache the results for all external web services, as a general
principle.
For a large number of videos, you'll want to merge/sort in DB, not in P
As far as I know, that's not readily available...
However, you could do an ob_start() and/or a try/catch and try to re-define the
class, and then ignore the error and continue.
I believe the PHP error message you get will have the file and line where the
original class was defined, so you
Historically, mysql has been both an external extension, and a built-in part of
the source, depending on the version of PHP.
Your current experience would indicate that it's only external in 5.2.8, but I
cannot confirm nor deny that.
How is MySQL installed?
If it's rpm, do you have mysq
PHP had a built-in MySQL for awhile as I recall.
You had to explicitly use --with-mysql=/usr/local (or wherever you put your
mysql headers/libs) to make it choose the one you wanted.
Even if it's not using built-in, it may have found an "old" install of your
MySQL rather than your shiny ne
> When mentioning the RAM usage problem, one might consider calling
> flush() after each echo, just to make sure that they don't run over
> PHPs memory limit.
Oh yeah.
Make sure you've run through and cleared all ob_buffers for any kind of
non-HTML output, specifically for file downloads.
> I'm still a little confused on this though. How would a browser send
> this to notify of a download that was only partially completed before?
As I understand it, it was more of a "partially cached" document issue.
If the browser has the first N bytes of a document in its cache, it will se
> echo fread($HANDLER, $FSIZE);
This is your problem child right here...
Sucking in an entire OGG File to RAM, for a large OGG file, will be quite
painful.
And, on a busy server, even moderate size files will be problematic.
You could probably relieve a lot of stress and keep full
My thesis is:
Your Javascript that intercepts the .submit and then does whatever it does, is
"broken" in FF but not in MSIE.
Post your JS to a JS mailing list and ask there to be sure.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I'm afraid I wasn't clear enough.
I thought the "catch" block was not actually 'catching' anything, since I'm
seeing an error message with the line of code that is causing the Fault.
Turns out, XDebug is kindly splatting out the exception even though it's being
caught.
Which I'm sure it
We have code like this:
try
{
$details = $this->__client->getData($email); //Line 274
}
catch (SoapFault $sf)
{
//do stuff
}
catch (Exception $e)
{
//do more general stuff
}
SoapFault: No data found in C:\classes\Client.php on line 274
Hello?
What is the point of all t
Whatever is SENDING the request data is broken, almost for sure.
PHP doesn't *do* much to the HTTP Request data except urldecode it for you.
There's not much that can go wrong there.
If your theme switcher, presumably in JS, isn't sending the data properly,
there's not much PHP can do ab
If it's money, store everything in pennies INTEGER, and format as dollars on
output.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
>> I often thought PHP would be a nice language for a MUD, if one could
>> get the performance out of it...
>
> Design your code such that you can just throw more hardware at it
> whenever you need more performance.
That's easily said, but a MUD means all the users have to share a signific
As I understand it:
You can LINK your commercial binary with GPL binaries, and keep closed source.
You cannot co-mingle the two C source codes together and keep it closed.
I am fairly certain you can find commercial C++ offerings to generate PGP key
pairs, instead of using the GnuPG OSS
For a bank? No, MD5 would not be acceptable.
For you gramma's blog? Sure, MD5 for passwords is fine.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I often thought PHP would be a nice language for a MUD, if one could get the
performance out of it...
'Course you could always write some of the heaviest bits as extensions...
Anyway, I don't think you need the connections to be "shared" in any special
way.
Just update your data store a
The PHP source uses bison/flex, I believe, so that's your best bet for finding
the grammar.
Chris Shifflet (sp?) mentioned the other day somewhere that he was considering
soon releasing some code that he uses in security audits for the boring grunt
work part.
You may want to try to follow
Perhaps compile everything in debug versions and get some core dumps and file a
bug report at http://bugs.php.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
File a bug report at
http://bugs.php.net
You have a pretty clear-cut case of a built-in function gone awry, and it will
probably be fixed pretty fast.
I also rely on this function quite a bit, so it needs to work right when I end
up at 5.2.8 some day :-)
_
select
first_name like '%$first_name%'
+ 3 * last_name like '%$last_name%'
+ 7 * email = '$email'
as score,
first_name, last_name, email, person_id
from person
.
.
.
order by score desc
limit 10
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.
> Sorry didn't try your suggestion php -1 ... not sure how to!!
Open up MS-DOS prompt.
Figure out where your php.exe lives.
Let's pretend it's in C:\\php5\php.exe
cd to the directory where your script lives.
cd C:\\inetpub\wwwroot\search
C:\\php5\php.exe -l search.php
After yo
>> In some circumstances, with "mixed" charsets on a page, and with IE in
>> quirks mode, IE will try to "guess" the charset and get it (very)
>> wrong.
>
> A single page or response can only have one characterset, there is no
> mixing possible.
Allow me to re-explain.
Step 1.
Gener
For IE, you also want to add the META tags for HTTP-EQUIV for you charset.
In some circumstances, with "mixed" charsets on a page, and with IE in quirks
mode, IE will try to "guess" the charset and get it (very) wrong.
You really do want a DOCTYPE and a document that validates if at all pos
Certainly if the quality of the input can be improved by using some digital
transfer that is not a fax, go for it...
I assumed the OP already knew that, but perhaps not.
The fax is going to cost you a LOT of accuracy, probably too much to make OCR
even viable, really, but it depends on the
AIUI:
The barcodes are on faxes and whatnot, with no predictable skew, position, nor
orientation.
You've tried JOCR/GOCR, and they don't do very well.
Here are your options:
1) Shell out the money for that PaperPort OMNI or whatever it is commercial OCR
product. It *is* better than JOC
PHP does *not* do the addslashes on $_POST when you cram something into it in
your PHP code.
It does it during the process of auto-filling up $_POST.
So either:
A) you have magic_quotes_runtime turned on LOCALLY. Use phpinfo() to see.
B) you actually managed to put the backslashes into yo
> Unfortunately, in the inherited DeployTask::execute(), "self::$STEPS"
> does not refer to UpdateTask::$STEPS, it refers to DeployTask::$STEPS
Use parent::$STEPS and call it done?
Yes, I know, if you add another layer of class in between, then it's not
parent:: anymore, but it seems a bit
Change php.ini (or .htacces or ini_set) so that display_errors is OFF and
log_errors is ON and log them to some file you do this to, all day, every day:
tail -f /var/log/httpd/error_log
You'll definitely need this as you get more complex site interaction,
particularly with Ajax calls that
Try this, maybe:
($className)::$STEPS
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Just generate a much larger PDF with all the pages they asked for and call it
done.
:-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
If you have their ID when you generate the HTML FORM, there is no need for
anything as exotic as Ajax...
//get their $ID
//query the DB using $ID to get $whatever
echo "", htmlentities($whatever), "";
If you don't know their ID until the interact with other form elements, then,
yeah, go
Assuming your local box is not wide open to the 'net for mail relaying, install
Pegasus/Mercury mail server and call it done.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I would set it up that a person could elect to work with one or more
Departments. If they work on a College, they work on all Departments in that
college.
Another option is to just let them do one Dept at a time, and that's it.
Kind of depends on what people actually DO in this work, most
If system("convert -version") does nothing, it is probably erroring out.
Mess around with exec and using 2>&1 to try to get the error message.
It's going to boil down to paths and permissions.
The PHP user probably doesn't have convert in $PATH.
Use a FULL PATH for system/exec calls fo
> Inefficiency for me is when it takes longer to code.
How long can this take?
Even if you go full-blown with an Interface and static methods that have to be
fleshed out in the implementations, you're still talking about an hour or so.
Quit complaining and start typing.
:-)
> PHP is
PHP does have garbage_collection, and it's crucial in long-running CLI scripts.
Per is right, though, in that if your web-page Apache PHP script needs GC, you
are doing something terribly wrong.
It is not as aggressive/thorough as, say, the Lisp GC, but it's there.
ymmv
--
PHP Genera
You can use a (base) object Comparable with a method compareTo as the callback
function for http://php.net/usort
That gives you 99% of what you want, for the tiny price of having to pass in
the array('Comparable','compareTo') as the callback arg.
Given that one frequently calls usort and f
I'm not sure how glob works in the guts, but I know it is dog-slow for large
numbers of files (or maybe just large numbers of results).
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Fire up Live HTTP Headers in Firefox.
My theory is that the browser is RE-requesting the data because of the private,
must-revalidate.
So it goes like this:
Browser -> GET -> Ecomm: fooie ; unset Ecomm
Browser -> GET -> Ecomm: [not set]
If you are using Ajax and JS and whatnot, the p
Perhaps you couldn't hear the big bang in this universe, but what about in the
universe that spawned it?
:-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> Being JSON immediately parsable by both Javascript and PHP it is
> possible to exploit it to keep the regular expressions for the input
> fields in a single place, and avoid mantaining them synched between the
> Js and PHP scripts!
Yes, but...
The Regex engines are not the same, so you
> * Your output isn't cleaned up when coming from the database. You need
> to put a few stripslashes() instances in there.
Actually, if you think you have to use stripslashes, then, in fact, you've used
addslashes and/or Magic Quotes TWICE, and your db has BAD DATA in it.
Fix the data int
Presumable, the EXISTS sub-query can be optimized sometimes to just stop
processing the sub-query and kick things back out to the outer query.
IN has to process them all and find them all.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I found the PEAR tarballs to be corrupt a day or two ago...
The PEAR bug report captcha continually rejected my correct answers to simple
math questions. :-(
I snagged a re-packaged version from:
http://pizzaseo.com/
ymmv
--
PHP General Mailing List (http://www.php.net/)
To unsubscr
> $result = mysql_query($query) or die(report($query,__LINE__ ,__FILE__));
>
> // to show dB errors ==
>
> function report($query, $line, $file)
> {
>echo($query . '' .$line . '' . $file . '' .
> mysql_error());
>}
>
> This does t
Please do NOT use addslashes.
Replace it with this:
http://php.net/mysql_real_escape_string
It is CRUCIAL if your database might maybe ever consider going international
and having charset other than ISO-8856-1 or Latin1
[or the MySQL default of Monty's native language, which is very ver
There are httpd.conf settings to reject POST requests, but I don't think it
would behave like that...
But maybe it's a bit more complicated than what I've ever seen for httpd.conf
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I actually would do more like:
$myArray[$study][$symbol] = true;
No need to call in_array.
Probably won't matter, really, but it's a good practice for when you end up
doing the same kind of code for an array with thousands of elements.
--
PHP General Mailing List (http://www.php.net/
As I recall, there needs to be a \SENTSINCE instead of just SENTSINCE, and the
PHP online manual ended up stripping out the \ business...
Or maybe that was in some kind of "flags" somewhere else...
Check the user contributed notes -- Those are invaluable for "what can go
wrong" type of ins
I'm surprised nobody mentioned:
http://php.net/assert
in this thread yet.
Perhaps I missed it?
You should really consider doing this:
1) At the outer API layer, do a typecast (possibly with preg_match first) to
convert the input data to acceptable form.
2) For inner API layer[s], sp
> but I gather from your reply that the browser issues the new (printer)
> page without reference to the server.
> Is this what actually happens?
Yes, this is what actually happens for the browser "print" button.
You could do something like a "Printer Friendly" button to generate a PDF on
1 - 100 of 165 matches
Mail list logo