OSEC

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 29 Mar 2005 05:41:12 -0000 Issue 3365

php-general-digest-helplists.php.net
Date: Mon Mar 28 2005 - 23:41:12 CST


php-general Digest 29 Mar 2005 05:41:12 -0000 Issue 3365

Topics (messages 211702 through 211756):

filesize() Returns a file size. What will return a directorysize()???
        211702 by: Lupita
        211703 by: M. Sokolewicz
        211705 by: Jay Blanchard

Re: PHP CODE TO DISPLAY ISP
        211704 by: Leif Gregory

Create MDB File
        211706 by: Shaun
        211713 by: Johannes Findeisen
        211715 by: Johannes Findeisen
        211723 by: Shaun
        211746 by: Rory Browne

phpDocumentor usage (specifically changelog capability?)
        211707 by: tg-php.gryffyndevelopment.com

Best Server OS
        211708 by: Phil Neeb
        211709 by: Dan Joseph
        211710 by: John Nichel
        211712 by: Johannes Findeisen
        211716 by: Danny Brow
        211717 by: Jay Blanchard
        211720 by: Mike
        211722 by: Danny Brow
        211725 by: Christian Heinrich
        211726 by: John Hinton
        211727 by: M. Sokolewicz
        211728 by: afan.afan.net
        211731 by: tg-php.gryffyndevelopment.com
        211732 by: Danny Brow
        211736 by: Jason Barnett
        211737 by: Chris W. Parker
        211745 by: Rory Browne

include literal
        211711 by: Jeremy Reynolds
        211714 by: Leif Gregory
        211719 by: Jason Barnett
        211729 by: Chris Shiflett

NEWBIE: Can't Get My Loop Going. . .
        211718 by: Jackson Linux
        211721 by: Jackson Linux
        211724 by: Christian Heinrich

rawurldecode
        211730 by: Aaron Todd
        211733 by: Marek Kilimajer
        211735 by: tg-php.gryffyndevelopment.com

Re: Maximum Execution Time Exceeded
        211734 by: Marek Kilimajer

text editor
        211738 by: Tim Traver
        211739 by: Chris W. Parker
        211740 by: Chris Shiflett
        211743 by: Tom Rogers

Re: access violation
        211741 by: Rob Agar

Re: Mod Rewrite help
        211742 by: Eli

Nusoap , wsdl and class methods
        211744 by: Dan Rossi

PHP4 trying to get gd graphics on debian with apache 1.3
        211747 by: theal
        211749 by: Rasmus Lerdorf

PHPXref is awesome!
        211748 by: Daevid Vincent
        211750 by: Dan Rossi
        211754 by: Dan Rossi
        211755 by: Daevid Vincent

Validating XML structure with PHP
        211751 by: Eli

Newbie Question - an If in an Array?
        211752 by: Jackson Linux

Session data disappearing?
        211753 by: Richard Lynch

Possible problem with EXPAT functions
        211756 by: Evert | Rooftop Solutions

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Hello;
I have been looking for a solution to get the disk size of a directory.
I would like to be able to get the size of a directory with sub directories
under it.
Will I need to loop through file sizes to get the total directory size?

attached mail follows:


Lupita wrote:
> Hello;
> I have been looking for a solution to get the disk size of a directory.
> I would like to be able to get the size of a directory with sub directories
> under it.
> Will I need to loop through file sizes to get the total directory size?
yes

attached mail follows:


[snip]
I have been looking for a solution to get the disk size of a directory.
I would like to be able to get the size of a directory with sub
directories
under it.
Will I need to loop through file sizes to get the total directory size?
[/snip]

If you are on a *nix system of some sort you could exec du -h

attached mail follows:


Hello jenny,

Monday, March 28, 2005, 9:36:07 AM, you wrote:
j> i am making a website in php and i will appreciate if anybody can
j> tell me the php code to :
j> - (1)display isp name,

One problem you're going to run into is that by using
$_SERVER['REMOTE_ADDR'] oftentimes, you'll end up with just the IP.

I wrote the below to give me the hostname, which generally gives you
the ISP information too, to fix a problem on a project I was doing.

If it won't resolve to a name (which does happen sometimes for
machines behind corporate firewalls), I just displayed "No Reverse DNS"

<?php
$pingResults = shell_exec('ping -a ' . $_SERVER['REMOTE_ADDR']);
$temp = explode("\r\n",$pingResults);
preg_match("/^Pinging\s([a-zA-Z0-9.]+)/", $temp[1], $hostname);
if ($temp[4] == "Request timed out.")
  $latency = "Unknown";
else
  $latency = $temp[4];
?>

Hostname: <?php if (!$_SERVER['REMOTE_ADDR'] == preg_match("/^[a-z.]+/i",$hostname[1])) echo "No Reverse DNS"; else echo $hostname[1]; ?>
Latency: <? echo $latency; ?>

Geez, it's amazing when you dig back through old code you realize how
much your coding skills sucked back then! <grin>

--
Leif (TB lists moderator and fellow end user).

Using The Bat! 3.0.9.9 Return (pre-beta) under Windows XP 5.1
Build 2600 Service Pack 2 on a Pentium 4 2GHz with 512MB

attached mail follows:


Hi,

Does anyone know if its possible to create an MDB file from a Mysql database
using a PHP script, I have only managed to find Access to Mysql conversion
programs so far...

Thanks for your help

attached mail follows:


Hello,

i had the same problem some years ago. At this time i have set up all tables
in Access and wrote a script which reads from MySQL and inserts into the MDB
file via the ODBC connector. This works but is much work when your database
is very big.

2 Years ago i had the same problem but it must go as fast as possible so i
decided to buy a converteer since i didn't find anything free. They are
working very good. I don't know where i have buyed them but i think there is
only one company which delivers this software.

Regards
Johannes

On Monday 28 March 2005 22:08, Shaun wrote:
> Hi,
>
> Does anyone know if its possible to create an MDB file from a Mysql
> database using a PHP script, I have only managed to find Access to Mysql
> conversion programs so far...
>
> Thanks for your help

--
# Johannes Findeisen

attached mail follows:


Sorry,

i forgot that link:

http://www.convert-in.com/sql2acc.htm

On Monday 28 March 2005 22:46, Johannes Findeisen wrote:
> Hello,
>
> i had the same problem some years ago. At this time i have set up all
> tables in Access and wrote a script which reads from MySQL and inserts into
> the MDB file via the ODBC connector. This works but is much work when your
> database is very big.
>
> 2 Years ago i had the same problem but it must go as fast as possible so i
> decided to buy a converteer since i didn't find anything free. They are
> working very good. I don't know where i have buyed them but i think there
> is only one company which delivers this software.
>
> Regards
> Johannes
>
> On Monday 28 March 2005 22:08, Shaun wrote:
> > Hi,
> >
> > Does anyone know if its possible to create an MDB file from a Mysql
> > database using a PHP script, I have only managed to find Access to Mysql
> > conversion programs so far...
> >
> > Thanks for your help
>
> --
> # Johannes Findeisen

