[PHP] array problems

2006-08-15 Thread Chris G
Hi all Having a prob with a php script... 3 arrays $datay1=array(140,110,50,60); $datay2=array(35,90,190,190); $datay3=array(20,60,70,140); which have to be passed to a class like this $gbarplot = new GroupBarPlot(array($bplot1,$bplot2,$bplot3)); if I get data from a database, how can I au

Re: [PHP] readdir() question

2006-08-15 Thread Chris
John Meyer wrote: Richard Lynch wrote: Do you really mean opendir() or do you mean readdir() ??? readdir(). The point is why do you need to put it as !== vs. != They mean different things. !== means "check the values are not the same AND check their types". != means "check the values

Re: [PHP] readdir() question

2006-08-15 Thread John Meyer
Richard Lynch wrote: > Do you really mean opendir() or do you mean readdir() ??? readdir(). The point is why do you need to put it as !== vs. != -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Easier way to get the name of a variable?

2006-08-15 Thread Robert Cummings
On Tue, 2006-08-15 at 19:01 -0500, Larry Garfield wrote: > On Tuesday 15 August 2006 16:50, Richard Lynch wrote: > > > If the names are not predictable, the array solution is probably best, > > as there is movement in the PHP Internals list that may (or may not) > > make it impossible to dynamical

Re: [PHP] Easier way to get the name of a variable?

2006-08-15 Thread Larry Garfield
On Tuesday 15 August 2006 16:50, Richard Lynch wrote: > If the names are not predictable, the array solution is probably best, > as there is movement in the PHP Internals list that may (or may not) > make it impossible to dynamically add a property to an object. I've > lost track of where that th

Re: [PHP] Mail reply-path

2006-08-15 Thread Chris
Richard Lynch wrote: On Tue, August 15, 2006 6:54 am, bob pilly wrote: Im trying to send emails using the mail() function but im having a problem. Because the box that the scripts sit on is a shared web-hosting package the Reply-path part of the header always comes up as [EMAIL PROTECTED] but i

Re: [PHP] Image Destroy

2006-08-15 Thread Chris
Richard Lynch wrote: On Tue, August 15, 2006 6:31 am, chris smith wrote: imagedestroy($target_id); imagedestroy($source_id); just before imagejpeg ($target_id,"$targetfile",$jpegqual); return true; } If you destroy it before you write it to disk, you gonna get garbage for your disk JPEG. de

Re: [PHP] Easier way to get the name of a variable?

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 5:05 pm, Robert Cummings wrote: > On Tue, 2006-08-15 at 16:50 -0500, Richard Lynch wrote: >> >> If the names are not predictable, the array solution is probably >> best, >> as there is movement in the PHP Internals list that may (or may not) >> make it impossible to dynamica

Re: [PHP] Mail reply-path

2006-08-15 Thread tedd
At 11:06 AM -0400 8/15/06, Jon Anderson wrote: bob pilly wrote: Im trying to send emails using the mail() function but im having a problem. Because the box that the scripts sit on is a shared web-hosting package the Reply-path part of the header always comes up as [EMAIL PROTECTED] but i have

Re: [PHP] readdir() question

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 5:56 pm, John Meyer wrote: > Richard Lynch wrote: >> On Tue, August 15, 2006 12:04 pm, John Meyer wrote: >>> I have a script to list the files in a directory: >>> >>> >>> >> $open = opendir("."); >>> while ($file = readdir($open) != false) { >>> ?> >>> >>> >>

Re: [PHP] Chicago PHP Conference

2006-08-15 Thread tedd
At 6:09 PM -0500 8/15/06, Richard Lynch wrote: I *knew* there was big city there, couldn't remember the name, but I failed on Google maps to find it... Sorry. I've even *been* to Windsor, and still couldn't remember the name. I went to Windsor once, but it was closed. tedd -- --- http://

Re: [PHP] proxy server

2006-08-15 Thread Richard Lynch
On Mon, August 14, 2006 10:24 pm, John Taylor-Johnston wrote: > I'm sure. CGI proxy I think is the key word I'm looking for. > I would even pay $10 per year for an SMTP access account if it fixed > my > problems. Think about it from the angle of a person who would consider offering this service...

Re: [PHP] Setting flags versus checking for existing/nonexisting values

2006-08-15 Thread tedd
On Tue, August 15, 2006 11:53 am, Chris W. Parker wrote: Is it a better practice to set flags to determine the action of your code or is it perfectly acceptable to have your code determine what it should do based on the existence (or lack thereof) of data? For example: -snip- flag example

Re: [PHP] Image Destroy

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 6:31 am, chris smith wrote: > imagedestroy($target_id); > imagedestroy($source_id); > > just before > > imagejpeg ($target_id,"$targetfile",$jpegqual); > return true; > } If you destroy it before you write it to disk, you gonna get garbage for your disk JPEG. destroy $targ

