.
Item 1
Item 2
Item 3
How can I sort out the redundant values in that array?
PHP's 'array_unique' function should help:
http://php.net/array_unique
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net
except that you gave them $10.
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
to determine which
month something is in. Also, it relies on some potentially
MySQL-specific syntax.
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
(your_date) = '03';
then your result set will only have one row (the number of matching
rows), and you don't need to do any additional counting work.
However, all of that is for the OP, not for me, so I'm CCing the list
back in.
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http
, etc.).
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
will need to move ganttChart.cgi into a directory that is setup to
handle CGI files -- sometimes you'll have a cgi-bin directory for this
purpose.
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
['action'];
if (in_array($action, $valid_actions)) {
output($action)
}
else {
# handle error somehow
}
?
To add more valid actions, you can just extend the array of valid
actions, rather than adding clauses to the switch statement.
joel
--
[ joel boonstra | gospelcom.net
/doc/en/SELECT.html
[2] http://www.mysql.com/doc/en/GROUP-BY-Functions.html
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
of traffic, and one is getting
only a little, there won't be spare servers around to balance things
out). I'm basing that all on what I read at Apache's site, so I may
well be wrong.
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit
transformation, so that
these:
bSome bold text/b
BSome bold text/B
bSome bold text/B
will all get turned into:
strongSome bold text/strong
If you turn the strong text back into b, then it's not clear which
of the three options you should use.
Unless I'm misunderstanding...
joel
--
[ joel
not going to have to end up maintaining
this, so the best answer is the one that works the best for the OP.
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
there are so many parens.
IOW, Adam's is better ;)
[0]: The one I posted was:
'/img src=[\'](.*?)\.(.*?)[\']/i'
which didn't require quotes to match each other, didn't allow for
arbitrary whitespace, and didn't allow for XHTML-style tag closing.
--
[ joel boonstra | gospelcom.net ]
--
PHP General
in another 2 cents? :o)
I guess that was more like 10 cents. Feel free to continue this
off-list if you want to discuss more. This really doesn't have much to
do with PHP anymore ;)
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit
)) {
print_r($matches);
}
}
?
'Course, it still doesn't match multiple images in one line.
preg_match_all() could probably help out there.
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Fri, Feb 13, 2004 at 02:19:11PM -0500, joel boonstra wrote:
snip
if (preg_match('/img src=[\'](.*?)\.(.*?)[\']/ig', $dah, $matches)) {
print_r($matches);
}
Doh! The '/ig' should just be '/i'.
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http
CSS to support handheld browsers, without having to duplicate content or
do browser sniffing.
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-sniffing to serve different content is a bad idea.
/$.02
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
'){
header('Location: http://www.example.com/to_another_page.php') ;
exit();
}else
{
do another thing in here
}
header('Location: http://www.example.com/to_previous_page.php');
exit(); // for good measure
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP
that the listing is innacurate. etc...
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
is indexed.
I have nothing to back this up other than trying it out with some sites,
and watching the results (with Google) over a few months, but it makes
sense to me.
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http
the location of your script relative to the document
root, and it works with more functions than just include() and
require().
I have found it to be the cleanest, most reliable, and most portable way
to deal with file paths.
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http
, it can contain
whatever you want.
Unless I'm misunderstanding what you're saying...
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Thu, Feb 05, 2004 at 05:42:54PM -0500, joel boonstra wrote:
snip
# ini_set():
ini_set('include_path', {$_SERVER['DOCUMENT_ROOT']}:.);
Replying to myself, it appears that PHP = 4.3.0 has a family of
functions specifically for tweaking include_path:
http://www.php.net/manual/en
a
trailing comma for an element that is now the last one, or adding one to
previous elements when adding items to the list is a small but useful
timesaver.
Perl does this as well. I'm not sure which other languages do, but I
like it.
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List
interface, which is Perl).
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
.
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
in response
to that request.
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah
AFTER: blah Foo blah
Next time, I'll test out my answers before I give 'em.
HTH!
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
negate the result
of your modulus operator, and take advantage of the fact that 0 is
false, and 1 is true:
function isOdd ($value) {
return !((int)$value % 2);
}
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net
an
answer.
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
specifying
which columns you want. That way, if your database schema changes
(e.g., you add two more columns), your code won't break.
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Tue, Jan 06, 2004 at 05:33:41PM -0500, joel boonstra wrote:
snip
I would recommend not simply doing a select *, but rather specifying
which columns you want. That way, if your database schema changes
(e.g., you add two more columns), your code won't break.
And, responding to myself
);
?
Such a handy function -- no need to worry about leap years, number of
days in a month, etc...
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
, and have your server uncompress it and (optionally)
create a directory structure matching the contents of that .zip.
The 'gallery' image gallery software does .zip file uploading, and it's
quite handy.
Just a thought,
joel
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http
matching in the current working directory will take precedence over
the one in your site root. So keep that in mind...
--
[ joel boonstra | gospelcom.net ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
. You have to
talk to the server, and then have the client periodically poll the
server to see what new data it should get.
I think.
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
making even a temporary id based on the IP address
unreliable, and perhaps frustrating if your site keeps 'forgetting'
things about the user.
Joel
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-reviewer what's going
on. So it requires more documentation.
* you run the risk of stepping on pre-existing variables.
However, the upside, namely, eliminating a *ton* of code, is attractive
enough to me that I use this for most select boxes I do.
Joel
--
[ joel boonstra | [EMAIL PROTECTED
think), and OSX and Linux
have, well, everything.
Otherwise, you could try an online cron service. Like:
http://www.cronservice.com/
I have no idea how reliable they are, etc..., but it's likely cheaper
than hosting with a new place.
Joel
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP
/en/function.in-array.php
if you're not sure what key 'foo' will be at, or this:
http://www.php.net/manual/en/function.array-search.php
if you're not sure what key 'foo' will be at and you want to know what
that key is.
Joel
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing
with variables that didn't have something in front of them
to separate them from barewords.
Oh well.
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
, and then pass the data to a perl script to format and
save it to a file. Or maybe sprintf() does everything you need...
Joel
(more on perl formats:
http://www.perl.com/doc/manual/html/pod/perlform.html)
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net
to see if this is
a common issue that their customers have?
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
a rewrite.
There also may be another way to do it in Apache, but I don't think
there's anything in PHP you can do to accomplish this.
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
on the whole array. When a new file needs to be filtered, simply
add an entry to the array, keeping your code more-or-less clean.
It's up to you, though.
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
.
Good luck!
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
is, then, as you already said, you're doing the wrong thing.
Joel
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
more help...
Joel
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
using {}
everywhere I embed variables in strings, but I was unaware that stuff
like this:
This is a $variable embedded in a string
might no longer work. If you have URLs, I'd love to read up on this.
Thanks!
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http
to Pine's config screen (m, s, c),
searching for 'index-format' (w index-format enter), and hitting
CTRL-G to bring up the help.
HTH!
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
), but it does exactly what you want:
http://oss.gospelcom.net/staff.php
The first tool listed there is called 'cvsdump' -- it dumps, processes,
and mails a MySQL table in CVS.
HTH!
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http
Try phpadsnews.
phpAdsNew can be found on SourceForge here:
http://sourceforge.net/projects/phpadsnew/
I've been using it in production for over a year now, and have found it
to be quite a handy program.
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http
what order they were
inserted in, artificially munging your data, or anything else.
HTH!
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
.
Of course, all the other advice ('==' instead of '=', '' instead of
'and', etc...) should be heeded as well...
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
. Why you would want this, I don't know, since PHP is much more
fully featured than SSI, and can do everything SSI can.
Joel
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
output.
Joel
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
modules
required, nothing to compile. Just unzip, and it works (more or less).
The only potential sticky point is that it writes to /tmp when images are
involved, so if that's a problem for whatever reason, you'll need to
change one line. Otherwise, it works great!
--
[ joel boonstra | [EMAIL
that sort of logic yourself.
Hope that helps!
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-syntax-error-ridden version:
?php
$prev_link = http://yourdomain.com/?$prev_year-$prev_month-$prev_day;;
$next_link = http://yourdomain.com/?$next_year-$next_month-$next_day;;
?
Sorry!
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit
. Otherwise, I don't think it's possible...
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
to recall that this sort of thing should
work in a more strict OO language, like C++.
I'm using PHP 4.0.6, if that's important.
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail
it, but it definitely looks to be worthwhile.
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
allowing your PHP script to execute and
output SSI, which would then get parsed by the server and be executed,
again.
Why you would need this, I don't know. As people already mentioned, SSI's
very limited capabilities should all be available in PHP.
Joel
--
[ joel boonstra | [EMAIL PROTECTED
header for a gif, and
then the following string:
http://www.mysite.com/myimage.gif
and that's not valid contents for a .gif file.
Joel
--
[ joel boonstra | [EMAIL PROTECTED] ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
65 matches
Mail list logo