--
# Johannes Findeisen

attached mail follows:


Thanks for your reply,

but this only works on Windows. I need a program that will create an MDB
file on the fly from a query on the MySQL database...

"Johannes Findeisen" <mailmanhanez.org> wrote in message
news:200503282255.26459.mailmanhanez.org...
> Sorry,
>
> i forgot that link:
>
> http://www.convert-in.com/sql2acc.htm
>
>
> On Monday 28 March 2005 22:46, Johannes Findeisen wrote:
>> Hello,
>>
>> i had the same problem some years ago. At this time i have set up all
>> tables in Access and wrote a script which reads from MySQL and inserts
>> into
>> the MDB file via the ODBC connector. This works but is much work when
>> your
>> database is very big.
>>
>> 2 Years ago i had the same problem but it must go as fast as possible so
>> i
>> decided to buy a converteer since i didn't find anything free. They are
>> working very good. I don't know where i have buyed them but i think there
>> is only one company which delivers this software.
>>
>> Regards
>> Johannes
>>
>> On Monday 28 March 2005 22:08, Shaun wrote:
>> > Hi,
>> >
>> > Does anyone know if its possible to create an MDB file from a Mysql
>> > database using a PHP script, I have only managed to find Access to
>> > Mysql
>> > conversion programs so far...
>> >
>> > Thanks for your help
>>
>> --
>> # Johannes Findeisen
>
> --
> # Johannes Findeisen

attached mail follows:


MDB suggests Access, so why not simply create a CSV, or some other
generic format file from your MySQL, and import it into access, using
COM/OLE, and save it as an MDB file.

On Mon, 28 Mar 2005 22:14:07 +0100, Shaun <shaunthornburghhotmail.com> wrote:
> Thanks for your reply,
>
> but this only works on Windows. I need a program that will create an MDB
> file on the fly from a query on the MySQL database...
>
>
> "Johannes Findeisen" <mailmanhanez.org> wrote in message
> news:200503282255.26459.mailmanhanez.org...
> > Sorry,
> >
> > i forgot that link:
> >
> > http://www.convert-in.com/sql2acc.htm
> >
> >
> > On Monday 28 March 2005 22:46, Johannes Findeisen wrote:
> >> Hello,
> >>
> >> i had the same problem some years ago. At this time i have set up all
> >> tables in Access and wrote a script which reads from MySQL and inserts
> >> into
> >> the MDB file via the ODBC connector. This works but is much work when
> >> your
> >> database is very big.
> >>
> >> 2 Years ago i had the same problem but it must go as fast as possible so
>
> >> i
> >> decided to buy a converteer since i didn't find anything free. They are
> >> working very good. I don't know where i have buyed them but i think
> there
> >> is only one company which delivers this software.
> >>
> >> Regards
> >> Johannes
> >>
> >> On Monday 28 March 2005 22:08, Shaun wrote:
> >> > Hi,
> >> >
> >> > Does anyone know if its possible to create an MDB file from a Mysql
> >> > database using a PHP script, I have only managed to find Access to
> >> > Mysql
> >> > conversion programs so far...
> >> >
> >> > Thanks for your help
> >>
> >> --
> >> # Johannes Findeisen
> >
> > --
> > # Johannes Findeisen
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


I didn't see a specific mailing list for phpDocumentor and wanted to get a general feel for people's experiances with it. I see that Zend Studio 4 supports it internally and I'd really like to get our group over to a standardized documentation scheme (and in the process, make use of what looks like a great auto-documentor).

Our documentation needs aren't extensive, so I think I got enough of a feel for phpDocumentor to do what we want to do, but one thing I don't see that would be really nice is the ability to do some kind of changelog type thing on at least pages if not individual functions and such.

Our current documentation is structured like this:

  /********************************************************
  ** File Name: FileName.php
  ** Description: Some Desc
  **
  ** Written By: Trevor Gryffyn
  **
  ** Modification Log:
  ** --------------------------------------------------
  ** Created: Trevor Gryffyn - 11/06/2004
  ** Modified: Trevor Gryffyn - 11/07/2004 - Added new function
  ********************************************************/

Under phpDocutmentor, that might become something like:

/**
* Some short description
*
* Some longer description that spans
* a couple of lines
*
* author Trevor Gryffyn <tg-phpgryffyndevelopment.com>
*
* category Miscellaneous Functions
*
* example SomeFunction($somevar)
*
* Modification Log:
* --------------------------------------------------
* Created: Trevor Gryffyn - 11/06/2004
* Modified: Trevor Gryffyn - 11/07/2004 - Added new function
*
*/

In this case, I'm not sure what phpDocumentor would do with the Modification Log or if there's a way to do something like this with phpDocumentor.

Any thoughts on how I can do this the 'right' way and possibly do some kind of changelog for pages and/or individual functions would be greatly appreciated.

Thanks in advance!

-TG

___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

attached mail follows:


I'm lookin for some opinions on this one ...

What do you think the best OS is for running a server with PHP and
MySQL? If you're going to say Linux, please, which Linux OS, there are
so many.

Gracias,
Phil

attached mail follows:


> What do you think the best OS is for running a server with PHP and
> MySQL? If you're going to say Linux, please, which Linux OS, there are
> so many.

Tough question to ask.... "best" is usually what the beholder likes
best. I will say this:

I prefer Red Hat or Fedora Linux.

--
-Dan Joseph

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."

attached mail follows:


Phil Neeb wrote:
> I'm lookin for some opinions on this one ...
>
> What do you think the best OS is for running a server with PHP and
> MySQL? If you're going to say Linux, please, which Linux OS, there are
> so many.

Let the war begin! ;)

FWIW : I prefer Linux, Red Hat flavor. Why? Only because I've used it
since RH 5.2.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


Hello Phil,

On Monday 28 March 2005 22:19, Phil Neeb wrote:
> I'm lookin for some opinions on this one ...
>
> What do you think the best OS is for running a server with PHP and
> MySQL? If you're going to say Linux, please, which Linux OS, there are
> so many.

