Re: [PHP] Limiting an array to unique values

2004-04-06 Thread joel boonstra
3 > Item 1 > > What I need to have is unique values only. > > 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

Re: [PHP] Calculate

2004-03-16 Thread joel boonstra
SELECT COUNT(whatever) FROM table WHERE MONTH(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. --

Re: [PHP] Calculate

2004-03-16 Thread joel boonstra
ons.html#IDX1341 [4] This query assumes that end_date is sufficient 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

Re: [PHP] PHP Certification

2004-03-16 Thread joel boonstra
their PHP "exam" is anything like this one, though, the final certification will mean nothing 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

Re: [PHP] Get "nice" variables from POST

2004-03-11 Thread joel boonstra
ccess to my variables, but I don't have the danger of $_POST variables overwriting my existing ones (assuming I don't name other variables with the p_ prefix, use the proper extract() flags, etc.). joel -- [ joel boonstra | gospelcom.net ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] perl, cgi and php

2004-03-10 Thread joel boonstra
gi files through CGI. They will need to fix that, or he 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

Re: [PHP] Mail fifth parameter

2004-03-06 Thread joel boonstra
tual sending. In addition to a previous suggestion, one way to reliably set that header is to use phpmailer (http://phpmailer.sourceforge.net/) which has the option of using an smtp server rather than sendmail directly. joel -- [ joel boonstra | gospelcom.net ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to write this correctly?

2004-03-06 Thread joel boonstra
itted data, but to make it a little more flexible, maybe something like this: 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 ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Best way to do this (sub selects?)

2004-03-04 Thread joel boonstra
r if the topic has changed if ($topic != $last_topic) { print ''.$topic.''; } print " $question$answer"; # store the topic for next time around $last_topic = $topic; } print ''; ?> HTH! [1] http://www.mysql.com/do

Re: [PHP] Re: why use safe mode?

2004-03-03 Thread joel boonstra
at only one instance will be tied to a vhost (so if one vhost is getting lots 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 boonst

Re: [PHP] heavy parsing of text, storing both versions

2004-02-19 Thread joel boonstra
uest, is it?) and keeping the HTML in the database lets the admin. interface be as interactive and dynamic as is necessary. Just my $.02, though -- I'm 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

Re: [PHP] heavy parsing of text, storing both versions

2004-02-19 Thread joel boonstra
iginally entered when they authored the content. I'm assuming this isn't a 1-to-1 transformation, so that these: Some bold text Some bold text Some bold text will all get turned into: Some bold text If you turn the text back into , then it's not clear whic

Re: [PHP] Re: preg guru question

2004-02-14 Thread joel boonstra
so many parens. IOW, Adam's is better ;) [0]: The one I posted was: '//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 Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Browser Detection another page

2004-02-13 Thread joel boonstra
probably be carried on offlist. Or, better yet, I bet css-discuss can provide tips for using 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

Re: [PHP] preg guru question

2004-02-13 Thread joel boonstra
On Fri, Feb 13, 2004 at 02:19:11PM -0500, joel boonstra wrote: > if (preg_match('//ig', $dah, $matches)) { > print_r($matches); > } Doh! The '/ig' should just be '/i'. joel -- [ joel boonstra | gospelcom.net ] -- PHP General Mailing List (htt

Re: [PHP] preg guru question

2004-02-13 Thread joel boonstra
h. Compare: '; $doo[2] = ""; foreach ($doo as $dah) { if (preg_match('//i', $dah, $matches)) { print_r($matches); } # adding ? after the * if (preg_match('//ig', $dah, $matches)) { print_r($matches); } } ?> 'Course, it still doesn't

Re: [PHP] Browser Detection another page

2004-02-13 Thread joel boonstra
ing designs in this manner is that you are not coding for browsers or platforms; you are coding for capabilities and standards. It's pretty clear that browser rendering/standards support is only getting better, and that the number/variety of browsers is growing. > Could you throw in another 2 ce

Re: [PHP] Browser Detection another page

2004-02-12 Thread joel boonstra
le to whichever browser accesses your site. IMHO, browser-sniffing to serve different content is a bad idea. -- [ joel boonstra | gospelcom.net ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] weird header() (bug may be)

2004-02-11 Thread joel boonstra
he proper code (including the properly-formed URL mentioned by others) is something like: if($foo == 'something'){ header('Location: http://www.example.com/to_another_page.php') ; exit(); }else { do another thing in here } h

Re: [PHP] Can PHP redirects be detected?

2004-02-09 Thread joel boonstra
Permanently), then the redirected URL 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://w

Re: [PHP] Can PHP redirects be detected?

2004-02-09 Thread joel boonstra
address, then no, bots can't figure that out. Unless they switch useragents/IPs and compare the results that they get. Or unless a human complains 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

Re: [PHP] Website Architecture

2004-02-05 Thread joel boonstra
On Thu, Feb 05, 2004 at 05:42:54PM -0500, joel boonstra wrote: > # 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 includ

Re: [PHP] Website Architecture

2004-02-05 Thread joel boonstra
to contain anything useful. If you set it manually, though, 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

Re: [PHP] Website Architecture

2004-02-05 Thread joel boonstra
#x27;/'); Why not use php's include_path setting? No need to define constants, no need to worry about 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, a

Re: [PHP] content management

2004-01-26 Thread joel boonstra
rough its built-in plugin 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

Re: [PHP] An array curiosity....

2004-01-26 Thread joel boonstra
hings added or removed as you're coding -- not having to worry about removing 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 langua

Re: [PHP] Help with preg_replace

2004-01-19 Thread joel boonstra
E : $code\n\n"; $replace = "Foo"; $code = preg_replace($url,$replace,$code,1); echo "AFTER: $code\n"; ?> When I run this, the output is: BEFORE : blah http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah AFTER: blah Foo blah Next time, I'll test ou

Re: [PHP] Using PHP with Style Sheets

2004-01-19 Thread joel boonstra
ged the mime type of the whole document. I'm guessing that the .css file will be used in the traditional way: > > > My Page > > Now, it's the browser that's fetching the .css file, so the header() call isn't a problem at all. The browser simply performs a s

Re: [PHP] Help with preg_replace

2004-01-19 Thread joel boonstra
rd slashes. Additionally, if you're only doing a simple string substitution, you should use str_replace instead: http://php.net/str_replace You won't need the "/" delimiters, and it will be faster than using preg_replace. joel -- [ joel boonstra | gospelcom.net ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] odd and even numbers

2004-01-16 Thread joel boonstra
er generator with srand(). If you are using 4.2.0 or greater, and still seeing non-random behavior, I don't really have an answer. -- [ joel boonstra | gospelcom.net ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] odd and even numbers

2004-01-16 Thread joel boonstra
"true" and "false". Just 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 Mail

Re: [PHP] Looping problem?

2004-01-06 Thread joel boonstra
On Tue, Jan 06, 2004 at 05:33:41PM -0500, joel boonstra wrote: > 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, respon

Re: [PHP] Looping problem?

2004-01-06 Thread joel boonstra
{option domain-name-servers $dns01, $dns02;option routers $rtrs;range $rnge;}"; print $tmp; $vlans[] = $tmp; } ?> 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 colu

Re: [PHP] Adding X days to a time string...

2003-11-21 Thread joel boonstra
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

Re: [PHP] PHP Web Based File Management and Security

2003-07-01 Thread joel boonstra
sers upload a .zip (or .tar.gz) file over HTTP, 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 -- [

Re: [PHP] Include Bug?

2003-06-06 Thread joel boonstra
x27;, then a file 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

[PHP] Re: slideshow/flush

2003-02-17 Thread Joel Boonstra
t a maximum of 5 seconds (or whatever) before they see your new image. The point is that you can't talk directly to the browser. 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

[PHP] Re: Fw: HTTP_REFERER work without a problem....

2003-01-16 Thread Joel Boonstra
e between those clicks, thus 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

[PHP] Re: Defaults in drop down list...

2003-01-07 Thread Joel Boonstra
27;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] ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: PHP Auto-Responder

2002-12-17 Thread Joel Boonstra
heduler, Mac (non-osx) has applescript (I 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. J

[PHP] Re: Array Searching

2002-11-15 Thread Joel Boonstra
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 List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] RE: Why $ on variable names?

2002-11-12 Thread Joel Boonstra
x27;t imagine how I could deal 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

[PHP] Re: Does anyone know if this is possible?

2002-11-04 Thread Joel Boonstra
f you can't use perl for the whole thing, perhaps you could have PHP do all your logic, 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) --

[PHP] Re: counting clicks on a flash ad

2002-10-29 Thread Joel Boonstra
er, it supports Flash banners, as well as everything else you want to throw at it, it's free, and it's free. Installation is remarkably easy. Joel -- [ joel boonstra | [EMAIL PROTECTED] ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Sessions are acting strangely

2002-10-28 Thread Joel Boonstra
ise, have you checked with your hosting company 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

[PHP] Re: hidden PATH_INFO

2002-09-25 Thread Joel Boonstra
a useful one, but if you don't want to call a script directly, I think you'll need 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

[PHP] Re: filter files in a directory

2002-08-26 Thread Joel Boonstra
txt, .conf, etc...) you might want to come up with a more general way to add filters besides simply tacking on stuff with &&. One thought might be to keep an array of patterns, and do a match on the whole array. When a new file needs to be filtered, simply add an entry to the array, keeping

[PHP] Re: stripping quotes from urls and images

2002-07-31 Thread Joel Boonstra
ributes, I'm 100% sure you don't want to remove from *all* of them. Like this: Removing the quotes from the title attribute will likely break at least some browsers, if not all. So your regular expression needs to be able to handle that gracefully. Good luck! -- [ joel boo

[PHP] Re: Auto Increment Problems....

2002-07-30 Thread Joel Boonstra
if you're counting rows just to find out what the next value for an ID 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

[PHP] Re: Sendmail "return-path" from my virtual webhost

2002-07-29 Thread Joel Boonstra
e Return-Path in this manner; that's out of my area of expertise, so if the above doesn't work, I'm not much more help... Joel -- [ joel boonstra | [EMAIL PROTECTED] ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Pine config

2002-07-23 Thread Joel Boonstra
ine your own index-format, and use the 'FROM' token instead of 'FROMORTO'. More info is available by going to Pine's config screen (m, s, c), searching for 'index-format' (w index-format ), 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

[PHP] Re: Comma question

2002-07-23 Thread Joel Boonstra
7;ll start 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] Re: banner rotation and advertisement

2002-07-10 Thread Joel Boonstra
> 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 Li

[PHP] Re: Exporting mySQL Table Data to .csv

2002-07-10 Thread Joel Boonstra
;t a PHP script (it's Perl), 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 (h

[PHP] Re: alphabetizing titles when first word begins with 'The','A',etc.

2002-04-18 Thread Joel Boonstra
, one very similar): No fuss, no muss. You don't have to worry about 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

Re: [PHP] why doesnt this work???

2002-03-20 Thread Joel Boonstra
7;w'). Maybe that was just a typo in the email, but that will definitely be a problem in the code, too. 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

Re: [PHP] Apache Server Side Includes mixed with PHP pages

2002-02-28 Thread Joel Boonstra
en be parsed. 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

RE: [PHP] wordwrap not working

2002-02-20 Thread Joel Boonstra
know wordwrap had the 3rd (and 4th) parameters till now. Joel -- [ joel boonstra | [EMAIL PROTECTED] ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] wordwrap not working

2002-02-20 Thread Joel Boonstra
t's doing what it should. If you want your HTML to appear wordwrapped, modify your PHP to use the 'nl2br()' function: This will convert all newlines to tags, and your HTML output will look just like your text output. Joel -- [ joel boonstra | [EMAIL PROTECTED] ] -- PHP G

Re: [PHP] PDF4PHP Class

2002-02-18 Thread Joel Boonstra
tes. No extra 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! --

Re: [PHP] prev next links

2002-02-04 Thread Joel Boonstra
lines. Here is a non-syntax-error-ridden version: 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://w

Re: [PHP] prev next links

2002-02-04 Thread Joel Boonstra
; This doesn't take into account whether or not yesterday or tomorrow's objects or files or whatever actually exists. Since that is site-specific, you'll need to add that sort of logic yourself. Hope that helps! -- [ joel boonstra | [EMAIL PROTECTED] ] -- PHP General

RE: [PHP] How to call method from another class

2002-01-28 Thread Joel Boonstra
ontents() { print $this->get_contents(); } } Then you're good. 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-

[PHP] function scope question

2002-01-24 Thread Joel Boonstra
doesn't seem like the way things should work. Am I completely wrong? I seem 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 (htt

Re: [PHP] PHP Chat REALTIME

2002-01-22 Thread Joel Boonstra
I have never used 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]

Re: [PHP] PHP & ssi

2001-12-25 Thread Joel Boonstra
n documents, thus 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 boonst

Re: [PHP] Images

2001-12-20 Thread Joel Boonstra
binary data (probably using a binary-safe read) from the image file you want to display (in $url), and then print that data out after the content-type header. Right now, a browser would get sent a content-type header for a gif, and then the following string: http://www.mysite.com/myimage.gif