|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Sun Jul 14 2002 - 03:21:08 CDT
php-general Digest 14 Jul 2002 08:21:08 -0000 Issue 1463
Topics (messages 107537 through 107584):
Animated GIFs
107537 by: Peter
Re: recusive functions
107538 by: Jome
Can't Install on Mac OS X
107539 by: Brandon Pearcy
107543 by: Liam MacKenzie
Re: Can this be done with mail()?
107540 by: John Holmes
107581 by: Richard Lynch
How do I get the name of the script?
107541 by: David Duong
107544 by: Philip Olson
107545 by: David Duong
Setting include_path
107542 by: Tim Thorburn
107565 by: Jason Wong
How come this will echo No or nothing?
107546 by: JJ Harrison
107547 by: Cal Evans
107548 by: JJ Harrison
107549 by: Cal Evans
107552 by: JJ Harrison
107555 by: Cal Evans
107556 by: JJ Harrison
107560 by: JJ Harrison
107562 by: JJ Harrison
Re: objects in an array
107550 by: Alberto Serra
Dealing with spaces and punctuation in uploaded filenames (tjlq)
107551 by: Tim Luoma
107564 by: Jason Wong
107582 by: Richard Lynch
Newbie question
107553 by: Jay
107554 by: Cal Evans
107561 by: Alberto Serra
Re: problem with cookies and some browsers
107557 by: Justin French
Re: PHPDiscuss.com
107558 by: Justin French
107559 by: Jeff Lewis
TOC protocol (AOL Instant Messenger)
107563 by: SpamSucks86
Re: Can not delete files that were uploaded
107566 by: Richard Lynch
Re: how can this be? GET instead of POST -> db error
107567 by: Richard Lynch
Re: Problems with apache and php
107568 by: Richard Lynch
Re: HTTP_USER_AGENT?
107569 by: Richard Lynch
Re: xml and max size of xml doc
107570 by: Richard Lynch
Re: PHP meetup
107571 by: Richard Lynch
Re: A question of style ...
107572 by: Richard Lynch
Re: Emulating Java Exceptions
107573 by: Richard Lynch
Re: Write EXIF - is it possible?
107574 by: Richard Lynch
Re: Final Year Computer Science Project involving PHP
107575 by: Richard Lynch
Re: black becomes red w/ imagecreatefromjpeg
107576 by: Richard Lynch
Re: Encoding problem with command line PHP.exe
107577 by: Richard Lynch
Re: pgSQL Functions with results set to php?
107578 by: Richard Lynch
Re: PHP install - what features?
107579 by: Richard Lynch
Re: New 2 PHP
107580 by: Richard Lynch
serverside restrictions
107583 by: Liam MacKenzie
state engine or HTML parser
107584 by: Justin French
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
I know GIF support was dropped from the GD library, but can you make
animated GIFs in any version of GD?
attached mail follows:
"Alexander Ross" <alexross
bleen.net> skrev i meddelandet
news:20020713163408.82890.qmail
pb1.pair.com...
> Does exit() in a recursive function exit the entire function, of does it
> only exit that iteration of teh function?? Thanks
exit terminas the whole script and not just a function. Read more on
http://php.net/exit
-Jome
attached mail follows:
Hi Everyone,
In the past I have setup many Mac OS X web servers successfully. Now
I'm trying to setup another OS X web server, but PHP will not work.
I'm having massive problems getting PHP to "make", and I'm all out of
ideas. After I configure PHP (./configure), and try to make it, I get
these errors:
make[1]: *** [php] Error 1
make: *** [all-recursive] Error 1
I've tried an alternative way of installing from Marc Liyanage's web
site, http://www.entropy.ch/ which was very easy to follow, but it
absolutely will not allow me to view any PHP pages through Apache.
PHP prints out the following error instead:
Warning: Failed opening '/Library/WebServer/Documents/test.php' for
inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0
As you can see, the file's name is test.php, but you should know it
has absolutely NO PHP code in it. It's contents are:
<html>
<body>
Why don't I work?
</body>
</html>
Anyone have any ideas?
If anyone is willing, could they download the latest source of PHP
and try to configure and make it (don't bother make install-ing
it...) If you have any success with it, let me know.
Thanks in advance!
-- -------------------------- Brandon Pearcy Internet TechnicianBowes Online -------------------------- phone: 1-780-532-1110 ext. 265 fax: 1-780-532-2120 bpearcy
bowesnet.com
attached mail follows:
What extras are you compiling in with it?
Compile PHP and Apache with the bare minimum only, no fancy stuff. Try it then.
I sucessfully compiled several machines using the latest source code yesterday.
----- Original Message -----
From: "Brandon Pearcy" <bpearcy
mail.bowesnet.com>
To: <php-general
lists.php.net>
Sent: Sunday, July 14, 2002 6:03 AM
Subject: [PHP] Can't Install on Mac OS X
> Hi Everyone,
>
> In the past I have setup many Mac OS X web servers successfully. Now
> I'm trying to setup another OS X web server, but PHP will not work.
> I'm having massive problems getting PHP to "make", and I'm all out of
> ideas. After I configure PHP (./configure), and try to make it, I get
> these errors:
>
> make[1]: *** [php] Error 1
> make: *** [all-recursive] Error 1
>
> I've tried an alternative way of installing from Marc Liyanage's web
> site, http://www.entropy.ch/ which was very easy to follow, but it
> absolutely will not allow me to view any PHP pages through Apache.
> PHP prints out the following error instead:
>
> Warning: Failed opening '/Library/WebServer/Documents/test.php' for
> inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0
>
> As you can see, the file's name is test.php, but you should know it
> has absolutely NO PHP code in it. It's contents are:
>
> <html>
> <body>
> Why don't I work?
> </body>
> </html>
>
> Anyone have any ideas?
>
> If anyone is willing, could they download the latest source of PHP
> and try to configure and make it (don't bother make install-ing
> it...) If you have any success with it, let me know.
>
> Thanks in advance!
> --
> --------------------------
> Brandon Pearcy
> Internet Technician
>
> Bowes Online
> --------------------------
> phone: 1-780-532-1110 ext. 265
> fax: 1-780-532-2120
> bpearcy
bowesnet.com
attached mail follows:
> I need to query a database and return a resultset. A php script will then > sort through the data and send the data to the browser in the form of a > table. > > Is it possible to gather the the results with html tags and store them in > a variable so that the results can be emailed to someone? If so, how would > this be done?
Instead of using print or echo to display the HTML table, just assign it all to a variable. Then you can print it out later, or mail it, or whatever.
Or use output buffering...
---John Holmes...
attached mail follows:
> >I need to query a database and return a resultset. A php script will then >sort through the data and send the data to the browser in the form of a table. > >Is it possible to gather the the results with html tags and store them in a >variable so that the results can be emailed to someone? If so, how would >this be done?
Do as much of the sorting/searching in SQL as you can. MUCH faster.
Use the mail class from http://phpclasses.org to do the html-enhanced email.
WARNING: Many readers will simply *TRASH* your "enhanced" email. Re-think your priorities.
Collecting your HTML in a variable is easy:
<?php $html = ''; # Get db stuff $html .= "<TABLE>\n"; # Loop through results{ $html .= "<TR><TD>$x</TD><TD>$y</TD><TD>$z</TD></TR>\n"; } $html .= "</TABLE>\n"; ?>
It's just like doing everything with "echo", only not. :-)
You may want to echo some stuff out as well, so you know what's happening...
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
Is their a function that returns an equivalent of $PHP_SELF?
attached mail follows:
You have many options. Do a call to phpinfo() and note all the predefined variables, such as PHP_SELF. There is also the __FILE__ constant, print that too.
Why do you request a function? If it's because $PHP_SELF is not set, that's because the PHP directive register_globals = off. Go through the predefined server array instead, it's sexier:
print $_SERVER['PHP_SELF'];
See also: http://www.php.net/manual/en/reserved.variables.php
Regards, Philip Olson
On Sat, 13 Jul 2002, David Duong wrote:
> Is their a function that returns an equivalent of $PHP_SELF? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Thnx for hte help, I wanted to keep register globals off, its a security
hazard.
"Philip Olson" <philip
cornado.com> wrote in message
news:Pine.BSF.4.10.10207140050140.63499-100000
localhost...
>
> You have many options. Do a call to phpinfo() and
> note all the predefined variables, such as PHP_SELF.
> There is also the __FILE__ constant, print that too.
>
> Why do you request a function? If it's because
> $PHP_SELF is not set, that's because the PHP
> directive register_globals = off. Go through the
> predefined server array instead, it's sexier:
>
> print $_SERVER['PHP_SELF'];
>
> See also:
> http://www.php.net/manual/en/reserved.variables.php
>
> Regards,
> Philip Olson
>
>
> On Sat, 13 Jul 2002, David Duong wrote:
>
> > Is their a function that returns an equivalent of $PHP_SELF?
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
attached mail follows:
Hi,
I'm having some difficulties setting the include path for two of my sites. I had this working previously on a PHP3 server with the command in the .htaccess file:
php3_include_path ".:/path/to/account/root/"
However, I seem to be unable to set the include path with two new sites - one running PHP 4.1.2, the other using PHP 4.2.0.
I've gone through the settings listed on the PHP Configuration page: http://www.php.net/manual/en/configuration.php
Yet none seem to work.
php_value include_path ".:/path/to/account/root" php_include_path ".:/path/to/account/root/" php4_include_path ".:/path/to/account/root/"
Could someone please shed some light on this subject? I'm in a sort of bind as my client desperately needs their site up for a week long sporting event that just began this past Friday (yesterday).
Thanks in advance -Tim
attached mail follows:
On Sunday 14 July 2002 07:36, Tim Thorburn wrote: > Hi, > > I'm having some difficulties setting the include path for two of my > sites. I had this working previously on a PHP3 server with the command in > the .htaccess file: > > php3_include_path ".:/path/to/account/root/" > > However, I seem to be unable to set the include path with two new sites - > one running PHP 4.1.2, the other using PHP 4.2.0. > > I've gone through the settings listed on the PHP Configuration page: > http://www.php.net/manual/en/configuration.php > > Yet none seem to work. > > php_value include_path ".:/path/to/account/root"
This one _should_ work. Try it without the double-quotes.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* I know how to do SPECIAL EFFECTS!! */
attached mail follows:
here is the portion of the script:
if($row['plevel'] == '0'){ echo 'No'; } else { echo 'Yes'; }
here is my table structure dump:
# # Table structure for table `docs` #
CREATE TABLE docs ( id int(11) unsigned NOT NULL auto_increment, name varchar(200) NOT NULL default '', note varchar(200) NOT NULL default '', author varchar(200) NOT NULL default '', path varchar(200) NOT NULL default '', plevel tinyint(3) NOT NULL default '0', type char(3) NOT NULL default '', cat tinyint(3) NOT NULL default '0', file_size int(11) unsigned NOT NULL default '0', date int(11) unsigned NOT NULL default '0', PRIMARY KEY (id) ) TYPE=MyISAM;
the row plevel is either 0 or 1.
why won't this script echo Yes?
The reason that the plevel is set in numbers is because I may add higher ones later.
-- JJ Harrison webmastertececo.com www.tececo.com
attached mail follows:
because $row['plevel'] is NEVER == '0' It is probably == 0 though. (note the missing quotes. ) :)
HTH, =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com *
-----Original Message-----
From: JJ Harrison [mailto:webmaster
tececo.com]
Sent: Friday, July 12, 2002 11:01 PM
To: php-general
lists.php.net
Subject: [PHP] How come this will echo No or nothing?
here is the portion of the script:
if($row['plevel'] == '0'){ echo 'No'; } else { echo 'Yes'; }
here is my table structure dump:
# # Table structure for table `docs` #
CREATE TABLE docs ( id int(11) unsigned NOT NULL auto_increment, name varchar(200) NOT NULL default '', note varchar(200) NOT NULL default '', author varchar(200) NOT NULL default '', path varchar(200) NOT NULL default '', plevel tinyint(3) NOT NULL default '0', type char(3) NOT NULL default '', cat tinyint(3) NOT NULL default '0', file_size int(11) unsigned NOT NULL default '0', date int(11) unsigned NOT NULL default '0', PRIMARY KEY (id) ) TYPE=MyISAM;
the row plevel is either 0 or 1.
why won't this script echo Yes?
The reason that the plevel is set in numbers is because I may add higher ones later.
-- JJ Harrison webmastertececo.com www.tececo.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I tried that.
same result.
Here is my (new) snippet:
if($row['plevel'] == 0){ echo 'No'; } else { echo 'Yes'; }
"Cal Evans" <cal
calevans.com> wrote in message
news:FLEGKEMHDIDDEJOGHHNFMENMFJAA.cal
calevans.com...
> because $row['plevel'] is NEVER == '0' It is probably == 0 though. (note
> the missing quotes. ) :)
>
> HTH,
> =C=
> *
> * Cal Evans
> * The Virtual CIO
> * http://www.calevans.com
> *
>
>
> -----Original Message-----
> From: JJ Harrison [mailto:webmaster
tececo.com]
> Sent: Friday, July 12, 2002 11:01 PM
> To: php-general
lists.php.net
> Subject: [PHP] How come this will echo No or nothing?
>
>
> here is the portion of the script:
>
> if($row['plevel'] == '0'){
> echo 'No';
> } else {
> echo 'Yes';
> }
>
> here is my table structure dump:
>
> #
> # Table structure for table `docs`
> #
>
> CREATE TABLE docs (
> id int(11) unsigned NOT NULL auto_increment,
> name varchar(200) NOT NULL default '',
> note varchar(200) NOT NULL default '',
> author varchar(200) NOT NULL default '',
> path varchar(200) NOT NULL default '',
> plevel tinyint(3) NOT NULL default '0',
> type char(3) NOT NULL default '',
> cat tinyint(3) NOT NULL default '0',
> file_size int(11) unsigned NOT NULL default '0',
> date int(11) unsigned NOT NULL default '0',
> PRIMARY KEY (id)
> ) TYPE=MyISAM;
>
> the row plevel is either 0 or 1.
>
> why won't this script echo Yes?
>
> The reason that the plevel is set in numbers is because I may add higher
> ones later.
>
> --
> JJ Harrison
> webmaster
tececo.com
> www.tececo.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Have you done a var_dump on $row to make sure that plevel exists?
=C=
* * Cal Evans * The Virtual CIO * http://www.calevans.com *
-----Original Message-----
From: JJ Harrison [mailto:webmaster
tececo.com]
Sent: Friday, July 12, 2002 11:11 PM
To: php-general
lists.php.net
Subject: Re: [PHP] How come this will echo No or nothing?
I tried that.
same result.
Here is my (new) snippet:
if($row['plevel'] == 0){ echo 'No'; } else { echo 'Yes'; }
"Cal Evans" <cal
calevans.com> wrote in message
news:FLEGKEMHDIDDEJOGHHNFMENMFJAA.cal
calevans.com...
> because $row['plevel'] is NEVER == '0' It is probably == 0 though. (note
> the missing quotes. ) :)
>
> HTH,
> =C=
> *
> * Cal Evans
> * The Virtual CIO
> * http://www.calevans.com
> *
>
>
> -----Original Message-----
> From: JJ Harrison [mailto:webmaster
tececo.com]
> Sent: Friday, July 12, 2002 11:01 PM
> To: php-general
lists.php.net
> Subject: [PHP] How come this will echo No or nothing?
>
>
> here is the portion of the script:
>
> if($row['plevel'] == '0'){
> echo 'No';
> } else {
> echo 'Yes';
> }
>
> here is my table structure dump:
>
> #
> # Table structure for table `docs`
> #
>
> CREATE TABLE docs (
> id int(11) unsigned NOT NULL auto_increment,
> name varchar(200) NOT NULL default '',
> note varchar(200) NOT NULL default '',
> author varchar(200) NOT NULL default '',
> path varchar(200) NOT NULL default '',
> plevel tinyint(3) NOT NULL default '0',
> type char(3) NOT NULL default '',
> cat tinyint(3) NOT NULL default '0',
> file_size int(11) unsigned NOT NULL default '0',
> date int(11) unsigned NOT NULL default '0',
> PRIMARY KEY (id)
> ) TYPE=MyISAM;
>
> the row plevel is either 0 or 1.
>
> why won't this script echo Yes?
>
> The reason that the plevel is set in numbers is because I may add higher
> ones later.
>
> --
> JJ Harrison
> webmaster
tececo.com
> www.tececo.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
The value of plevel is "0" according to var_dump.
-- JJ Harrison webmastertececo.com www.tececo.com
"Cal Evans" <cal
calevans.com> wrote in message news:FLEGKEMHDIDDEJOGHHNFIENNFJAA.cal
calevans.com... > Have you done a var_dump on $row to make sure that plevel exists? > > =C= > > * > * Cal Evans > * The Virtual CIO > * http://www.calevans.com > * > > > -----Original Message----- > From: JJ Harrison [mailto:webmaster
tececo.com] > Sent: Friday, July 12, 2002 11:11 PM > To: php-general
lists.php.net > Subject: Re: [PHP] How come this will echo No or nothing? > > > I tried that. > > same result. > > Here is my (new) snippet: > > if($row['plevel'] == 0){ > echo 'No'; > } else { > echo 'Yes'; > } > > "Cal Evans" <cal
calevans.com> wrote in message > news:FLEGKEMHDIDDEJOGHHNFMENMFJAA.cal
calevans.com... > > because $row['plevel'] is NEVER == '0' It is probably == 0 though. (note > > the missing quotes. ) :) > > > > HTH, > > =C= > > * > > * Cal Evans > > * The Virtual CIO > > * http://www.calevans.com > > * > > > > > > -----Original Message----- > > From: JJ Harrison [mailto:webmaster
tececo.com] > > Sent: Friday, July 12, 2002 11:01 PM > > To: php-general
lists.php.net > > Subject: [PHP] How come this will echo No or nothing? > > > > > > here is the portion of the script: > > > > if($row['plevel'] == '0'){ > > echo 'No'; > > } else { > > echo 'Yes'; > > } > > > > here is my table structure dump: > > > > # > > # Table structure for table `docs` > > # > > > > CREATE TABLE docs ( > > id int(11) unsigned NOT NULL auto_increment, > > name varchar(200) NOT NULL default '', > > note varchar(200) NOT NULL default '', > > author varchar(200) NOT NULL default '', > > path varchar(200) NOT NULL default '', > > plevel tinyint(3) NOT NULL default '0', > > type char(3) NOT NULL default '', > > cat tinyint(3) NOT NULL default '0', > > file_size int(11) unsigned NOT NULL default '0', > > date int(11) unsigned NOT NULL default '0', > > PRIMARY KEY (id) > > ) TYPE=MyISAM; > > > > the row plevel is either 0 or 1. > > > > why won't this script echo Yes? > > > > The reason that the plevel is set in numbers is because I may add higher > > ones later. > > > > -- > > JJ Harrison > > webmaster
tececo.com > > www.tececo.com > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
off the top of my head, I'd suggest :
if(intval($row['plevel']) == 0){
Grasping at straws here but you've moved beyond a simple question into a debigging process. (Which doesn't work too well for email.)
Sorry I couldn't be of more help. =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com *
-----Original Message-----
From: JJ Harrison [mailto:webmaster
tececo.com]
Sent: Friday, July 12, 2002 11:26 PM
To: php-general
lists.php.net
Subject: Re: [PHP] How come this will echo No or nothing?
The value of plevel is "0" according to var_dump.
-- JJ Harrison webmastertececo.com www.tececo.com
"Cal Evans" <cal
calevans.com> wrote in message news:FLEGKEMHDIDDEJOGHHNFIENNFJAA.cal
calevans.com... > Have you done a var_dump on $row to make sure that plevel exists? > > =C= > > * > * Cal Evans > * The Virtual CIO > * http://www.calevans.com > * > > > -----Original Message----- > From: JJ Harrison [mailto:webmaster
tececo.com] > Sent: Friday, July 12, 2002 11:11 PM > To: php-general
lists.php.net > Subject: Re: [PHP] How come this will echo No or nothing? > > > I tried that. > > same result. > > Here is my (new) snippet: > > if($row['plevel'] == 0){ > echo 'No'; > } else { > echo 'Yes'; > } > > "Cal Evans" <cal
calevans.com> wrote in message > news:FLEGKEMHDIDDEJOGHHNFMENMFJAA.cal
calevans.com... > > because $row['plevel'] is NEVER == '0' It is probably == 0 though. (note > > the missing quotes. ) :) > > > > HTH, > > =C= > > * > > * Cal Evans > > * The Virtual CIO > > * http://www.calevans.com > > * > > > > > > -----Original Message----- > > From: JJ Harrison [mailto:webmaster
tececo.com] > > Sent: Friday, July 12, 2002 11:01 PM > > To: php-general
lists.php.net > > Subject: [PHP] How come this will echo No or nothing? > > > > > > here is the portion of the script: > > > > if($row['plevel'] == '0'){ > > echo 'No'; > > } else { > > echo 'Yes'; > > } > > > > here is my table structure dump: > > > > # > > # Table structure for table `docs` > > # > > > > CREATE TABLE docs ( > > id int(11) unsigned NOT NULL auto_increment, > > name varchar(200) NOT NULL default '', > > note varchar(200) NOT NULL default '', > > author varchar(200) NOT NULL default '', > > path varchar(200) NOT NULL default '', > > plevel tinyint(3) NOT NULL default '0', > > type char(3) NOT NULL default '', > > cat tinyint(3) NOT NULL default '0', > > file_size int(11) unsigned NOT NULL default '0', > > date int(11) unsigned NOT NULL default '0', > > PRIMARY KEY (id) > > ) TYPE=MyISAM; > > > > the row plevel is either 0 or 1. > > > > why won't this script echo Yes? > > > > The reason that the plevel is set in numbers is because I may add higher > > ones later. > > > > -- > > JJ Harrison > > webmaster
tececo.com > > www.tececo.com > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Still doesn't work.
I'll have to think about it.
I may raise all the values in the plevel colomn by one.
It may work then.
-- JJ Harrison webmastertececo.com www.tececo.com
"Cal Evans" <cal
calevans.com> wrote in message news:FLEGKEMHDIDDEJOGHHNFCEOAFJAA.cal
calevans.com... > off the top of my head, I'd suggest : > > if(intval($row['plevel']) == 0){ > > Grasping at straws here but you've moved beyond a simple question into a > debigging process. (Which doesn't work too well for email.) > > Sorry I couldn't be of more help. > =C= > * > * Cal Evans > * The Virtual CIO > * http://www.calevans.com > * > > > -----Original Message----- > From: JJ Harrison [mailto:webmaster
tececo.com] > Sent: Friday, July 12, 2002 11:26 PM > To: php-general
lists.php.net > Subject: Re: [PHP] How come this will echo No or nothing? > > > The value of plevel is "0" according to var_dump. > > > -- > JJ Harrison > webmaster
tececo.com > www.tececo.com > > "Cal Evans" <cal
calevans.com> wrote in message > news:FLEGKEMHDIDDEJOGHHNFIENNFJAA.cal
calevans.com... > > Have you done a var_dump on $row to make sure that plevel exists? > > > > =C= > > > > * > > * Cal Evans > > * The Virtual CIO > > * http://www.calevans.com > > * > > > > > > -----Original Message----- > > From: JJ Harrison [mailto:webmaster
tececo.com] > > Sent: Friday, July 12, 2002 11:11 PM > > To: php-general
lists.php.net > > Subject: Re: [PHP] How come this will echo No or nothing? > > > > > > I tried that. > > > > same result. > > > > Here is my (new) snippet: > > > > if($row['plevel'] == 0){ > > echo 'No'; > > } else { > > echo 'Yes'; > > } > > > > "Cal Evans" <cal
calevans.com> wrote in message > > news:FLEGKEMHDIDDEJOGHHNFMENMFJAA.cal
calevans.com... > > > because $row['plevel'] is NEVER == '0' It is probably == 0 though. > (note > > > the missing quotes. ) :) > > > > > > HTH, > > > =C= > > > * > > > * Cal Evans > > > * The Virtual CIO > > > * http://www.calevans.com > > > * > > > > > > > > > -----Original Message----- > > > From: JJ Harrison [mailto:webmaster
tececo.com] > > > Sent: Friday, July 12, 2002 11:01 PM > > > To: php-general
lists.php.net > > > Subject: [PHP] How come this will echo No or nothing? > > > > > > > > > here is the portion of the script: > > > > > > if($row['plevel'] == '0'){ > > > echo 'No'; > > > } else { > > > echo 'Yes'; > > > } > > > > > > here is my table structure dump: > > > > > > # > > > # Table structure for table `docs` > > > # > > > > > > CREATE TABLE docs ( > > > id int(11) unsigned NOT NULL auto_increment, > > > name varchar(200) NOT NULL default '', > > > note varchar(200) NOT NULL default '', > > > author varchar(200) NOT NULL default '', > > > path varchar(200) NOT NULL default '', > > > plevel tinyint(3) NOT NULL default '0', > > > type char(3) NOT NULL default '', > > > cat tinyint(3) NOT NULL default '0', > > > file_size int(11) unsigned NOT NULL default '0', > > > date int(11) unsigned NOT NULL default '0', > > > PRIMARY KEY (id) > > > ) TYPE=MyISAM; > > > > > > the row plevel is either 0 or 1. > > > > > > why won't this script echo Yes? > > > > > > The reason that the plevel is set in numbers is because I may add higher > > > ones later. > > > > > > -- > > > JJ Harrison > > > webmaster
tececo.com > > > www.tececo.com > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
It *still* didn't work.
I will increment all table cells using a single update query to do them all.
-- JJ Harrison webmastertececo.com www.tececo.com
"Jj Harrison" <webmaster
tececo.com> wrote in message news:20020714014702.34050.qmail
pb1.pair.com... > Still doesn't work. > > I'll have to think about it. > > I may raise all the values in the plevel colomn by one. > > It may work then. > > > -- > JJ Harrison > webmaster
tececo.com > www.tececo.com > > "Cal Evans" <cal
calevans.com> wrote in message > news:FLEGKEMHDIDDEJOGHHNFCEOAFJAA.cal
calevans.com... > > off the top of my head, I'd suggest : > > > > if(intval($row['plevel']) == 0){ > > > > Grasping at straws here but you've moved beyond a simple question into a > > debigging process. (Which doesn't work too well for email.) > > > > Sorry I couldn't be of more help. > > =C= > > * > > * Cal Evans > > * The Virtual CIO > > * http://www.calevans.com > > * > > > > > > -----Original Message----- > > From: JJ Harrison [mailto:webmaster
tececo.com] > > Sent: Friday, July 12, 2002 11:26 PM > > To: php-general
lists.php.net > > Subject: Re: [PHP] How come this will echo No or nothing? > > > > > > The value of plevel is "0" according to var_dump. > > > > > > -- > > JJ Harrison > > webmaster
tececo.com > > www.tececo.com > > > > "Cal Evans" <cal
calevans.com> wrote in message > > news:FLEGKEMHDIDDEJOGHHNFIENNFJAA.cal
calevans.com... > > > Have you done a var_dump on $row to make sure that plevel exists? > > > > > > =C= > > > > > > * > > > * Cal Evans > > > * The Virtual CIO > > > * http://www.calevans.com > > > * > > > > > > > > > -----Original Message----- > > > From: JJ Harrison [mailto:webmaster
tececo.com] > > > Sent: Friday, July 12, 2002 11:11 PM > > > To: php-general
lists.php.net > > > Subject: Re: [PHP] How come this will echo No or nothing? > > > > > > > > > I tried that. > > > > > > same result. > > > > > > Here is my (new) snippet: > > > > > > if($row['plevel'] == 0){ > > > echo 'No'; > > > } else { > > > echo 'Yes'; > > > } > > > > > > "Cal Evans" <cal
calevans.com> wrote in message > > > news:FLEGKEMHDIDDEJOGHHNFMENMFJAA.cal
calevans.com... > > > > because $row['plevel'] is NEVER == '0' It is probably == 0 though. > > (note > > > > the missing quotes. ) :) > > > > > > > > HTH, > > > > =C= > > > > * > > > > * Cal Evans > > > > * The Virtual CIO > > > > * http://www.calevans.com > > > > * > > > > > > > > > > > > -----Original Message----- > > > > From: JJ Harrison [mailto:webmaster
tececo.com] > > > > Sent: Friday, July 12, 2002 11:01 PM > > > > To: php-general
lists.php.net > > > > Subject: [PHP] How come this will echo No or nothing? > > > > > > > > > > > > here is the portion of the script: > > > > > > > > if($row['plevel'] == '0'){ > > > > echo 'No'; > > > > } else { > > > > echo 'Yes'; > > > > } > > > > > > > > here is my table structure dump: > > > > > > > > # > > > > # Table structure for table `docs` > > > > # > > > > > > > > CREATE TABLE docs ( > > > > id int(11) unsigned NOT NULL auto_increment, > > > > name varchar(200) NOT NULL default '', > > > > note varchar(200) NOT NULL default '', > > > > author varchar(200) NOT NULL default '', > > > > path varchar(200) NOT NULL default '', > > > > plevel tinyint(3) NOT NULL default '0', > > > > type char(3) NOT NULL default '', > > > > cat tinyint(3) NOT NULL default '0', > > > > file_size int(11) unsigned NOT NULL default '0', > > > > date int(11) unsigned NOT NULL default '0', > > > > PRIMARY KEY (id) > > > > ) TYPE=MyISAM; > > > > > > > > the row plevel is either 0 or 1. > > > > > > > > why won't this script echo Yes? > > > > > > > > The reason that the plevel is set in numbers is because I may add > higher > > > > ones later. > > > > > > > > -- > > > > JJ Harrison > > > > webmaster
tececo.com > > > > www.tececo.com > > > > > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > >
attached mail follows:
I found figured it out.
I am a n00b BTW.
the snippet was caught inside anouther if statment so it was only displaying if the file was under a Meg in size!
-- JJ Harrison webmastertececo.com www.tececo.com
"Jj Harrison" <webmaster
tececo.com> wrote in message news:20020714014702.34050.qmail
pb1.pair.com... > Still doesn't work. > > I'll have to think about it. > > I may raise all the values in the plevel colomn by one. > > It may work then. > > > -- > JJ Harrison > webmaster
tececo.com > www.tececo.com > > "Cal Evans" <cal
calevans.com> wrote in message > news:FLEGKEMHDIDDEJOGHHNFCEOAFJAA.cal
calevans.com... > > off the top of my head, I'd suggest : > > > > if(intval($row['plevel']) == 0){ > > > > Grasping at straws here but you've moved beyond a simple question into a > > debigging process. (Which doesn't work too well for email.) > > > > Sorry I couldn't be of more help. > > =C= > > * > > * Cal Evans > > * The Virtual CIO > > * http://www.calevans.com > > * > > > > > > -----Original Message----- > > From: JJ Harrison [mailto:webmaster
tececo.com] > > Sent: Friday, July 12, 2002 11:26 PM > > To: php-general
lists.php.net > > Subject: Re: [PHP] How come this will echo No or nothing? > > > > > > The value of plevel is "0" according to var_dump. > > > > > > -- > > JJ Harrison > > webmaster
tececo.com > > www.tececo.com > > > > "Cal Evans" <cal
calevans.com> wrote in message > > news:FLEGKEMHDIDDEJOGHHNFIENNFJAA.cal
calevans.com... > > > Have you done a var_dump on $row to make sure that plevel exists? > > > > > > =C= > > > > > > * > > > * Cal Evans > > > * The Virtual CIO > > > * http://www.calevans.com > > > * > > > > > > > > > -----Original Message----- > > > From: JJ Harrison [mailto:webmaster
tececo.com] > > > Sent: Friday, July 12, 2002 11:11 PM > > > To: php-general
lists.php.net > > > Subject: Re: [PHP] How come this will echo No or nothing? > > > > > > > > > I tried that. > > > > > > same result. > > > > > > Here is my (new) snippet: > > > > > > if($row['plevel'] == 0){ > > > echo 'No'; > > > } else { > > > echo 'Yes'; > > > } > > > > > > "Cal Evans" <cal
calevans.com> wrote in message > > > news:FLEGKEMHDIDDEJOGHHNFMENMFJAA.cal
calevans.com... > > > > because $row['plevel'] is NEVER == '0' It is probably == 0 though. > > (note > > > > the missing quotes. ) :) > > > > > > > > HTH, > > > > =C= > > > > * > > > > * Cal Evans > > > > * The Virtual CIO > > > > * http://www.calevans.com > > > > * > > > > > > > > > > > > -----Original Message----- > > > > From: JJ Harrison [mailto:webmaster
tececo.com] > > > > Sent: Friday, July 12, 2002 11:01 PM > > > > To: php-general
lists.php.net > > > > Subject: [PHP] How come this will echo No or nothing? > > > > > > > > > > > > here is the portion of the script: > > > > > > > > if($row['plevel'] == '0'){ > > > > echo 'No'; > > > > } else { > > > > echo 'Yes'; > > > > } > > > > > > > > here is my table structure dump: > > > > > > > > # > > > > # Table structure for table `docs` > > > > # > > > > > > > > CREATE TABLE docs ( > > > > id int(11) unsigned NOT NULL auto_increment, > > > > name varchar(200) NOT NULL default '', > > > > note varchar(200) NOT NULL default '', > > > > author varchar(200) NOT NULL default '', > > > > path varchar(200) NOT NULL default '', > > > > plevel tinyint(3) NOT NULL default '0', > > > > type char(3) NOT NULL default '', > > > > cat tinyint(3) NOT NULL default '0', > > > > file_size int(11) unsigned NOT NULL default '0', > > > > date int(11) unsigned NOT NULL default '0', > > > > PRIMARY KEY (id) > > > > ) TYPE=MyISAM; > > > > > > > > the row plevel is either 0 or 1. > > > > > > > > why won't this script echo Yes? > > > > > > > > The reason that the plevel is set in numbers is because I may add > higher > > > > ones later. > > > > > > > > -- > > > > JJ Harrison > > > > webmaster
tececo.com > > > > www.tececo.com > > > > > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > >
attached mail follows:
Привет!
Alexander Ross wrote: > I have an array filled with objects. Each object has a method called > "display". > > I have > > $var = $arr[0]; > $var->display(); > > but I keep getting an error. What am I doing wrong? > (I do a print_r of the array immediately before this code and there is an > object at array[0])
What classes? Which error? Can't say anything with the scarce info you gave in.
пока Альберто Киев
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......
attached mail follows:
I am using this basic example (from the manual iirc) for uploading files
<form enctype="multipart/form-data" action="upload.php" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="1000" /> Upload this file: <input name="userfile" type="file" /> <input type="submit" value="Send File" /> </form>
What I am trying to do then is to remove any spaces or punctuation that might be in the filename.
This is what I am using for the filename:
$FILENAME = $_FILES['userfile']['name'];
and this is what I was trying to use to remove the space and punctuation (all one line, might wrap in email):
$SAFEFILENAME = ereg_replace ("[[:punct:]]+[[:blank:]]+", "", $FILENAME);
But that does not seem to be working, and I have not been able to figure out why.
Any help appreciated.
Thanks
TjL
attached mail follows:
On Sunday 14 July 2002 09:20, Tim Luoma wrote:
> and this is what I was trying to use to remove the space and punctuation > (all one line, might wrap in email): > > $SAFEFILENAME = ereg_replace ("[[:punct:]]+[[:blank:]]+", "", $FILENAME); > > But that does not seem to be working, and I have not been able to figure > out why.
What the above seems to be doing is replace:
a series of one or more punctuation marks FOLLOWED BY a series of one or more spaces
Which is not what you want. Presumably anything which isn't alphanumeric is classed as either space or punctuation? If so:
I prefer preg_replace so try:
$SAFEFILENAME = preg_replace('/[^a-zA-Z0-9]/', '', $FILENAME);
*** Untested use with caution ***
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* While you don't greatly need the outside world, it's still very reassuring to know that it's still there. */
attached mail follows:
>$SAFEFILENAME = ereg_replace ("[[:punct:]]+[[:blank:]]+", "", $FILENAME); > >But that does not seem to be working, and I have not been able to figure >out why.
It's better to specifically *ALLOW* certain characters than to try to list all the ones you do *NOT* allow:
# Get rid of gnarly characters in filenames: $filename = ereg_replace('[^a-zA-Z0-9_\\.-]', '', $photo_name); $filename = $filename ? $filename : chr(rand(ord('A'),ord('Z'))) . chr(rand(ord('A'),ord('Z'))) . chr(rand(ord('A'),ord('Z'))) . chr(rand(ord('A'),ord('Z'))); if (!ereg('[a-zA-Z0-9_-]+[\\.]*[a-zA-Z0-9_-]*', $filename)){ $filename = chr(rand(ord('A'),ord('Z'))) . chr(rand(ord('A'),ord('Z'))) . chr(rand(ord('A'),ord('Z'))) . chr(rand(ord('A'),ord('Z'))) . $filename; }
Here, I throw out anything that's not alphanumeric, underscore (_), dot (\\.), or dash (-)
I also accept that fact that some goofball will end up have a file name with *NOTHING* useful in it, and then I just make a random filename up.
Damned if I know why I felt the need for that last if(){} part...
Maybe ord('Z') should be ord('Y') and I was getting whatever comes after Z some of the time???
Or perhaps that just adds four more characters on when I *DO* need to make up random names?
That part looks pretty broken to me right now, but maybe I just need some sleep.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
I have just started to teach myself php so I am reading through several scripts to see how the language is "spoken". I came across the following at phpworld.com
$i = 1; while ($i <= 10) { print $i++
Its a little script that counts from 1 to 10, but what does $i++ mean. What does the ++ do? Why ++ and not just one +
Thanks
-Jay
attached mail follows:
++ is an incrementor.
$i=1; $i++; echo $i;
=C=
p.s. -- is a decrementor.
* * Cal Evans * The Virtual CIO * http://www.calevans.com *
-----Original Message-----
From: Jay [mailto:jay
nixit.ca]
Sent: Saturday, July 13, 2002 8:32 PM
To: php-general
lists.php.net
Subject: [PHP] Newbie question
I have just started to teach myself php so I am reading through several scripts to see how the language is "spoken". I came across the following at phpworld.com
$i = 1; while ($i <= 10) { print $i++
Its a little script that counts from 1 to 10, but what does $i++ mean. What does the ++ do? Why ++ and not just one +
Thanks
-Jay
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Привет!
Cal Evans wrote: > ++ is an incrementor.
He may also consider the position of the inc/decrementor. Example (note that the first element of an array has index 0):
$a = Array(1,2,3,4,5); $i = 1;
executing
echo $a[++$i] will output 3 2
echo $a[$i++] will output 2 2
In both cases $i gets incremented, but the value used to access the array might be before or after the increment takes place, according to the incrementor (or decrementor, if you use --) position. A subtle, but often very handy nuance.
пока Альберто Киев
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
-_=}{=_-
LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......
attached mail follows:
on 13/07/02 7:35 AM, Andy (news.letters
gmx.de) wrote:
> I am wondering if there is a possiblity that some browsers like IE 5.1 do > not accespt cookies by default. I am working on a session management system > and some users report that they have not been able to login because the > cookie has been rejected. They are running IE 5.1 Mac (and maybe PC as well) > Are there any known problems?
Sure! For starters, ANYONE could turn off cookies at ANY TIME, perhaps by accident, perhaps out of fear, perhaps out of ignorance, perhaps because they're on a shared computer, etc etc.
But to answer your question, every version of IE I've ever loaded onto my Mac (currently 5.1) has had cookies on by default.
To really answer your question, you need to:
a) not rely on cookies -- pass the session ID around in the url
b) look at compiling PHP with enable_trans_sid, which does this for you
c) test for cookies, and explain to those without that your site requires them, explain how to access them/turn them on, and perhaps provide a small subset of content or alternatives for those who won't/can't use them.
Justin French
attached mail follows:
Aren't there already hundreds of these things out there?
I can't imagine why I'd use a clumsy, slow web interface to a forum that I have to keep checking/returning to when I can satisfy 99% of my problems with this mailing list.
It's as simple as sending, checking and replying to emails :)
Justin French
attached mail follows:
I think there is always a need for more resources. Some people prefer forums and the ability to actually go a bit off topic in some boards as opposed to strictly answering questions. It's a matter of preference I suppose.
Anything that further helps PHP spread I'm for it :)
Jeff
----- Original Message -----
From: "Justin French" <justin
indent.com.au>
To: <php-general
lists.php.net>
Sent: Saturday, July 13, 2002 10:05 PM
Subject: Re: [PHP] PHPDiscuss.com
> Aren't there already hundreds of these things out there? > > I can't imagine why I'd use a clumsy, slow web interface to a forum that I > have to keep checking/returning to when I can satisfy 99% of my problems > with this mailing list. > > It's as simple as sending, checking and replying to emails :) > > > Justin French > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > >
attached mail follows:
I'm interested in coding something in PHP which uses the TOC protocol to connect to AOL Instant Messenger (AIM). Has there been anything done like this in PHP? I'm also looking for more information on the TOC protocol. I have the protocol specs, but it doesn't say where the server is to connect to (same server as normal AIM, possibly?). Anyone who knows ANYTHING about this, please help.I don't know much ;-) Thanks for any and all replies.
attached mail follows:
>I use PHP to upload files to the web server via web browser. However, I can >not delete the files later cause the Redhat linux server running on safe >mode. Do I have to changed the owner of the file during the file uploading >time? > >Please let me know how to solve this problems.
The files are going to get deleted unless you do something in the upload script to save/store/copy them.
There is no problem. :-)
If, after you have created/moved them, you can't delete them, then you need to have done stuff like:
http://php.net/umask http://php.net/chmod
and have the correct settings on the source/destination directory permissions to get the files in the state that you want them in -- Whether that's deleting via a cron job, or manually or letting PHP do it.
Be warned that if PHP can delete them, so can anybody else on the shared server who wants to write a PHP script to delete them, unless you've configured PHP specially to run as a specific user, which is unlikely for most ISP setups.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Hi everybody, > >I am just trying to find out how some db errors happened during a user was >browsing my web app. > >This is out of the Apache log: > >GET /subapp_profiles/act_upload_image.php HTTP/1.1" 200 160 >POST /subapp_profiles/act_upload_image.php HTTP/1.1" 302 5 > >I do not have a clue where this GET request could come from. This has caused >a empty sql statement and therefore a db error. How can could this be >achieved? By clicking back in the browser window? I dont think so since the >same user was on another site before. > >Has anybody a idea on that?
They could have just hit "Reload" on that page.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>I have a small problem, >I can make the cgi version of php fine, it runs and installs perfectly, but >when I try to make the apache module (i.e. --with-apxs=/path/to/apxs) php >crashes apache. can anyone give me any insight on this?
What error messages are in Apache log? Do you get a core dump? Have you read the instructions on http://bugs.php.net/ ? Is the apxs you pointed out to PHP the current one matching your Apache installation? What was your configure line for Apache?
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>In article <20020711034110.14263.qmail
pb1.pair.com>,
>hesterloli
hotmail.com says...
>> For example in a book discussing PHP 3 it says: >> >> <? >> phpinfo(); >> ?> >> >> This works just fine. In a book that discusses PHP 4 it says: >> >> <? >> php_info() >> ?> >> >> This gives "Fatal error: Call to undefined function: php_info() in >> c:\inetpub\wwwroot\php\phpinfo.php on line 2." >> >> So it's not just backwards compatibility it is careless planning. This is not >> good. I will have to search hi and lo to determine if a failure is due to >> incorrect syntax because of version and not just careless typing on my part.
As far as I know, php_info() has never been a documented function. The manual has always re-directed requests for php_info to phpinfo. Try it yourself:
This is not a "new" behaviour nor a change in the language -- It's people using an undocumented alias that they shouldn't.
I do not understand why people insist on using undocumented features, much less putting them into text books.
Don't do that.
PHP actually has a pretty good history as far as backwards compatibility goes. Not perfect, perhaps, but pretty good.
I suggest you complain to the Author, Technical Editor, or Publisher of the book.
If that doesn't suit, feel free to write your web-pages in Fortran 77 :-)
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Hi y'all > >Has anyone found any problems with the xml parsing functions when the xml >document gets quite large. eg, a doc with about 5000 lines (about 200KB) > >The problem that's occurring is that some of the elements are being broken >in two parts > >If you require more details, please ask, as it's one of my colleagues that >is having this problem and I'll need her to pass on an example if needed.
I've heard that the DOM is a memory hog...
Are you using DOM or the other one, or ???
It's also quite possible that somewhere deep into the XML somebody line-wrapped an element, which is prefectly valid, but that isn't anticipated by your algorithm for reading/parsing the file...
That's the most likely source of the problem as described.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>I just signed up for this, as I would LOVE to be able to talk and interact >(in person) with some PHP Developers. As I'm still learning (as we all >are), it would be a great opportunity for me to be able to meet up and >discuss this wonderful language with my peers. Hopefully that'll come to pass! :o) > >I emplore all PHP Developers to sign up for MEETUP. You have nothing to >loose, and everything to gain!
Hey, it would be great if some of these grew into regular things or even turned into full-fledge PHP User Groups...
I think it might even be good for PHP user groups to just go ahead and have an "informal" meeting of this sort anyway. I'm in.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
> An agent goes to an interface that reveals a list of customers from a >database. These customers have provided referrals which now reside in a >database. The agent selects a referral which is processed by an intermediary >script which sets a flag in the database saying that "this agent" is, has,or >will be contacting this referral (to prevent duplicate contact). Then this >redirects to the referral's interface where the details about this referral >are revealed.
The things is...
If these are all done by header("Location: ...") then you are needlessly chewing up an awful lot of HTTP connections.
HTTP connections are, I think, a very limited and over-strained resource on a busy site.
Now, the price *might* be "worth it" for maintainability...
OTOH -- I suspect you could simply include 'processing.inc' in Interface B and have code that's just as maintainable without chewing up two/three/four times as many HTTP connections/processes.
You can't scale up when you waste HTTP connections.
As far as atomicity (not letting the user abort) goes, I suspect that is really better handled by transactions or, in a very crude way, register_shutdown_function to check that all the results "tie out".
Actually, modular design and clear interface/API/back-end design often obviate most of what beginners think they need transactions for, and a couple well-placed (and well-thought-out) flags/time-outs can get rid of the rest, until you actually get to the canonical "checkbook" (or any money) example... You can do those the hard way, but it's usually not as good a solution as a real transaction.
This is just my opinion, though, and I've often seen paradigms under fire for all the wrong reasons. "It won't scale up" is meaningless for a botique/niche site that won't every *NEED* to scale up. And yet you often see a Manager insisting on doing it "that way", while wasting a zillion people-hours on lame features and poor design layout and...
Ah well. Enough on that topic. I quit looking for a day job so I wouldn't have to worry about that kind of junk any more. :-)
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Hi All, > >I'm porting Java Code to PHP, my question is: What is the best approach >to emulate Java exceptions in PHP4? (I know ZE2 adds exceptions but I >can't wait). > >When a Java method "throws" an exception it is difficult to handle as a >"return" of an exception object since then I'd have to check in every >sinlge line that calls a method if the returned value is an exception >and then return and exception etc etc. (Chaning that up to the user >would be a nightmare). > >So I need some clever ideas ;-)
http://php.net/set_error_handler http://php.net/trigger_error http://php.net/error_log
Pretty much, take those and a little discipline with your programming staff, and you're done...
Maybe write some kind of error message system that creates a unique ID for each error message.
You can wrap it up in some Objects if that makes you happy.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Is it possible to write to exif-headers in pictures?
I don't think any PHP built-in function will do that.
Your options include:
1. Looking at the PHP source and extending it to do what you want. (and contributing that back).
2. Using some external program to do it: http://php.net/exec
3. Digging into the guts of whomever defined EXIF (MPEG folks?) and writing some PHP functions that read/write exif data without screwing up the images.
I suspect none of these are terribly difficult -- It's just that nobody else has wanted them badly enough yet to do the work...
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>The onus is on us to define the problem boundaries, to investigate possible > >solutions, and to present the results verbally, in writing and (possibly) to > >demonstrate in action. They like having projects that find solutions (or >improve a > >current sloution) real life problems.
You may want to look at http://sourceforge.net for some interesting ideas of projects that are under-staffed, or at http://linuxfund.org (ditto).
If there's any particular "extra-curricular" activity you are interested in, do some thinking on what kinds of software might be particularly useful for that.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>It's been over a year since I've had to come to you for help, but your >insights and experience are too hard to resist... :-) > >I don't have a problem with any of the gd functions and they all works >fine except that when I try to fill a circle or draw onto an imported >image from imagecreatefromjpeg: > >When I create my working jpg image from scratch: > >$im = ImageCreate($sizew, $sizeh); >$black = ImageColorAllocate($im, 0, 0, 0);
>I decided to cut out the 200+ lines of stripe drawing code and import >the fixed stripped image using imagecreatefromjpeg to draw and fill the >circle and arrow onto: > >... > >$im = imagecreatefromjpeg("stripes.jpg"); >$black = ImageColorAllocate($im, 0, 0, 0); > >ImageArc($im, $arrwell, $arrwell, 10, 10, 0, 360, $black); >ImageFillToBorder($im, $arrwell, $arrwell, $black, $black); > >... > >The problem is that now the Arc and arrow lines comes out in a reddish >color and the fill to border doesn't fill (regardless of the color used >in ImageArc). > >Anything I attempt to draw in any color comes out in red (it doesn't >matter what the stripe color behind it is, it's still the same red).
Try using the TrueColor functions.
I suspect that while it's possible for the JPEG to have a zillion colors, the actualy pallette in use for any particular image is limited.
Once you hit that limit, it gets ugly fast.
Before the True Color stuff came along, I wrote some really gnarly code that would essentially search out the least-used color, de-allocate that one -- which automatically re-mapped that color to the nearest, I think, and then I was able to allocate my new color flawlessly.
You really don't want to use this code, since scanning the whole image for all the colors and building up the frequency table is extremely inefficient, and almost-for-sure the True Color stuff will take care of you.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Hello - My problem is as follows: > <? > $data = mssql_result(mssql_query("SELECT Field FROM table WHERE >ID='1'"),0); > echo $data; > mysql_insert("INSERT INTO table2 VALUES('$data')"); > ?> > >The data in the MSSQL table is: фЦ
I dunno what those characters are or what's going on, but this code needs some serious error-checking...
Perhaps the web version and CGI version are using different php.ini files with different sql_magic_quotes settings...
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>List, > I'm creating a PHP/pgSQL web site...I need to execute queries with a >cursor and get their result set into my PHP script. How can I make a >pgSQL procedure with logic that also returns a result set? I've >searched and searched but cannot find the answer. Does anyone got it?
Any old select will return a result set that works with a query...
But if you need your PostgreSQL FUNCTION to return a result set, I *think* you need to use:
'set of XXX'
for the 'rettype' (return type)
and I *THINK* you can figure out what to use for XXX if you start digging to find the name/oid of the "complex type" that represents a row in your table here:
http://www.postgresql.org/idocs/index.php?catalog-pg-type.html
I've never done this, I just did a little digging right now, and this is where I would keep digging if I was working on this...
But it sounds to me like PostgreSQL already *has* a "complex type" to represent the tuples in your table, and you just need to find out what the name of that "complex type" might be. It may even turn out to be just the table name or something...
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>I have searched the archive for a message subject >something like "PHP Wish List" and was unsuccessful.
Depends who does the wishing :-)
The first time I compiled PHP, I tried to throw in almost everything that sounded remotely interesting.
That was incredibly time-consuming and frustrating.
I didn't even really understand what half that crap was, and then I had to go download and install and configure it and kick the tires on each one, and...
By the time I got so frustrated with it all, there was *ALREADY* a new version of PHP out. (It's not like I didn't have other stuff to do...)
So when I started over with that version I only compiled in the stuff I *KNEW* I would have time to mess with in the next six months.
HIGHLY RECOMMENDED ------------------ It don't matter what you choose, but choose only the stuff you're gonna need FOR SURE in the next six months. ------------------
If it turns out you were wrong, it's no big deal to download/compile/install one more toy, after you've been playing awhile.
Oh yeah -- Be sure to compile it as a CGI as well. You'll need that for cron jobs sooner than you think, and it's way easier when you still have the shell with the up arrow :-)
Actually, I always put my configure line in a chmod 700 shell script so I can just use it again.
I know PHP writes one out, but it's got all those quotes and stuff, and I like one I can just read.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Hi Everyone. > >Yup.. another dummy who can't suss out php. > >I'm running win2000 server and have installed php (by the book), also have >mysql running.
I just saw an article on Apache Today (http://www.apachetoday.com) about PHP on W2K installation.
It seemed to be pretty clearly-written and had a lot of 'splaining about WHY the guy did what he did, and what did and didn't work when he tried it...
YMMV.
It's the next one after the SWYNK article.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
Hi guys,
I have a function:
$substring = substr($REMOTE_ADDR,0,9); if ($substring != '192.168.0') { echo "Access Denied"; exit; }
If the user isn't from the local network, he's not allowed in.
This works fine, but is there a way to get apache to do it for me instead? Like, this for example...
<Location /server-info> SetHandler server-info Order deny,allow Deny from all Allow from 192.168.0.0 </Location>
Is it possible to have apache do this for a Vhost? like this...
<VirtualHost *> DocumentRoot /home/admin ServerName admin.blabla.net ErrorLog /home/logs/error.admin.net.log CustomLog /home/logs/access.admin.net.log common php_admin_flag safe_mode off <Location /home/admin> Order deny,allow Deny from all Allow from 192.168.0.0 </Location> </VirtualHost>
See what I'm trying to do? i've had a big fiddle, can't get it to work. Anyone got any ideas?
Cheers, Liam
P.S. I know it's got to do with Apache mostly, but it kinda has some relation to PHP... ;-)
attached mail follows:
Hi all,
I'm looking at some pretty complex regexp's at the moment for parsing HTML, stripping out some attributes, getting the values of others, etc etc.
The simple fact is that all these...
<A HREF=foo.php> <A HREF='foo.php'> <A HREF="foo.php"> <A HREF='foo.php' TARGET="something"> <A HREF=foo.php TARGET=something> <A HREF = "foo.php"> <A HREF = 'foo.php'>
... and many more are *valid* HTML mark-up. It starts to make the task look rather daunting -- especially if I want to get it right, rather than taking shortcuts.
I'm pretty sure I need to start looking at a state engine or HTML parser which can identify a tag, and seek out all the attributes of it, according to strictly valid HTML (preferably 4.01 strict), rather than working with regexp's.
As it turns out, I'm only looking to work with <A> at this stage, so I don't think it'll be a massive state engine, but I'd like to explore any other options or existing libraries of code before considering such a beast.
Any links / articles / code / whatever warmly welcome :)
Justin French
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]