i would prefer Gentoo Linux ( http://gentoo.org/ ) because it is very up to
date. There are install scripts (ebuilds) for PHP until 5.0.3 and the
installation makes no problems at all. If you are not much into Linux i would
prefer Fedora Core Linux ( http://fedora.redhat.com/ ), the problem is, that
you must compile much software by hand if you want very new versions and
Fedory is not that freaky then Gentoo. By the way Fedory is very easy to
install and it runs very very stable. If you need a hardcore develpment
plattform read the docs on the Gentoo website and you are on the right way.

Another OS which is very easy to install is FreeBSD. I know a hoster which
runs this system on nearly every Mashine. I don't know much about FreeBSD but
i have installed some day in the past and it wasn't much painfull.

Hope this helps...

Regards
--
# Johannes Findeisen

attached mail follows:


On Mon, 2005-03-28 at 15:19 -0500, Phil Neeb wrote:
> I'm lookin for some opinions on this one ...
>
> What do you think the best OS is for running a server with PHP and
> MySQL? If you're going to say Linux, please, which Linux OS, there are
> so many.

Slackware.

Dan.

attached mail follows:


[snip]
> I'm lookin for some opinions on this one ...
>
> What do you think the best OS is for running a server with PHP and
> MySQL? If you're going to say Linux, please, which Linux OS, there
are
> so many.
[/snip]

BSD, hands down.

attached mail follows:


I personally like OpenBSD - though many of the BSDs are similar at many
tasks and only have notable differences in a few areas (and it's those areas
you should look to find which works best for you).

I wonder who will get bored and stir up the ants nest and say Windows? ;)

> -----Original Message-----
> From: Phil Neeb [mailto:06prneebalma.edu]
> Sent: Monday, March 28, 2005 3:19 PM
> To: php-generallists.php.net
> Subject: [PHP] Best Server OS
>
> I'm lookin for some opinions on this one ...
>
> What do you think the best OS is for running a server with
> PHP and MySQL? If you're going to say Linux, please, which
> Linux OS, there are so many.
>
> Gracias,
> Phil
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


On Mon, 2005-03-28 at 15:58 -0500, Mike wrote:
> I personally like OpenBSD - though many of the BSDs are similar at many
> tasks and only have notable differences in a few areas (and it's those areas
> you should look to find which works best for you).
>
> I wonder who will get bored and stir up the ants nest and say Windows? ;)

Screw Windows, how about OS/2 :)

attached mail follows:


I prefer Debian 3.1 ..

Everyones taste is quite different, so I suggest to install some
test-installations of those different OS - and you have the choice.

Christian

Phil Neeb schrieb:

> I'm lookin for some opinions on this one ...
>
> What do you think the best OS is for running a server with PHP and
> MySQL? If you're going to say Linux, please, which Linux OS, there
> are so many.
>
> Gracias,
> Phil
>

attached mail follows:


Phil Neeb wrote:

> I'm lookin for some opinions on this one ...
>
> What do you think the best OS is for running a server with PHP and
> MySQL? If you're going to say Linux, please, which Linux OS, there
> are so many.
>
> Gracias,
> Phil
>
Being an old RedHatter.. Since 5.1.. I like RedHat flavors.

If you want MySQL 3 versions, CentOS EL 3.4 is a free Redhat Enterprise
Linux clone.

For MySQL 4.x... CentOS EL 4 is out. Also has selinux if you want to
take that on. All quality stuff that you can rely on in a mission
critical environment.

John Hinton

attached mail follows:


Danny Brow wrote:

> On Mon, 2005-03-28 at 15:58 -0500, Mike wrote:
>
>>I personally like OpenBSD - though many of the BSDs are similar at many
>>tasks and only have notable differences in a few areas (and it's those areas
>>you should look to find which works best for you).
>>
>>I wonder who will get bored and stir up the ants nest and say Windows? ;)
>
>
> Screw Windows, how about OS/2 :)
screw that too. Unix-based systems are the way to go here. From what
I've seen, those are the systems that are:
a) most used
b) run smoothest
c) are simplest to install / manage from a distance
d) are most up-to-date at all times

Personally I'd suggest using either Fedora (RH), or Debian. But that's
just my personal opinion ;)

attached mail follows:


Hi John,
since I have CentOS 3.4 and just wanted to update MySQL to version 4,
your comment surprised me :). Can you give some more info about that?

Thanks!

-afan

John Hinton wrote:

> Phil Neeb wrote:
>
>> I'm lookin for some opinions on this one ...
>>
>> What do you think the best OS is for running a server with PHP and
>> MySQL? If you're going to say Linux, please, which Linux OS, there
>> are so many.
>>
>> Gracias,
>> Phil
>>
> Being an old RedHatter.. Since 5.1.. I like RedHat flavors.
>
> If you want MySQL 3 versions, CentOS EL 3.4 is a free Redhat
> Enterprise Linux clone.
>
> For MySQL 4.x... CentOS EL 4 is out. Also has selinux if you want to
> take that on. All quality stuff that you can rely on in a mission
> critical environment.
>
> John Hinton
>

attached mail follows:


I will!

Ok, not completely.

I'm an avid windows user, but not a blind Gates disciple.. please don't accuse me of that.

I will never say that a Windows server is the 'best' platform for doing PHP script serving because I don't believe that's the case. It DOES work, but it's far from the 'best'. If it was one of the 'best' then Zend would never have created Zend WinEnabler to "...bring PHP on Windows up to par with PHP on Linux..." (http://www.zend.com/store/products/zend-win-enabler.php if you're curious) And for $500, I'd say that Linux of any flavor is definitely a winner over Windows just for that reason.

BUT... when it comes to picking an OS for your server, it's VERY important to ask yourself a few key things.

Probably the biggest in my book would be who is going to be maintaining this server and how easy would it be to find another person if you had to. PHP hosted on BeOS might be the absolute best in performance, but if you're hard pressed to find another BeOS admin if your chosen admin dies, quits, gets fired, etc.... then it's not worth going that route.

This choice affects pretty much everything else. Downtime, deployment time, security, etc. If you have a bunch of Windows admins and you insist that they install Linux and put up an Apahce/PHP setup, there's probably going to be some learning time, potential problems, misconfigurations, frustrations, random downtimes when problems come up and solutions have to be researched from scratch, etc.

If you already have an established Windows server based network, don't be afraid to set up PHP. It may not be the best, but you'll have fewer long-term problems I believe.

If you're starting from scratch all around.. either admin'ing it yourself or havn't hired the admin.. or your admin knows nothing about computers to start with and will be learning everything from step 1 anyway, then definitely go linux. Red hat is very popular, as well as many of the BSDs.

As much as I like Windows AND Linux, all practicality says go with whatever you have established and keep your network simple. Even if you have a Windows network and a Windows admin who's also proficient in Linux, think of what you'd have to do to replace that person someday. You'd end up having to find another Windows+Linux admin or get a Linux admin and possibly a separate Windows person.

Personally I like dealing with MS SQL Server better than MySQL by a LONG shot, but PHP best ASP/ASP.Net handsdown. So my last job where I worked with PHP under Windows Server 2003 interfacing (via ADODB) with SQL Server and Oracle was great. I didn't have any problems with PHP running under Windows. But it also wasn't a "mission critical" or high volume setup. Results may vary.