Re: [PHP] Chicago PHP Conference

2006-08-15 Thread Richard Lynch
I *knew* there was big city there, couldn't remember the name, but I failed on Google maps to find it... Sorry. I've even *been* to Windsor, and still couldn't remember the name. On Mon, August 14, 2006 8:55 pm, Paul Reinheimer wrote: > -- > I'm hopeful that by Spring 2007, flying to the US will

Re: [PHP] php and dynamic forms

2006-08-15 Thread Richard Lynch
On Mon, August 14, 2006 10:01 pm, Bigmark wrote: > Can anyone tell me if this is possible- > I currrently have a simple form with a textbox and submit button where > a > user chooses a number from 1-22 then on submit it opens another page > with a > table of results within another form. > What i ne

Re: [PHP] readdir() question

2006-08-15 Thread John Meyer
Richard Lynch wrote: > On Tue, August 15, 2006 12:04 pm, John Meyer wrote: >> I have a script to list the files in a directory: >> >> >> > $open = opendir("."); >> while ($file = readdir($open) != false) { >> ?> >> >> > } >> ?> >> >> >> >> And all I am getting are "1"s. I t

Re: [PHP] login script

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 5:51 am, Dave Goodchild wrote: > I think the php and mysql md5 functions differ but I may be wrong! You are wrong. :-) The whole point of MD5 is that MD5 is MD5, no matter where you go. Even ASP MD5 is the same as PHP MD5. Except it probably sucks for being too slow or y

