Re: [PHP] implode()

2008-11-18 Thread Greg Bowser
$BannerSize = implode($_POST['BannerSize'], ','); Looks like you have your arguments backwards; try: $BannerSize = implode(',',$_POST['BannerSize']); --Greg

Re: [PHP] Rounded rectangle in php

2009-01-29 Thread Greg Bowser
It is certainly possible, but to my knowledge, there is no built-in method for doing so. After a quick Google, it looks like this has been done before: http://www.assemblysys.com/dataServices/php_roundedCorners.php http://us3.php.net/manual/en/function.imagefilledrectangle.php#42815 But if you'r

Re: [PHP] Php warning message

2008-02-20 Thread Greg Bowser
> > *$boardFile = "MessageBoard.txt"; > $boardFileHandle = fopen($boardFile,"r"); > for ($counter = 1; !feof($boardFileHandle); $counter += 1) { > $colorLine = fgets(boardFilehandle); > if ($counter % 2 == 0) { > echo "$colorline"; > } else { > echo $colorline; > } > } > fclose($boardFileHand

Re: [PHP] PHP 5 file_get_contents() problems

2008-03-18 Thread Greg Bowser
The actual setting is allow_url_fopen. allow_url_include controls whether or not you can use a remote URL as an include (however, if allow_url_fopen is off, then allow_url_include will also be off.) The short answer to your question is: yes, there is a way. Several ways, in fact. You could use cu

Re: [PHP] PHP 5 file_get_contents() problems

2008-03-18 Thread Greg Bowser
for security reasons, allow_url_include can only be set from the main php.ini On Tue, Mar 18, 2008 at 10:22 AM, Thijs Lensselink <[EMAIL PROTECTED]> wrote: > Quoting Chris <[EMAIL PROTECTED]>: > > > I've encountered a situation where under PHP 5 the file_get_contents() > > function will not work

Re: [PHP] strange list behavior when replying to message on list

2008-03-22 Thread Greg Bowser
Yeah. I always forget to reply to all. The problem is with the headers. Whereas other lists have a reply-to: in the email headers, this list does not. It annoys the hell out of me. On Sat, Mar 22, 2008 at 11:13 AM, Mark Weaver <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm wondering if anyone

Re: [PHP] De-Duplicate A Query Result List

2008-03-23 Thread Greg Bowser
Sounds like you want something like the following: SELECT DISTINCT category FROM `contacts` WHERE state='california'; --GREG

Re: [PHP] Array and Object

2008-03-24 Thread Greg Bowser
Take a look at array_walk(), array_walk_recursive(), array_map() in the PHP manual. On Mon, Mar 24, 2008 at 2:04 PM, tedd <[EMAIL PROTECTED]> wrote: > At 10:23 AM -0700 3/24/08, VamVan wrote: > >Well anyways please let me handle the problems with decoding.mail.com> > wrote: > > > At 10:00 AM -07

Re: [PHP] Array and Object

2008-03-24 Thread Greg Bowser
That top post was totally not I... It was my roommate playing with my computer *nods*.

[PHP] Re: [PHP-DB] php4 to php5

2008-04-03 Thread Greg Bowser
Sounds like you're talking about the register_globals functionality. It's a php.ini setting that will cause $_POST['foo'] or $_GET['foo'] to be copied to the global variable $foo. This is somewhat of a security risk, thus disabled by default. There's another superglobal array that you might find u

Re: [PHP] How to jump to line number in large file

2008-04-04 Thread Greg Bowser
fseek($handle, 1, SEEK_CUR); // or fseek($handle, $pos) $t = fgetc($handle); This probably won't help you, but given a quick glance, it looks like you're incrementing the file pointer by 2 positions on each iteration of your while loop. The fgetc() function returns the character at the

Re: [PHP] Arbitrary mathematical relations, not just hashes

2008-04-06 Thread Greg Bowser
On Sun, Apr 6, 2008 at 7:52 PM, Kelly Jones <[EMAIL PROTECTED]> wrote: > Many programming languages (including Perl, Ruby, and PHP) support hashes: > > $color['apple'] = 'red'; > $color['ruby'] = 'red'; > > $type['apple'] = 'fruit'; > $type['ruby'] = 'gem'; > > This quickly lets me find the color

Re: [PHP] Arbitrary mathematical relations, not just hashes

2008-04-06 Thread Greg Bowser
(sorry I just hit send on a blank email; I'm absent-minded) First, in the strictest mathematical sense, a relation from a set $a to a set $b is a subset of the cross-product $a x $b. (obviously, the mathematical notation is not a great way to represent this in a program.) Hence, a relation is a

Re: [PHP] limit mail() function

2008-04-08 Thread Greg Bowser
As far as I know, there's no way you can do this via PHP. PHP doesn't "know" about users on the system. Generally, PHP is run as an apache module, and thus the scripts are run as the user apache is running as. So to start with, you'd probably need to be running a Fast CGI + SuExec setup or somet

Re: [PHP] limit mail() function

2008-04-08 Thread Greg Bowser
>Pardon me, but that's one kludgy idea Hence my use of the term hackish. But really, is isn't all that kludgy. An software solution that implements this natively would have to keep track of the stats somehow; undoubtely via some sort of stats file. So the real difference is that two processes are

Re: [PHP] require_once dying silently

2008-04-08 Thread Greg Bowser
Is it possible that something is "going wrong" between the definition of $CFG->foo and when you require that could cause $CFG->dirroot to be null? Then it would point to /lib/setup.php, which definitely shouldn't exist and should thus throw an error, but maybe it's worth looking into. That woul

Re: [PHP] require_once dying silently

2008-04-09 Thread Greg Bowser
>the above won't work, as the parser will try to interpret $CFG and put it in the string first, In that case, $CFG is either null, or it is indeed an object. If it is a standard object, which I it appears to be, then a fatal error will be thrown because there is no __tostring() function. If it's

Re: [PHP] Socket create with ssl server

2008-04-10 Thread Greg Bowser
The sockets extension is a much "lower" level interface to sockets than the fsockets/stream_ functions in PHP. Unlike with the aforementioned, with the sockets extension, you can't just expect to magically get an ssl connection by using "ssl://". Your problem is that the sockets extension has no

Re: [PHP] Hack question

2008-04-16 Thread Greg Bowser
> I can sort of figure what is doing; but, I can't figure out what the hacker > is using it for. It will allow him to upload and execute arbitrary code on your server. Generally speaking, arbitrary code execution is a bad thing. :). -- PHP General Mailing List (http://www.php.net/) To unsubscr

Re: [PHP] WHERE is syntax doc'ed for saying: if (expr1 *OR* expr2 *AND* expr3)

2008-08-24 Thread Greg Bowser
if (stripos(strrev($file), "gpj.") === 0) || (stripos(strrev($file), "fig.") === 0) || (stripos(strrev($file), "gnp.") === 0) { You have too many parenthesis: if (stripos(strrev($file), "gpj.") === 0) <-- this ends the if statement; the next || is unexpected. Also, at the end, you're missing a

Re: [PHP] Source Code Analysis

2008-10-22 Thread Greg Bowser
>Perhaps detecting >if a variable has not been initialized within the code This is an E_NOTICE level error. [EMAIL PROTECTED] ~ $ php test.php Notice: Undefined variable: foo in /home/mario/test.php on line 3

Re: [PHP] Query-within-a-query with mySQL/PHP

2008-10-25 Thread Greg Bowser
>Basically I somehow need to do a GROUP BY producer, and yet somehow at the same time, find out all the matching vintages (years), that go along with that group and return them the same time the producer group is returned. If I'm following you correctly, you have a column "year" in your group, and