-TG

= = = Original message = = =

I personally like OpenBSD - though many of the BSDs are similar at many
tasks and only have notable differences in a few areas (and it's those areas
you should look to find which works best for you).

I wonder who will get bored and stir up the ants nest and say Windows? ;)

___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

attached mail follows:


On Mon, 2005-03-28 at 23:28 +0200, M. Sokolewicz wrote:
> Danny Brow wrote:
>
> > On Mon, 2005-03-28 at 15:58 -0500, Mike wrote:
> >
> >>I personally like OpenBSD - though many of the BSDs are similar at many
> >>tasks and only have notable differences in a few areas (and it's those areas
> >>you should look to find which works best for you).
> >>
> >>I wonder who will get bored and stir up the ants nest and say Windows? ;)
> >
> >
> > Screw Windows, how about OS/2 :)
> screw that too. Unix-based systems are the way to go here. From what
> I've seen, those are the systems that are:
> a) most used
> b) run smoothest
> c) are simplest to install / manage from a distance
> d) are most up-to-date at all times
>
> Personally I'd suggest using either Fedora (RH), or Debian. But that's
> just my personal opinion ;)
>

I was kidding about OS/2, it's a dead OS.

attached mail follows:


Danny Brow wrote:
...
>>>>I wonder who will get bored and stir up the ants nest and say Windows? ;)

Windoze is da shizzle my nizzle! Every1 knoz the kewlest SkRiPtErS use
Windoze!

...
>
> I was kidding about OS/2, it's a dead OS.

Nuh uh, just tell that to my overclocked 286 with 4MB of RAM!

.
.
.
.
.
.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

attached mail follows:


Phil Neeb <mailto:06prneebalma.edu>
    on Monday, March 28, 2005 12:19 PM said:

> I'm lookin for some opinions on this one ...
>
> What do you think the best OS is for running a server with PHP and
> MySQL? If you're going to say Linux, please, which Linux OS, there
> are so many.

I will throw my vote in for some flavor of Red Hat. Beit the older
version(s) 8 or 9, or the later Fedora Core 1, 2, or 3.

I just got FC3 installed yesterday (Gnome gave me lots of trouble so I
reinstalled for a 3rd time without the GUI, still has a basic X11 GUI
though). Runs much better now. Never tried Xfce though. That might have
worked fine.

Anyway...

Chris.

attached mail follows:


Phil

Depends on

(a) What you want.
(b) Who you are, and what your background is.

What you want:
If you want stability, then I'd go with Debian Stable. If you want
proactive security then I'd go with OpenBSD. I'm not suggesting that
OpenBSD is less stable than Debian, but I reckon that more people use
Debian. If you want a nice GUI, then go SuSE(with YaST). If you want
someone on the otherside of the phone, then consider RHEL or SLES. If
you're feeling suicidal, then go with Fedora(too 'cutting edge' to be
stable enough for a server) or Windows. All in all, personally I'd
settle for Debian(stability, clean-design/layout, and apt-get) or
OpenBSD(proactive security).

Who you are:
Having that said, all this depends on what your background is. There
is no point in installing a rock solid Operating System, if it's going
to fall by the wayside, because the admin doesn't know how to use it.
If you've used Fedora on the Desktop, then RHEL/CentOS may be a good
choice. Likewise if you've used a Debian based desktop distro, then
Debian may be a good choice. However if you've only ever used Windows,
then I'd definatly recommend going with something with a GUI, and
perhaps suggest SLES(although SuSE have a bad habit of installing
packages in /opt, which makes for an unclean system).

Personally I've used various Linux distros for the last four years.
I'm sufficiently comfortable with the differences in various distros,
to make a personal choice. I've recently got my hands wet with
OpenBSD, although I'm not yet sufficiently familiar with it to use it
for a server, and although most of my experience is with RPM based
distros, on the desktop, I'd definatly go Debian for a server.

On Mon, 28 Mar 2005 14:23:50 -0800, "Chris W. Parker"
<cparkerswatgear.com> wrote:
> Phil Neeb <mailto:06prneebalma.edu>
> on Monday, March 28, 2005 12:19 PM said:
>
> > I'm lookin for some opinions on this one ...
> >
> > What do you think the best OS is for running a server with PHP and
> > MySQL? If you're going to say Linux, please, which Linux OS, there
> > are so many.
>
> I will throw my vote in for some flavor of Red Hat. Beit the older
> version(s) 8 or 9, or the later Fedora Core 1, 2, or 3.
>
> I just got FC3 installed yesterday (Gnome gave me lots of trouble so I
> reinstalled for a 3rd time without the GUI, still has a basic X11 GUI
> though). Runs much better now. Never tried Xfce though. That might have
> worked fine.
>
> Anyway...
>
>
>
> Chris.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


What if I want to include some literal test into a PHP document that
I don't want it to interpret as it loads. In particular, I am
working with XML but for the example's sake I will say PHP. Example:
--
DocumentA.txt:
-----------
<?php echo 'something here'; ?>
-----------

Document B:
--------------
<?php
include('Document A');
?>
--------------
I would like the output of Document B to be:

<?php echo 'something here'; ?>

instead of something here.
--------------

attached mail follows:


Hello Jeremy,

Monday, March 28, 2005, 1:36:10 PM, you wrote:
J> --------------
J> I would like the output of Document B to be:

J> <?php echo 'something here'; ?>

J> instead of something here.
J> --------------

highlight_file('Document A');

--
Leif (TB lists moderator and fellow end user).

Using The Bat! 3.0.9.9 Return (pre-beta) under Windows XP 5.1
Build 2600 Service Pack 2 on a Pentium 4 2GHz with 512MB

attached mail follows:


Jeremy Reynolds wrote:
> What if I want to include some literal test into a PHP document that I
> don't want it to interpret as it loads. In particular, I am working
> with XML but for the example's sake I will say PHP. Example:

FYI, when you have -- on a line by itself most newsreaders think that
the text that follows is your signature. So, please don't put that into
a message unless your signature will follow.

Now to answer your question:

<?php
/** DocumentB.php */

$text = file_get_contents('DocumentA.php');
echo $text;

?>

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

attached mail follows:


Jeremy Reynolds wrote:
> What if I want to include some literal test into a PHP document that I
> don't want it to interpret as it loads.

You can use something like readfile() instead of include.

Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

attached mail follows:


Hello all,
I am a newbie trying to build a set of links to content in a db. I am
connecting with the db and seeing the proper number of rows. if I echo
out the values of $id and $sidebar I see that they take on the id# and
text of the last entry in the database. I'm trying to make the script
get each of the rows, until there are no more, and echo out the info I
need for each row. Please can someone tell me where I'm going wrong?
(the variables spelling out the db connection information are in a
prepend file, and work.)