Re: [PHP] login script

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 5:37 am, Ross wrote: > I have a couple of questions > > first how do I check two tables is it? You probably should not have 2 tables at all. Both username and password would normally be stored in a single record in the same table CREATE TABLE user ( user_id int(11) auto

Re: [PHP] Easier way to get the name of a variable?

2006-08-15 Thread David Tulloh
Chris W. Parker wrote: > Hello, > > After some "intense" searching of Google I found one example at > http://us2.php.net/language.variables on how to get the name of a > variable. But it looks pretty expensive. > > > > Anyone aware of a simple language construct(?) that can do this? I'm on > PH

Re: [PHP] Image Destroy

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 5:45 am, Tom Chubb wrote: > I know this will be really simple, but I'm struggling to get my head > round > the use of imagedestroy() > I have some code which uploads an image, resizes to create a smaller > image > and thumbnail then deletes the source image. > My question is

Re: [PHP] Mail reply-path

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 6:54 am, bob pilly wrote: > Im trying to send emails using the mail() function but im having a > problem. Because the box that the scripts sit on is a shared > web-hosting package the Reply-path part of the header always comes up > as [EMAIL PROTECTED] but i have set the fro

Re: [PHP] sorting array after array_count_values

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 9:01 am, [EMAIL PROTECTED] wrote: > I have an array of products $products > $products = array_count_values($products); > now I have an array where $key is product number and $value is how > many > times I have such a product in the array. > I want to sort this new array that

Re: [PHP] Capturing System output

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 9:19 am, Brad Bonkoski wrote: > Had this problem in the past, and always programmed around it, but > wondering if there is an easier way. > > Good Example: > Creating a setup for connecting to a mysql database. Want to do > something simple to make sure they have entered a

Re: [PHP] ftp_chmod

2006-08-15 Thread tedd
At 1:20 PM -0400 8/15/06, John Nichel wrote: tedd wrote: Before php 5, how did you guys handle ftp_chmod? Oh, I'd probably try the code outlined in the user contributed section of the ftp_chmod manual page. Bingo ! Who would have thought exactly what I wanted was where I should have looked

Re: [PHP] Setting flags versus checking for existing/nonexisting values

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 11:53 am, Chris W. Parker wrote: > Is it a better practice to set flags to determine the action of your > code or is it perfectly acceptable to have your code determine what it > should do based on the existence (or lack thereof) of data? > > For example: > > > if($value ==

Re: [PHP] readdir() question

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 12:04 pm, John Meyer wrote: > I have a script to list the files in a directory: > > >$open = opendir("."); > while ($file = readdir($open) != false) { > ?> > >} > ?> > > > > And all I am getting are "1"s. I think I'm doing it right, what is >

Re: [PHP] Easier way to get the name of a variable?

2006-08-15 Thread Robert Cummings
On Tue, 2006-08-15 at 16:50 -0500, Richard Lynch wrote: > > If the names are not predictable, the array solution is probably best, > as there is movement in the PHP Internals list that may (or may not) > make it impossible to dynamically add a property to an object. Yikes!! Do you remember the sub

Re: [PHP] Easier way to get the name of a variable?

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 1:19 pm, Chris W. Parker wrote: > After some "intense" searching of Google I found one example at > http://us2.php.net/language.variables on how to get the name of a > variable. But it looks pretty expensive. > >function vname(&$var, $scope=false, $prefix='unique', > $su

RE: [PHP] Max File Upload

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 1:50 pm, Jeremy Privett wrote: > http://us2.php.net/manual/en/ini.core.php#ini.upload-max-filesize > > In later versions of PHP, you can't use ini_set to set > upload_max_filesize > ... The changeable option is PHP_INI_PERDIR now, meaning you can only > change > it in php.in

Re: [PHP] 'weird error' possibly related to APC... how to begin debugging?

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 2:27 pm, Jochem Maas wrote: > the error is this: > > PHP Fatal error: Exception thrown without a stack frame in Unknown > on line 0 I've seen messages like this in "eval"ed code. I think I also saw something like this that was something really sick in the guts of PH

Re: [PHP] readdir() question

2006-08-15 Thread Tom Chubb
On 15/08/06, John Meyer <[EMAIL PROTECTED]> wrote: I have a script to list the files in a directory: And all I am getting are "1"s. I think I'm doing it right, what is the disconnect? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/uns

RE: [PHP] Max File Upload

2006-08-15 Thread Jeremy Privett
http://us2.php.net/manual/en/ini.core.php#ini.upload-max-filesize In later versions of PHP, you can't use ini_set to set upload_max_filesize ... The changeable option is PHP_INI_PERDIR now, meaning you can only change it in php.ini, .htaccess or httpd.conf ... http://us2.php.net/manual/en/ini.php

[PHP] 'weird error' possibly related to APC... how to begin debugging?

2006-08-15 Thread Jochem Maas
the error is this: PHP Fatal error: Exception thrown without a stack frame in Unknown on line 0 as you might guess line 0 doesn't exist in my 'Unknown' file... the problem is compounded by the fact that the error appears only sporadically (I personally only see them occasionally in the

RE: [PHP] Setting flags versus checking for existing/nonexisting values

2006-08-15 Thread Robert Cummings
On Tue, 2006-08-15 at 10:12 -0700, Chris W. Parker wrote: > Brad Bonkoski > on Tuesday, August 15, 2006 10:04 AM said: > > > Pros: potentially more readable code. > > Cons: Wasted energy typing unnecessary lines of code. > > Really I would say it comes down to coder

Re: [PHP] Max File Upload

2006-08-15 Thread John Nichel
Tom Ray [Lists] wrote: Is there anyway to overwrite the max file upload in php.ini per instant? I'd like to have users controlled on a certain website to have more then average uploads but the site runs on a shared hosting environment. http://us3.php.net/ini_set -- John C. Nichel IV Program

[PHP] Max File Upload

2006-08-15 Thread Tom Ray [Lists]
Is there anyway to overwrite the max file upload in php.ini per instant? I'd like to have users controlled on a certain website to have more then average uploads but the site runs on a shared hosting environment. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://ww

[PHP] Easier way to get the name of a variable?

2006-08-15 Thread Chris W. Parker
Hello, After some "intense" searching of Google I found one example at http://us2.php.net/language.variables on how to get the name of a variable. But it looks pretty expensive. $val) { if($val === $new) $vname = $key; } $var = $old; return $vname; } ?> Anyone aware of a simple

RE: [PHP] Setting flags versus checking for existing/nonexisting values

2006-08-15 Thread Chris W. Parker
Brad Bonkoski on Tuesday, August 15, 2006 10:04 AM said: > Pros: potentially more readable code. > Cons: Wasted energy typing unnecessary lines of code. > Really I would say it comes down to coder preference. > > (and why would you avoid the latter all together? Te

Re: [PHP] ftp_chmod

2006-08-15 Thread John Nichel
tedd wrote: Hi gang: Before php 5, how did you guys handle ftp_chmod? Oh, I'd probably try the code outlined in the user contributed section of the ftp_chmod manual page. Keep in mind: a) I'm working on a shared host; b) I'm trying to change permissions via php 4; c) because of (a) (I thi

[PHP] ftp_chmod

2006-08-15 Thread tedd
Hi gang: Before php 5, how did you guys handle ftp_chmod? Keep in mind: a) I'm working on a shared host; b) I'm trying to change permissions via php 4; c) because of (a) (I think) functions such as chmod() don't work; d) and lastly, any references/code on how to manage files (i.e., delete fil