Thanks in advance,
Jack

<?php
        
$conn = mysql_connect($dbserver, $dbusername, $dbpassword);
if (!$conn) {
   echo "Unable to connect to DB: " . mysql_error();
   exit;
}

if (!mysql_select_db("$dbname")) {
   echo "Unable to select mydbname: " . mysql_error();
   exit;
}

$sql = "
SELECT *
FROM sidebar
";

$sidebar = array();
$result = mysql_query($sql);

if (!empty($result)) {

      while ($sidebar = mysql_fetch_assoc($result)) {

         $id = $sidebar['sidebar_id'];
         $linktext = $sidebar['headline'];

/* Build sidebar.*/

     $left_sidebar[] = "<li class='menu-item'>- <a class='sidebar-link'
href='{$_SERVER['PHP_SELF']}?s={$id}'
title=\"{$linktext}\">{$linktext}</a></li>";

     }
}
else {}

mysql_free_result($result);

?>

<html><body>

  <ul><?php join("\n\n", $left_sidebar); ?></ul>

</body></html>

attached mail follows:


Sorry folks. I have been told by a more knowledgeable friend that the
problem was I forgot to ECHO out the join. It works now.

Thanks anyway!!

Jack
On 28 Mar 2005, at 15:57, Jackson Linux wrote:

> Hello all,
> I am a newbie trying to build a set of links to content in a db. I am
> connecting with the db and seeing the proper number of rows. if I echo
> out the values of $id and $sidebar I see that they take on the id# and
> text of the last entry in the database. I'm trying to make the script
> get each of the rows, until there are no more, and echo out the info I
> need for each row. Please can someone tell me where I'm going wrong?
> (the variables spelling out the db connection information are in a
> prepend file, and work.)
>
> Thanks in advance,
> Jack
>
> <?php
>
> $conn = mysql_connect($dbserver, $dbusername, $dbpassword);
> if (!$conn) {
> echo "Unable to connect to DB: " . mysql_error();
> exit;
> }
>
> if (!mysql_select_db("$dbname")) {
> echo "Unable to select mydbname: " . mysql_error();
> exit;
> }
>
> $sql = "
> SELECT *
> FROM sidebar
> ";
>
> $sidebar = array();
> $result = mysql_query($sql);
>
> if (!empty($result)) {
>
> while ($sidebar = mysql_fetch_assoc($result)) {
>
> $id = $sidebar['sidebar_id'];
> $linktext = $sidebar['headline'];
>
> /* Build sidebar.*/
>
>
> $left_sidebar[] = "<li class='menu-item'>- <a class='sidebar-link'
> href='{$_SERVER['PHP_SELF']}?s={$id}'
> title=\"{$linktext}\">{$linktext}</a></li>";
>
> }
> }
> else {}
>
> mysql_free_result($result);
>
> ?>
>
> <html><body>
>
> <ul><?php join("\n\n", $left_sidebar); ?></ul>
>
> </body></html>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Hello Jack,

you simply forgot an echo.
<?php echo join(....); ?>

Also, have a look at print_r, which is very very useful for debugging.

Greetings from Germany,
Christian

Jackson Linux schrieb:

> Hello all,
> I am a newbie trying to build a set of links to content in a db. I am
> connecting with the db and seeing the proper number of rows. if I echo
> out the values of $id and $sidebar I see that they take on the id# and
> text of the last entry in the database. I'm trying to make the script
> get each of the rows, until there are no more, and echo out the info I
> need for each row. Please can someone tell me where I'm going wrong?
> (the variables spelling out the db connection information are in a
> prepend file, and work.)
>
> Thanks in advance,
> Jack
>
> <?php
>
> $conn = mysql_connect($dbserver, $dbusername, $dbpassword);
> if (!$conn) {
> echo "Unable to connect to DB: " . mysql_error();
> exit;
> }
>
> if (!mysql_select_db("$dbname")) {
> echo "Unable to select mydbname: " . mysql_error();
> exit;
> }
>
> $sql = "
> SELECT *
> FROM sidebar
> ";
>
> $sidebar = array();
> $result = mysql_query($sql);
>
> if (!empty($result)) {
>
> while ($sidebar = mysql_fetch_assoc($result)) {
>
> $id = $sidebar['sidebar_id'];
> $linktext = $sidebar['headline'];
>
> /* Build sidebar.*/
>
>
> $left_sidebar[] = "<li class='menu-item'>- <a class='sidebar-link'
> href='{$_SERVER['PHP_SELF']}?s={$id}'
> title=\"{$linktext}\">{$linktext}</a></li>";
>
> }
> }
> else {}
>
> mysql_free_result($result);
>
> ?>
>
> <html><body>
>
> <ul><?php join("\n\n", $left_sidebar); ?></ul>
>
> </body></html>
>

attached mail follows:


I am trying to use the rawurldecode() function to decode a variable that is
begin passed from a different page through the url. The PHP manual doesnt
say much for this function, but it does have quite a bit on the urldecode()
function which says using urldecode on a $_GET variable wont produce the
desired results. Is there another way to decode a url variable? Or maybe a
better way to get a variable from one page to another so I can use it. The
variable may contain all types of characters, but mainly a space(%20) is the
biggest problem.

If anyone has some kind of workaround for this please let me know.

Thanks

attached mail follows:


Aaron Todd wrote:
> I am trying to use the rawurldecode() function to decode a variable that is
> begin passed from a different page through the url. The PHP manual doesnt
> say much for this function, but it does have quite a bit on the urldecode()
> function which says using urldecode on a $_GET variable wont produce the
> desired results. Is there another way to decode a url variable? Or maybe a
> better way to get a variable from one page to another so I can use it. The
> variable may contain all types of characters, but mainly a space(%20) is the
> biggest problem.
>
> If anyone has some kind of workaround for this please let me know.

You should not need it, %20 is decoded to space and as such is already
in $_GET variable. If it's still encoded then you encoded it where it
was not necessary.

attached mail follows:


Could you use parse_url() and just take the [query] section of it, then maybe do an explode on "&" to get the different parts of it?

-TG

= = = Original message = = =

I am trying to use the rawurldecode() function to decode a variable that is
begin passed from a different page through the url. The PHP manual doesnt
say much for this function, but it does have quite a bit on the urldecode()
function which says using urldecode on a $_GET variable wont produce the
desired results. Is there another way to decode a url variable? Or maybe a
better way to get a variable from one page to another so I can use it. The
variable may contain all types of characters, but mainly a space(%20) is the
biggest problem.

If anyone has some kind of workaround for this please let me know.

Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

attached mail follows:


mikeytfaol.com wrote:
> I would like to know if you could help me.. I don't understand what is wrong! I made a file that is supposed to list 2 categories with the boards that go to them under them. I get a Fatal Error: Maxmimum execution time of 30 seconds exceeded. Here is the file that gives me the error: http://subzer0.net/php/index.php
>
> Here is the source code for the file:
>
> http://subzer0.net/php/index.phps

You did not use any curly braces, but from a quick look it seems you
should. For example this code will assign to $board variable multiple
times but the variable will never be used:

while($get_cat=mysql_fetch_row($category))
$board=mysql_query("SELECT * FROM boards WHERE hidden='No' AND
catid='.$get_cat[0].' ORDER BY boardid ASC");

Your current code with braces in is:

$category=mysql_query("SELECT * FROM categories ORDER BY catid ASC");
while($get_cat=mysql_fetch_row($category)) {
     $board=mysql_query("SELECT * FROM boards WHERE hidden='No' AND
catid='.$get_cat[0].' ORDER BY boardid ASC");
}

while($board=mysql_query("SELECT * FROM boards WHERE hidden='No' AND
catid='.$get_cat[0].' ORDER BY boardid ASC")) {
     $get_board=mysql_fetch_row($board);
}

while($get_board=mysql_fetch_row($board) AND
$get_cat=mysql_fetch_row($category)) {
   echo '</table><table border="0" align="center" width="100%"><tr
class="cell2" align="center"><td><b><i>'. $get_cat[1] .
'</i></b></td></tr></table><table border="0" align="center"
width="100%"><tr ',shading(),'><td><a
href="/php/topics.php?board='.$get_board[0].'">'.$get_board[1].'</a><br
/><small>'.$get_board[2].'</small></td><td>'.$get_board[3].'</td><td>'.$get_board[4].'</td><td>'.$get_board[5].'</td></tr>';
}

attached mail follows:


Hi all,

ok, I have created my own php text editor that allows a user to edit
files from local(server) disk.

I use a basic html textarea to show the contents of the file, and let
them edit it, and then save it to disk.

I've just realized that when editing an html file, that everything is
ok, unless the file has a textarea tag in it. Then the editing textarea
tag gets closed, and you end up not getting all of the data to save.

Any way to work around this and still use simple forms ?

Thanks,

Tim.

attached mail follows:


Tim Traver <mailto:tt-listsimplenet.com>
    on Monday, March 28, 2005 3:18 PM said:

> I've just realized that when editing an html file, that everything is
> ok, unless the file has a textarea tag in it. Then the editing
> textarea tag gets closed, and you end up not getting all of the data
> to save.
>
> Any way to work around this and still use simple forms ?

Maybe www.php.net/htmlentities?

Chris.

attached mail follows:


Tim Traver wrote:
> I use a basic html textarea to show the contents of the file, and let
> them edit it, and then save it to disk.
>
> I've just realized that when editing an html file, that everything is
> ok, unless the file has a textarea tag in it. Then the editing textarea
> tag gets closed, and you end up not getting all of the data to save
>
> Any way to work around this and still use simple forms?

You should really always escape your output, and this means
htmlentities() when you're sending data to the client.

(Escaping doesn't actually modify data once it has been received.
Rather, it preserves it.)

Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

attached mail follows:


Hi,

Tuesday, March 29, 2005, 9:17:42 AM, you wrote:
TT> Hi all,

TT> ok, I have created my own php text editor that allows a user to edit
TT> files from local(server) disk.

TT> I use a basic html textarea to show the contents of the file, and let
TT> them edit it, and then save it to disk.

TT> I've just realized that when editing an html file, that everything is
TT> ok, unless the file has a textarea tag in it. Then the editing textarea
TT> tag gets closed, and you end up not getting all of the data to save.

TT> Any way to work around this and still use simple forms ?

TT> Thanks,

TT> Tim.

What I have done in the past is convert <textarea to <text_area and
then do the reverse when the form is submitted

--
regards,
Tom

attached mail follows:


hi Leif,

Just thought you'd like to know - I have submitted a bug report, bug
#32422.

btw, assuming it's the same bug, I can get it to happen during GET
requests, just less frequently.

Rob

> -----Original Message-----
> From: Leif Gregory [mailto:Leifgdoh.state.nm.us]
> Sent: Thursday, 24 March 2005 12:19 AM
> To: Rob Agar
> Subject: Re: [PHP] access violation
>
>
> Hello Rob,
>
> Tuesday, March 22, 2005, 4:14:55 PM, you wrote:
> R> That's interesting - it also started happening for me after
> R> installing PHP 5.0.3. But I have reverted to 4.3.10 for now, and I
> R> can't see how installing 5.0.3 into an entirely separate directory
> R> can break my old php install. Hmm..
>
> R> Incidentally, are you using Pear at all?
>
> No, I'm not doing anything with Pear (just haven't gotten
> around to it).
>
> I did the same thing you did, installed into a separate
> directory and fixed all the references in the webserver, and
> have deleted any PHP 4.3 files from the Windows/System folder.
>
> Luckily it doesn't appear to be a big security problem as it
> only displays the access violation in the browser window (no
> paths or anything). A reboot fixes it until I do something
> like refreshing POST data a few times again. Until I get the
> problem resolved, I don't refresh POST data anymore on that server.
>
> The frustrating thing is that the "crash" doesn't show up in
> any logs. Even the Windows system logs.
>
> I also didn't do any major changes from the default php.ini
> except to enable some extensions I needed, set up the SMTP
> stuff, and that's really about it.
>
> I am running 5.0.3 on other servers (various web servers and
> MySQL versions, but all Windows), and am not experiencing
> this problem. The only difference with those servers is that
> 5.0.3 was installed fresh (no previous PHP). I'm wondering if
> I missed one of the extension files somewhere from 4.3.
>
>
>
>
> --
> Leif (TB lists moderator and fellow end user).
>
> Using The Bat! 3.0.9.9 Return (pre-beta) under Windows XP 5.1
> Build 2600 Service Pack 2 on a Pentium 4 2GHz with 512MB
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Brian Dunning wrote:
>>>>> How would I mod_rewrite a request for /baseball.htm into
>>>>> /query.php?q=baseball?
>
>
> This should be doing it as far as I can tell, but for some reason it's
> not...
>
> RewriteEngine on
> RewriteRule /^(.+).htm$ /query.php?q=$1

RewriteEngine on
RewriteRule ^/(.+)\.htm$ /query.php?q=$1

But note this isn't good.. since say if you got a regular page
/index.htm then it will be rewritten into /query.php?q=index so what you
better do is having a prefix of a 'virtual' directory, like was
suggested before 'sport'... and make it like this:

RewriteEngine on
RewriteRule ^/sport/(.+)\.htm$ /query.php?q=$1

-Eli.

attached mail follows:


Hi there, I am trying to work out how to use the Nusoap package, its
pretty cool but a tedious one to configure. What I am attempting to
achieve is executing a class method either via standard soap or wsdl
and return it as an array or xml. I have attempted to setup a service
as classname.method but it keeps returning service is not setup. Any
ideas ? There was no documentation with the zip file.

attached mail follows:


----- Original Message -----
From: "theal" <thealpace2020.com>
To: <php-generallists.php.net>
Sent: Saturday, March 26, 2005 3:41 PM
Subject: [PHP] gd graphics on debian with apache 1.3

I am trying to get Dashboard graphics working on a Debian woody system. I
have the following php packages installed:

ii php4 4.1.2-7.0.1 A server-side, HTML-embedded scripting
langu
ii php4-cgi 4.1.2-7.0.1 A server-side, HTML-embedded scripting
langu
ii php4-gd2 4.1.2-2 GD module (with GD2) for php4
ii php4-pgsql 4.1.2-4 PostgreSQL module for php4

the error I am getting is
Fatal error: Call to undefined function: gd_info() in
/var/www/html/dashboard/test_setup.php on line 29

php.ini has extensions set up as:
extension_dir=/usr/lib/php4/20010901/
extension=pgsql.so
extension=gd.so

ls -l /usr/lib/php4/20010901/
lrwxrwxrwx 1 root root 23 Mar 26 14:23 gd.so ->
/usr/lib/libgd.so.2.0.1
-rw-r--r-- 1 root root 95036 Mar 17 2002 gd.so.orig
lrwxrwxrwx 1 root root 23 Mar 25 20:27 libgd.so.2.0.1 ->
/usr/lib/libgd.so.2.0.1
-rw-r--r-- 1 root root 41412 Mar 31 2002 pgsql.so

the line in the script that is failing:
<?php
        echo "Here is the dump [";
        var_dump(gd_info());
        echo "] end of dump.";
?>

attached mail follows:


theal wrote:
> php.ini has extensions set up as:
> extension_dir=/usr/lib/php4/20010901/
> extension=pgsql.so
> extension=gd.so
>
> ls -l /usr/lib/php4/20010901/
> lrwxrwxrwx 1 root root 23 Mar 26 14:23 gd.so ->
> /usr/lib/libgd.so.2.0.1
> -rw-r--r-- 1 root root 95036 Mar 17 2002 gd.so.orig
> lrwxrwxrwx 1 root root 23 Mar 25 20:27 libgd.so.2.0.1 ->
> /usr/lib/libgd.so.2.0.1
> -rw-r--r-- 1 root root 41412 Mar 31 2002 pgsql.so

Wow, what in the world is that? /usr/lib/php4/20010901/gd.so should
never be a symlink to the system gd library. They are completely
different beasts. gd.so is the PHP extension which links against the gd
library and provides the access functions.

Is that symlink something you did or have the Debian folks completely
lost their minds now?

-Rasmus

attached mail follows:


I just have to call out mad props to this project that one of our new hires
pointed me at...

http://phpxref.sourceforge.net/

This project is sooo sweet.

For starters, it doesn't shit the bed when documenting large projects like
'PHPDoc' does.

It cross references database tables.

The view-source feature is amazing. Dynamically highlighting variables,
telling you how many times they're used and where! It is easy as pie to
setup and the output is very clean.

We have it run at the end of our hourly builds from CVS, and "it just
works".

Thank you Gareth (and the rest of the phpxref team)

:-)

BTW, October 26th was my birthday! ;-)

attached mail follows:


There is no end user docs for this, its a bit bollox. I do like the
idea of table tags though. Sorry have no time to start reading perl
source code.

On 29/03/2005, at 12:31 PM, Daevid Vincent wrote:

> I just have to call out mad props to this project that one of our new
> hires
> pointed me at...
>
> http://phpxref.sourceforge.net/
>
> This project is sooo sweet.
>
> For starters, it doesn't shit the bed when documenting large projects
> like
> 'PHPDoc' does.
>
> It cross references database tables.
>
> The view-source feature is amazing. Dynamically highlighting variables,
> telling you how many times they're used and where! It is easy as pie to
> setup and the output is very clean.
>
> We have it run at the end of our hourly builds from CVS, and "it just
> works".
>
> Thank you Gareth (and the rest of the phpxref team)
>
> :-)
>
> BTW, October 26th was my birthday! ;-)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Shit this looks intense, i'll definately be having a go at this. Does
it support phpdoc tags ?

On 29/03/2005, at 12:31 PM, Daevid Vincent wrote:

> I just have to call out mad props to this project that one of our new
> hires
> pointed me at...
>
> http://phpxref.sourceforge.net/
>
> This project is sooo sweet.
>
> For starters, it doesn't shit the bed when documenting large projects
> like
> 'PHPDoc' does.
>
> It cross references database tables.
>
> The view-source feature is amazing. Dynamically highlighting variables,
> telling you how many times they're used and where! It is easy as pie to
> setup and the output is very clean.
>
> We have it run at the end of our hourly builds from CVS, and "it just
> works".
>
> Thank you Gareth (and the rest of the phpxref team)
>
> :-)
>
> BTW, October 26th was my birthday! ;-)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Yes! That's the point. We use PHPDoc tags in our project, but it's become so
large that PHPDocumentor itself can't make the documentation anymore. Go
figure.

> -----Original Message-----
> Shit this looks intense, i'll definately be having a go at this.
> Does it support phpdoc tags ?

attached mail follows:


Hi,

I want to validate an XML structure using PHP.
I thought of using PHP's DOM and XSD or DTD for validation. This does
the job ok, except on invalid XML structure I get the same error code.
What I want is to point exactly why the XML structure is invalid. I know
there's also an error message that gives a bit more precision on the
cause, but it's not something I can show the user.

Is there another way to validate XML structure (that can give a precise
error cause, like missing element, invalid element value, etc)?

-thanks, Eli

attached mail follows:


I'm so confused. I have an array :

     $display[] = "
        <div class='job-date'>{$cv['dates']}</div>
             <div class='job-title'>{$cv['job_title']}</div>
             <div class='company'>{$cv['company']}</div>
        <div class='job'>{$cv['job']}</div>";

In SOME of the rows of this table, there is a field called sidebar. I'd
like to have this array include a reference to this field if it exists.

I was thinking something like:
if (!empty($cv['sidebar'])){
        $sidebar_ref = "
       <div class='sidebar_ref_box'><a
href='../sidebars/index.htm?s={$cv['sidebar']}' title='Sidebar'>Learn
More</a></div>"
        };

Can anyone offer some help?

Thanks. The whole script is below:

<?php