Re: [PHP] Setting flags versus checking for existing/nonexisting values

2006-08-15 Thread Brad Bonkoski
Chris W. Parker wrote: Hello, Is it a better practice to set flags to determine the action of your code or is it perfectly acceptable to have your code determine what it should do based on the existence (or lack thereof) of data? For example: versus: Of course this is an overly simplist

[PHP] readdir() question

2006-08-15 Thread John Meyer
I have a script to list the files in a directory: And all I am getting are "1"s. I think I'm doing it right, what is the disconnect? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] login script

2006-08-15 Thread Andrew Kreps
I would hope that MD5 hashing is MD5 hashing no matter where it originates. However, I think it's better to use the database server's implementation. I believe it is less likely to be changed in future versions, and it removes some processing time from the front end. Additionally, if you ever mo

[PHP] Setting flags versus checking for existing/nonexisting values

2006-08-15 Thread Chris W. Parker
Hello, Is it a better practice to set flags to determine the action of your code or is it perfectly acceptable to have your code determine what it should do based on the existence (or lack thereof) of data? For example: versus: Of course this is an overly simplistic example but you get the

[PHP] system, exec, shell_exec, passthru [RESOLVED]

2006-08-15 Thread p . willis
Hello, This problem has now been resolved. The problem as described below was NOT caused by PHP. The problem was actually a file permissions/ownership problem. A.) The apache webserver runs as a user with specific priviledges. On this particular server the webserver runs as user 'apache'. B.) Th

Re: [PHP] Mail reply-path

2006-08-15 Thread Jon Anderson
bob pilly wrote: Im trying to send emails using the mail() function but im having a problem. Because the box that the scripts sit on is a shared web-hosting package the Reply-path part of the header always comes up as [EMAIL PROTECTED] but i have set the from part of the header to [EMAIL PROTE

Re: [PHP] Capturing System output

2006-08-15 Thread Ray Hauge
On Tuesday 15 August 2006 09:38, Brad Bonkoski wrote: > Stut wrote: > > Brad Bonkoski wrote: > >> Had this problem in the past, and always programmed around it, but > >> wondering if there is an easier way. > >> > >> Good Example: > >> Creating a setup for connecting to a mysql database. Want to d

Re: [PHP] Capturing System output

2006-08-15 Thread Stut
Brad Bonkoski wrote: Had this problem in the past, and always programmed around it, but wondering if there is an easier way. Good Example: Creating a setup for connecting to a mysql database. Want to do something simple to make sure they have entered a valid username/password for the databas

RE: [PHP] Capturing System output

2006-08-15 Thread KermodeBear
Hello, If you are working on a Linux system, you can try appending: 2>&1 To the end of your command, so that you end up with: Mysql -u $user -p{$pass} 2>&1 What this does is tell the shell to redirect anything from stderr to go through stdout. If you want to get -really- fancy you can use proc_o

Re: [PHP] Capturing System output

2006-08-15 Thread Brad Bonkoski
Stut wrote: Brad Bonkoski wrote: Had this problem in the past, and always programmed around it, but wondering if there is an easier way. Good Example: Creating a setup for connecting to a mysql database. Want to do something simple to make sure they have entered a valid username/password

Re: [PHP] Capturing System output

2006-08-15 Thread Ray Hauge
On Tuesday 15 August 2006 09:19, Brad Bonkoski wrote: > Hello All.. > > Had this problem in the past, and always programmed around it, but > wondering if there is an easier way. > > Good Example: > Creating a setup for connecting to a mysql database. Want to do > something simple to make sure they

[PHP] Capturing System output

2006-08-15 Thread Brad Bonkoski
Hello All.. Had this problem in the past, and always programmed around it, but wondering if there is an easier way. Good Example: Creating a setup for connecting to a mysql database. Want to do something simple to make sure they have entered a valid username/password for the database. So,

[PHP] sorting array after array_count_values

2006-08-15 Thread afan
hi to all! I have an array of products $products $products = array_count_values($products); now I have an array where $key is product number and $value is how many times I have such a product in the array. I want to sort this new array that product with the most "duplicates" are on the first place

[PHP] Re: header lost session variables.

2006-08-15 Thread Jo�o C�ndido de Souza Neto
So, could anyone here then explain why in other server my system it works fine? I check the two servers configuration and it´s the same, they has only one difference, one´s running php 5.0 and the other´s running php 5.1.4 Is there some difference between this two versions? ""João Cândid

Re: [PHP] Re: php and dynamic forms

2006-08-15 Thread tedd
At 1:24 AM -0400 8/15/06, Robert Cummings wrote: On Tue, 2006-08-15 at 13:02 +0800, Bigmark wrote: Does anyone have a simple example script. In the first form include a hidden field that identifies the form when you are checking the post values after submission. This way you know exactly wha

Re: [PHP] Re: Internet Explorer doesn't display UTF-8 page using UTF-8 encoding

2006-08-15 Thread tedd
At 7:42 PM -0500 8/14/06, Richard Lynch wrote: What a mess MS makes of things! Except sales. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Mail reply-path

2006-08-15 Thread bob pilly
Hi all Im trying to send emails using the mail() function but im having a problem. Because the box that the scripts sit on is a shared web-hosting package the Reply-path part of the header always comes up as [EMAIL PROTECTED] but i have set the from part of the header to [EMAIL PROTECTED] A lot

Re: [PHP] Image Destroy

2006-08-15 Thread chris smith
On 8/15/06, chris smith <[EMAIL PROTECTED]> wrote: On 8/15/06, Tom Chubb <[EMAIL PROTECTED]> wrote: > I know this will be really simple, but I'm struggling to get my head round > the use of imagedestroy() > I have some code which uploads an image, resizes to create a smaller image > and thumbnail

Re: [PHP] Image Destroy

2006-08-15 Thread chris smith
On 8/15/06, Tom Chubb <[EMAIL PROTECTED]> wrote: I know this will be really simple, but I'm struggling to get my head round the use of imagedestroy() I have some code which uploads an image, resizes to create a smaller image and thumbnail then deletes the source image. My question is which images

Re: [PHP] login script

2006-08-15 Thread Dave Goodchild
On 15/08/06, Ross <[EMAIL PROTECTED]> wrote: Hello, I have a couple of questions first how do I check two tables is it? $sql = "SELECT * FROM mytable, mytable2 WHERE username = '$username' AND userpass = '$userpass'"; Secondly my table just sends and returns straight values from the db but

Re: [PHP] login script

2006-08-15 Thread Stut
Ross wrote: first how do I check two tables is it? $sql = "SELECT * FROM mytable, mytable2 WHERE username = '$username' AND userpass = '$userpass'"; That depends on what you are trying to achieve. Your example makes no sense at all. What are you trying to get from each table? How are they

[PHP] Image Destroy

2006-08-15 Thread Tom Chubb
I know this will be really simple, but I'm struggling to get my head round the use of imagedestroy() I have some code which uploads an image, resizes to create a smaller image and thumbnail then deletes the source image. My question is which images need to be destroyed? I've read the even reusing

[PHP] login script

2006-08-15 Thread Ross
Hello, I have a couple of questions first how do I check two tables is it? $sql = "SELECT * FROM mytable, mytable2 WHERE username = '$username' AND userpass = '$userpass'"; Secondly my table just sends and returns straight values from the db but I expect some kind of encription is required.

Re: [PHP] Re: Codigo de Captcha en PHP

2006-08-15 Thread Julio B.
Hi Richard, my example is not safe, but already I wrote in the last part of my message to Ricardo that, by security, would be necessary to make use of session variables, for example, to pass the value of catpcha generated and to be able to compare it. The modification would be like this: And

RE: [PHP] break up variable and put each element in an array

2006-08-15 Thread Ivo F.A.C. Fokkema
On Mon, 14 Aug 2006 19:14:42 -0500, Richard Lynch wrote: > On Mon, August 14, 2006 2:41 am, Ivo F.A.C. Fokkema wrote: >> On Sat, 12 Aug 2006 16:36:36 -0500, Richard Lynch wrote: >>> On Fri, August 11, 2006 3:11 am, Ivo F.A.C. Fokkema wrote: Well, if it's true that some browsers on some platfor

Re: [PHP] Re: php and dynamic forms

2006-08-15 Thread Robert Cummings
On Tue, 2006-08-15 at 13:02 +0800, Bigmark wrote: > Does anyone have a simple example script. > In the first form include a hidden field that identifies the form when you are checking the post values after submission. This way you know exactly what form was submitted. Second if the first form has