/* invalid or missing GET? */
if (!isset($_GET['r']) || empty($_GET['r']) || !($r =
intval($_GET['r']))) {
     // show a plain vanilla index
     include('/path/to/docs/cv.include.php');
     exit;
}

/* With a valid $r, make some variables to help build the SQL query
  * Note three conditions join the tables yes we are aware of that */
$fields =
'cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,cv.si
debar,jobcat.category';
$where = "WHERE cvjobcats.cv_id=cv.cv_id
              AND cvjobcats.jobcat_id = '$r'
               AND jobcat.jobcat_id=cvjobcats.jobcat_id";
$restables = "cv, cvjobcats, jobcat";
$sort = "ORDER BY cv.sort";

/* Finally the actual SQL query, using the variables just set
  * do we have a valid mysql result resource?
  */
if (!($result = mysql_query("SELECT $fields FROM $restables $where
$sort"))) {
   echo "Could not successfully run query ($sql) from DB: " .
mysql_error();
   exit;
}

/* do we have any records? if not show the list/menu */
if (mysql_num_rows($result) == 0) {
   include_once('/path/to/docs/cv.include.php');
   exit;
}

$display = array(); // this is merely an array initialization

unset($cat);
while ($cv = mysql_fetch_assoc($result)) {
     /* set the category name for display in the output */
     if (!isset($cat)) {
             $cat = $cv['category'];

     }

/*$sidebar_ref = array();
while ($cv = mysql_fetch_assoc($result)) {
       if (!empty($cv['sidebar'])){
        $sidebar_ref [] = "
       <div class='sidebar_ref_box'><a
href='../sidebars/index.htm?s={$cv['sidebar']}' title='Sidebar'>Learn
More</a></div>"
        };
}*/

     /* make an array of jobs which includes the HTML to be displayed
      * in the HTML page when we make one...
      */
     $display[] = "
        <div class='job-date'>{$cv['dates']}</div>
             <div class='job-title'>{$cv['job_title']}</div>
             <div class='company'>{$cv['company']}</div>
        <div class='job'>{$cv['job']}</div>";
}

/* be nice - tell mysql to free the resultset */
mysql_free_result($result);

/*
  * And now, wrap up the PHP and make the page...
  */

echo "<?xml version='1.0' ?>\n";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
                <title>Resume </title>
                <link rel='stylesheet' href='http://domain.com/docs/style.css'
type='text/css' />
        </head>
<body>

<!-- CALL EVERYTHING BELOW A PAGE -->
<div id='page-display'>

<!--START HEADER --><?php include_once
"/path/to/docs/header.include.php" ?><!-- END HEADER -->

<!-- BEGIN LEFT SIDE -->
<div id='left-sidebar'>
        <?php include_once "/path/to/docs/left-sidebar.cv.include.php"; ?>
</div>
<!-- END LEFT SIDE -->

<!--START MAIN CONTENT AREA-->
<div id='content'>

        <h1>R&eacute;sum&eacute;</h1>

        <?php include_once "/path/to/docs/cv.$r.include.php"; ?>

        <div class='job-category'><?php echo $cat?></div>

        <?php
        if (sizeof($display)) {
                echo "
        <div id='table-of-contents'>
        ";
                echo join("\n\t\t", $display);

                echo "
        </div>
        ";

        }
        
        ?>

</div>
<!--END MAIN CONTENT AREA-->

<!--BEGIN FOOTER-->
<div id='footer'><?php include_once "/path/to/docs/footer.include.php"
?></div>
<!--END FOOTER-->

</div>
<!--END PAGE-->

</body>
</html>

attached mail follows:


Can anybody 'splain under what conditions $_SESSION values would turn into
&NULL for no reason I can figure out?

It happens consistently on this one FORM submission, but works fine on
others.

PHP 5.0.3
FreeBSD 5.3-RELEASE

Tried with Cookies and with trans_sid

No difference.

Tried altering the session.name and no difference.

Naturally, I can't pare it down to a smaller example yet. :-(

I'm calling session_start(), for sure.

I'm dumping out session_id() and it has the same 32-character value as
before.

But one page has $_SESSION data, and the next, "poof" all the
&string(#)="#####" values turn into &NULL

Actually only two out of three values was disappearing for awhile.

This worked fine under Windows XP on my laptop, so I'm reasonably certain
it's not my code at fault, at least not totally. Working versions:
PHP 4.3.9
Windows XP Home Edition

I've searched bugs.php.net, and found nothing that matched up in any
obvious way to what I'm experiencing, though maybe I just missed it.

Hmmmm. Maybe I can blame the CSS somehow. That always seems to screw me
up. :-v

Anybody willing to poke at it can email me off list for a
username/password and I'll set it up for you to see it in action.

Source code (kinda long, sorry):
http://acousticdemo.com/edit_schedule.phps
http://acousticdemo.com/globals.phps
http://acousticdemo.com/client_id.phps
http://acousticdemo.com/global.phps (CSS)

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


Hi People,

I'm working on some complex PHP4 OOP Scripts and at a really unusual
point I'm getting the following error in my apache errorlog:

*** glibc detected *** double free or corruption (!prev): 0x0828c510 ***
[Tue Mar 29 07:09:27 2005] [notice] child pid 9110 exit signal Aborted (6)

This doesn't seem as a error I should be able to cause.

I'm using:

PHP 4.3.10
Apache 1.3.33
Slackware 10 packages
The latest Zend Optimizer

This has only happened so far after an EXPAT xml parse. The reproduce
code is below.

If someone can confirm this error I can report it as a bug.. I just
wanted to make sure it is one :)

regards,
Evert

<?

  class sParser {

        function onStartElement($parser,$name,$attribs) {

                return false;

        }

        function onEndElement($parser,$name) {

                return false;

        }

        function onCDATA($parser,$data) {

                return false;

        }

        function onProcessInstruction($parser,$target,$data) {

                return false;

        }

        function onXMLError($line,$errorcode,$errorstring) {

                return false;

        }

        function xmlparse($data) {

                $this->parser = xml_parser_create('UTF-8');
                
xml_parser_set_option($this->parser,XML_OPTION_CASE_FOLDING,false);
                xml_set_element_handler($this->parser,array($this,
'onStartElement'),array($this,'onEndElement'));
                
xml_set_character_data_handler($this->parser,array($this,'onCDATA'));
                
xml_set_processing_instruction_handler($this->parser,array($this,'onProcessInstruction'));
                if (!xml_parse($this->parser,$data)) {
                        
$this->onXMLError(xml_get_current_line_number($this->parser),
xml_get_error_code($this->parser), xml_error_string(xml_get_error_code($
this->parser)));
                        return false;
                } else return $this->parsedData;

        }

        function execute($data) {

                return $this->xmlparse($data);

        }

  }

  $disp = new sParser();

  $disp->execute(file_get_contents('test'));

?>