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-help_at_lists.php.net
Date: Sat Jan 11 2003 - 18:36:55 CST

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    php-general Digest 12 Jan 2003 00:36:55 -0000 Issue 1817

    Topics (messages 131240 through 131286):

    Change Date
            131240 by: Naqashzade, Sadeq
            131242 by: Thomas Seifert
            131243 by: Naqashzade, Sadeq
            131249 by: Thomas Seifert
            131272 by: Jason Wong

    Re: Using $vars from include()d functions in the main programm and other functions
            131241 by: Thomas Seifert

    count characters without space
            131244 by: harald.mohring.gmx.de
            131246 by: Gerald Timothy Quimpo
            131256 by: Jeffrey B. Ferland

    Make thumbnail online
            131245 by: Naqashzade, Sadeq
            131250 by: Thomas Seifert
            131283 by: Hugh Danaher

    Date Comparison
            131247 by: Dhaval Desai
            131248 by: Matt
            131273 by: Jason Wong

    COM object
            131251 by: jlord2002.libero.it
            131252 by: Marco Tabini

    How I can get one line from a file?
            131253 by: Joskey Liaus
            131254 by: Marco Tabini
            131258 by: Gerald Timothy Quimpo

    Re: Suggestions on FAQ application?
            131255 by: Jeffrey B. Ferland
            131259 by: John Nichel
            131262 by: Jeff Lewis
            131263 by: Jeff Lewis
            131285 by: The Head Sage

    Problem with Search Engine Friendly URLs under PHP & Windows XP
            131257 by: Jonathan Chum
            131261 by: Gerard Samuel
            131267 by: Jonathan Chum

    Re: Template tutorials?
            131260 by: David Eisenhart

    XML Cleanup Regex
            131264 by: Gerard Samuel

    Re: Is this possible with php?
            131265 by: Rasmus Lerdorf
            131268 by: Chris Hewitt
            131269 by: Chris Hewitt

    Sorting arrays
            131266 by: Chris Kay

    Free web-hosting
            131270 by: Anton Gladky

    php5 cvs
            131271 by: electroteque
            131286 by: Danny Shepherd

    Re: Session vars vs. POST/GET vars?
            131274 by: Jason Wong
            131276 by: Jason Wong

    global to superglobal
            131275 by: pippo.bellnet.ca
            131278 by: Jason Wong
            131282 by: pippo.bellnet.ca

    Re: version confusion - please help
            131277 by: Jason Wong

    Re: Loading Information into an array.
            131279 by: Jason Wong

    rintones using php
            131280 by: Arvindv
            131281 by: Arvindv

    fopen with nasty pathnames
            131284 by: Mat Harris

    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:


    Hi,
    How can I find time stamp for example 125 next days. or 03:30 hours next?

    Regards,
    S. Naqashzade
    PS: Sorry for my bad english :-(

    attached mail follows:


    http://de.php.net/manual/en/function.mktime.php

    The most important part is
    "mktime() is useful for doing date arithmetic and validation, as it will automatically calculate the correct value for out-of-range input."

    Thomas

    On Sun, 11 Jan 2004 16:12:01 +0330 ssyazd.info (Sadeq Naqashzade) wrote:

    > Hi,
    > How can I find time stamp for example 125 next days. or 03:30 hours next?
    >
    > Regards,
    > S. Naqashzade
    > PS: Sorry for my bad english :-(
    >
    >

    attached mail follows:


    So Thanks, but can you get me some example code?

    Regards,
    Sadeq

    "Thomas Seifert" <thomas.seifertmyphorum.de> wrote in message
    news:20030111134834.0d70d923.thomas.seifertmyphorum.de...
    > http://de.php.net/manual/en/function.mktime.php
    >
    > The most important part is
    > "mktime() is useful for doing date arithmetic and validation, as it will
    automatically calculate the correct value for out-of-range input."
    >
    >
    >
    > Thomas
    >
    > On Sun, 11 Jan 2004 16:12:01 +0330 ssyazd.info (Sadeq Naqashzade) wrote:
    >
    > > Hi,
    > > How can I find time stamp for example 125 next days. or 03:30 hours
    next?
    > >
    > > Regards,
    > > S. Naqashzade
    > > PS: Sorry for my bad english :-(
    > >
    > >

    attached mail follows:


    i.e.
    // getting the current time in an array
    $timeval=localtime();

    // we want the time 3 hours in the future
    $timeval[2] = $timeval[2]+3;

    // calc the new timestamp
    $timestamp=mktime ($timeval[2], $timeval[1], $timeval[0], $timeval[4], $timeval[3], i$timeval[5]);

    ########################

    An even better solution, you are talking about a unix-timestamp, right?

    just add or subtract the the seconds from the current timestamp,
    i.e.

    // get the current timestamp
    $timestamp=time();

    // 1 minute = 60 seconds, 1 hour = 60 minutes, therefore 1 hour = 60*60 = 3600 seconds
    // so we add 3600*3 to have the time in 3 hours
    $timestamp = $timestamp + (3600*3);

    // you can convert this time back to a readable format using strftime

    ############

    Regards,

    Thomas

    On Sun, 11 Jan 2004 16:22:08 +0330 ssyazd.info (Sadeq Naqashzade) wrote:

    >
    > So Thanks, but can you get me some example code?
    >
    > Regards,
    > Sadeq
    >
    > "Thomas Seifert" <thomas.seifertmyphorum.de> wrote in message
    > news:20030111134834.0d70d923.thomas.seifertmyphorum.de...
    > > http://de.php.net/manual/en/function.mktime.php
    > >
    > > The most important part is
    > > "mktime() is useful for doing date arithmetic and validation, as it will
    > automatically calculate the correct value for out-of-range input."
    > >
    > >
    > >
    > > Thomas
    > >
    > > On Sun, 11 Jan 2004 16:12:01 +0330 ssyazd.info (Sadeq Naqashzade) wrote:
    > >
    > > > Hi,
    > > > How can I find time stamp for example 125 next days. or 03:30 hours
    > next?
    > > >
    > > > Regards,
    > > > S. Naqashzade
    > > > PS: Sorry for my bad english :-(
    > > >
    > > >
    >
    >

    attached mail follows:


    On Sunday 11 January 2004 20:52, Naqashzade, Sadeq wrote:
    > So Thanks, but can you get me some example code?

    There are plenty of examples in the manual!

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* Digital Manipulator exceeding velocity parameters */

    attached mail follows:


    They should show up but still think of the order in which they are loaded. You can access vars which are not yet loaded. Also you can't access variables which are initialized in a function (if they are not global).

    Including adds the contents of the files as if it was directly in main.php4, they are not new namespaces

    Thomas

    On Sat, 11 Jan 2003 12:49:15 +0100 ben9000gmx.net (Ben9000) wrote:

    > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello List, > > a simple problem turned out to be not so simple as I thought. > > Here the situation: > main.php4 > | > +-include() mainhtml.php4 > | > +-include() functions.php4 > | > +a function does include() languagevars.php4 > > I can see the included $vars from languagevars.php4 in functions.php4 > but not in main.php4. > > Using "global $var" just seems to work top->down but I'm not able to > bring the $vars up to the main.php4 or to the mainhtml.php4. > > This time, I just wanted to write not one scary large PHP4-Page with > around ~100kb in size. But I'm really stuck - all the books, pdfs and > web information just want to bring the $vars down. > > Or is there just a failure in thinking?! > > Any hint is highly appreciated. > Ben :) > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.1 (GNU/Linux) > > iD8DBQE+IATAROwluvOuI4ARApiOAJ9EyDo2ER3YROGZ120CgllOkjM8tgCfUIeD > pxtKmzi71xC3n8Tpb0FSQ7w= > =BZcc > -----END PGP SIGNATURE-----

    attached mail follows:


    who knowes how to count the charcaters in a string without the space character?

    thanks harry

    attached mail follows:


    On Saturday 11 January 2003 08:51 pm, harald.mohringgmx.de wrote: > who knowes how to count the charcaters in a string without the space > character?

    you need to be more clear.

    number of characters in the string except space? number of distinct characters in the string except space? include other non-space whitespace (\t \n \r etc)?

    case sensitive?

    this is really not hard at all and would be educational for you to write yourself, as an exercise in learning php.

    one approach:

    1. create an empty string, charsfound. for each character in your input string, see if the character already exists in charsfound (use strchr or strpos). if it's a space, continue the loop (don't exec the code below). if it's already there, skip to the next character. if it's not yet there, increment a counter, add the character to charsfound and continue the loop.

    at the end of the input string exit the loop. the counter is the number of distinct non-space characters in the input string.

    putting the "increment a counter" elsewhere (but in the appropriate places) in the loop will give you the number of non-space (not distinct) characters in the input string.

    tiger

    -- 
    Gerald Timothy Quimpo  tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph
    Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"
                       Veritas liberabit vos.
                       Doveryai no proveryai.
    

    attached mail follows:


    > who knowes how to count the charcaters in a string without the space > character?

    Using a regular expression to strip out all the spaces before passing to the word counting function seems easiest. You'll be left to adapt it to PHP, but the regexp is: 's/ //g' That removes all spaces. If it gives an error, try s/\ //g to escape the space. Pass the result to whatever you use to count the number of characters.

    -Jeff SIG: HUP

    attached mail follows:


    Hi every one, I want to create thumbnail of a photo stored in MySQL table online.

    Best Wishes, S. Naqashzade

    attached mail follows:


    how about just reading the docs which are available online? http://de.php.net/manual/en/ref.image.php

    and especially http://de.php.net/manual/en/function.imagecopyresized.php

    will help.

    Thomas

    On Sun, 11 Jan 2004 16:32:36 +0330 ssyazd.info (Sadeq Naqashzade) wrote:

    > Hi every one, > I want to create thumbnail of a photo stored in MySQL table online. > > Best Wishes, > S. Naqashzade > > >

    attached mail follows:


    use imagecopyresized() or imagecopyresampled() check the manual for details ----- Original Message ----- From: "Naqashzade, Sadeq" <ssyazd.info> To: <php-generallists.php.net> Sent: Sunday, January 11, 2004 5:02 AM Subject: [PHP] Make thumbnail online

    > Hi every one, > I want to create thumbnail of a photo stored in MySQL table online. > > Best Wishes, > S. Naqashzade > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hello ppl,

    Well, I want to compate date is php, could anybody tell me which is the best way to do so? I have tried various ways but nothing seems consistent. I tried for example: if("2003-1-15" > "2003-1-11") { echo "true";

    } which doesn't work in some cases...

    Thank you!

    Best Regards, Dhaval

    _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail

    attached mail follows:


    >----- Original Message ----- >From: "Dhaval Desai" <da_linuxguruhotmail.com> >To: <php-generallists.php.net> >Sent: Saturday, January 11, 2003 8:38 AM >Subject: [PHP] Date Comparison > Well, I want to compate date is php, could anybody tell me which is the best way to do so?

    Look at PHPs date functions http://www.php.net/manual/en/ref.datetime.php in particular, strtotime() and then compare the timestamps.

    attached mail follows:


    On Saturday 11 January 2003 21:38, Dhaval Desai wrote: > Hello ppl, > > > Well, I want to compate date is php, could anybody tell me which is the > best way to do so? I have tried various ways but nothing seems consistent. > I tried for example: > if("2003-1-15" > "2003-1-11") > { > echo "true"; > > } > which doesn't work in some cases...

    Actually the above should work in all cases as you're comparing two strings constants :)

    In any case if your dates are in ISO format (YYYY-MM-DD) then simple comparison using >, <, ==, etc should always work fine.

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* "Who cares if it doesn't do anything? It was made with our new Triple-Iso-Bifurcated-Krypton-Gate-MOS process ..." */

    attached mail follows:


    How I can create a Word document through PHP? Must I modify php.ini?

    attached mail follows:


    You should be able to create it directly by using the COM functionality. You only have to change php.ini if your COM configuration is not correct.

    Take a look at http://ca.php.net/manual/en/ref.com.php for more info.

    Incidentally, if you allow me a bit of shameless self-promotion, there was an article on how to do this (and a bit more if you want to get into .NET) in this month's issue of php|architect. The issue is also free to download, so maybe that article would be of help.

    Cheers,

    Marco

    -- 
    ----------------
    php|architect - The Monthly Magazine for PHP Professionals
    Come check us out on the web at http://www.phparch.com!
    

    attached mail follows:


    How I can create a Word document through PHP? Must I modify php.ini?

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

    attached mail follows:


    Thank you for reading my mail! ---------------------------------------------------------- I use PHP to get one line from a file,But it has to read the entire file. This is unefficient. Now I want to get the line which I want, and the PHP only read the line. Are there a good method to improve it? ---------------------------------------------------------- Joskey Liaus joskeylianluo.com

    attached mail follows:


    You don't specify if you want to read a *particular* line from a file. If so, I think there really is no way short of scanning the file with fgets() or by perhaps using some external utility such as grep or sed.

    If you want to read the first line, then you can use fgets() directly on the file.

    Cheers,

    Marco

    -- 
    ----------------
    php|architect - The Monthly Magazine for PHP Professionals
    Come check us out on the web at http://www.phparch.com!
    

    attached mail follows:


    Thank you for reading my mail! ---------------------------------------------------------- I use PHP to get one line from a file,But it has to read the entire file. This is unefficient. Now I want to get the line which I want, and the PHP only read the line. Are there a good method to improve it? ---------------------------------------------------------- Joskey Liaus joskeylianluo.com

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

    attached mail follows:


    On Saturday 11 January 2003 10:47 pm, Marco Tabini wrote: > You don't specify if you want to read a *particular* line from a file. > If so, I think there really is no way short of scanning the file with > fgets() or by perhaps using some external utility such as grep or sed.

    scanning the file with fgets is very slow. using external tools which are specialized for the task of scanning for lines will generally yield much better results.

    if you're on unix, then a combination of head and tail (or just head or tail, if you just want the first or last line of a file) will generally get you any line. e.g., if you want the 5th line of a file, you can say:

    cat filename | head -n 5 | tail -n 1

    (use popen to start that process running and read its output).

    on the other hand, if you don't know just which line number it is you want, then some more complicated method (probably involving grep, as suggested by Marco) will generally get you what you need. if what you need is even more complex than this, then you will probably just have to scan the file with fgets although it might still be possible with a combination of unix command line tools such as head, tail, grep, etc).

    if you're on windows and don't have access to those tools, well, you're on your own. you would probably be able to get better performance by writing the program to get the line in C/C++ or some other compiled language and just popen that from php.

    tiger

    -- 
    Gerald Timothy Quimpo  tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph
    Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"
                       Veritas liberabit vos.
                       Doveryai no proveryai.
    

    attached mail follows:


    > Why re-invent what is already written? I'm well aware that it's easy to > write but there may be something out there already that suits my needs and > has some features that I hadn't thought of. If you don't have a suggestion > on a package please spare me the rude replies which seem to run rampant on > here lately...

    Though I agree the reply given was rather crude, and I think also unnecessary, so was you question. It is rather a waste of the time of the list's membership to spend their time doing searches for you to find code packages. It is my impression, at least, that this list exists to provide assistance on a somewhat higher level of issues. Your question was worded in such a way that it wasn't very different from this:

    > Hi every one, > I want to create thumbnail of a photo stored in MySQL table online. > > Best Wishes, > S. Naqashzade

    And that is not something I care to bother with. I spent the effort of typing "php thumbnail mysql photo" into Google. And as a surprise to some, I had to refine the search once to get that, and what you're looking for you'll sometimes have to scroll down for or *gasp* even head to the next 10 results.

    I suggest going to Google's directory: http://directory.google.com/Top/Computers/Programming/Languages/PHP/Scripts/ try doing a search for FAQ. Since I really don't know what it is you want, I can't help much more than that. The basic idea is spend some time searching, look inside of well-known script sites, dig through the search enginges... You might also be able to strip the FAQ section out of PHP Nuke, but that's a confusing mess in its own right. Forgive my bitterness, but Sometimes you end up looking at a question and going "Why am I wasting my time on this? This person expects me to do everything but make their site."

    Don't straight-up ask for info on questions that are covered EVERY WEEK, and do look at more than just one site.

    -Jeff SIG: HUP

    attached mail follows:


    Maybe y'all should take your flame war off list? Just a friendly little suggestion.

    Jeffrey B. Ferland wrote: >>Why re-invent what is already written? I'm well aware that it's easy to >>write but there may be something out there already that suits my needs and >>has some features that I hadn't thought of. If you don't have a suggestion >>on a package please spare me the rude replies which seem to run rampant on >>here lately... > > > Though I agree the reply given was rather crude, and I think also > unnecessary, so was you question. It is rather a waste of the time of the > list's membership to spend their time doing searches for you to find code > packages. It is my impression, at least, that this list exists to provide > assistance on a somewhat higher level of issues. Your question was worded in > such a way that it wasn't very different from this: > > >>Hi every one, >>I want to create thumbnail of a photo stored in MySQL table online. >> >>Best Wishes, >>S. Naqashzade > > > And that is not something I care to bother with. I spent the effort of > typing "php thumbnail mysql photo" into Google. And as a surprise to some, I > had to refine the search once to get that, and what you're looking for > you'll sometimes have to scroll down for or *gasp* even head to the next 10 > results. > > I suggest going to Google's directory: > http://directory.google.com/Top/Computers/Programming/Languages/PHP/Scripts/ > try doing a search for FAQ. Since I really don't know what it is you want, I > can't help much more than that. The basic idea is spend some time searching, > look inside of well-known script sites, dig through the search enginges... > You might also be able to strip the FAQ section out of PHP Nuke, but that's > a confusing mess in its own right. Forgive my bitterness, but Sometimes you > end up looking at a question and going "Why am I wasting my time on this? > This person expects me to do everything but make their site." > > Don't straight-up ask for info on questions that are covered EVERY WEEK, and > do look at more than just one site. > > -Jeff > SIG: HUP > >

    -- 
    By-Tor.com
    It's all about the Rush
    http://www.by-tor.com
    

    attached mail follows:


    And yet you took the time to reply...I searched the archives of this mailing list...

    The list is more than just for those that consider themselves gods in the PHP world, it's for people who program in PHP, a bit of a community if you will or at least that was my feeling.

    I've been on this list for at least a year, maybe a year and half and it has really degraded and I feel so sorry everytime I see a new user get a nasty reply from people "who can't be bothered" to read their emails looking for help. I also know how to search for things on the web, I was asking fellow PHP users for their opinions on a package they may use. I don't see anything against that in the terms of use for the list.

    If there is something you don't like hit the damn delete button, I read maybe 10% of the stuff that comes across this list but I never email telling people they are wasting my time...

    Jeff

    ----- Original Message ----- From: "Jeffrey B. Ferland" <jferlandlplonline.org> To: "Jeff Lewis" <jeffhyrum.net> Cc: <php-generallists.php.net> Sent: Saturday, January 11, 2003 9:06 AM Subject: Re: [PHP] Suggestions on FAQ application?

    > > Why re-invent what is already written? I'm well aware that it's easy to > > write but there may be something out there already that suits my needs and > > has some features that I hadn't thought of. If you don't have a suggestion > > on a package please spare me the rude replies which seem to run rampant on > > here lately... > > Though I agree the reply given was rather crude, and I think also > unnecessary, so was you question. It is rather a waste of the time of the > list's membership to spend their time doing searches for you to find code > packages. It is my impression, at least, that this list exists to provide > assistance on a somewhat higher level of issues. Your question was worded in > such a way that it wasn't very different from this: > > > Hi every one, > > I want to create thumbnail of a photo stored in MySQL table online. > > > > Best Wishes, > > S. Naqashzade > > And that is not something I care to bother with. I spent the effort of > typing "php thumbnail mysql photo" into Google. And as a surprise to some, I > had to refine the search once to get that, and what you're looking for > you'll sometimes have to scroll down for or *gasp* even head to the next 10 > results. > > I suggest going to Google's directory: > http://directory.google.com/Top/Computers/Programming/Languages/PHP/Scripts/ > try doing a search for FAQ. Since I really don't know what it is you want, I > can't help much more than that. The basic idea is spend some time searching, > look inside of well-known script sites, dig through the search enginges... > You might also be able to strip the FAQ section out of PHP Nuke, but that's > a confusing mess in its own right. Forgive my bitterness, but Sometimes you > end up looking at a question and going "Why am I wasting my time on this? > This person expects me to do everything but make their site." > > Don't straight-up ask for info on questions that are covered EVERY WEEK, and > do look at more than just one site. > > -Jeff > SIG: HUP > > > >

    attached mail follows:


    It wasn't a flame war, it was someone being rude. I got a fantastic reply from someone earlier, I guess not everyone has got their jabs in and Jeffrey felt he needed to get his in...

    Consider it closed.

    ----- Original Message ----- From: "John Nichel" <jnichelby-tor.com> To: "Jeffrey B. Ferland" <jferlandlplonline.org> Cc: "Jeff Lewis" <jeffhyrum.net>; <php-generallists.php.net> Sent: Saturday, January 11, 2003 10:49 AM Subject: Re: [PHP] Suggestions on FAQ application?

    > Maybe y'all should take your flame war off list? Just a friendly little > suggestion.

    attached mail follows:


    I don't believe a FAQ application actualy has been written yet... I haven't seen one on Hotscript.com or PHP Resources. But if you have found one, please let me know as i'm interested in one as well.

    - Daniel "TheHeadSage" Spain Founder of Voidsoft.

    On 10 Jan 2003 at 21:51, Jeff Lewis wrote:

    > Why re-invent what is already written? I'm well aware that it's easy to > write but there may be something out there already that suits my needs and > has some features that I hadn't thought of. If you don't have a suggestion > on a package please spare me the rude replies which seem to run rampant on > here lately... > > Jeff > ----- Original Message ----- > From: "Timothy Hitchens (HiTCHO)" <phplistshitcho.com.au> > To: "'Jeff Lewis'" <jeffhyrum.net>; "'php-gen'" <php-generallists.php.net> > Sent: Friday, January 10, 2003 9:39 PM > Subject: RE: [PHP] Suggestions on FAQ application? > > > > It is a 30 minute write... not that hard!! > > > > > > Timothy Hitchens (HiTCHO) > > Open Platform Consulting > > e-mail: timhitcho.com.au > > > > > -----Original Message----- > > > From: Jeff Lewis [mailto:jeffhyrum.net] > > > Sent: Saturday, 11 January 2003 12:37 PM > > > To: php-gen > > > Subject: [PHP] Suggestions on FAQ application? > > > > > > > > > I've checked Hotscripts and I can't findanything relatively > > > new or that suits my needs. I was wondering if anyone uses a > > > FAQ program that they could suggest? > > > > > > Jeff > > > > > > > > > > > > > >

    attached mail follows:


    I'm following various tutorials online that uses the PATH_INFO to do this, however Apache isn't playing nicely. I read a few documents that Apache has a built in look back feature, but a query on google on lead me back to a few articles that I just read so I'm assuming this feature is made up in the article?

    I've gotten the .htaccess to run a file as a .php, however I can't attach arguments to the right hand side of the URL. An example would be, I have a file called index.php. I turn this into index and run it as a .php file. It works fine, though I should be able to add /name/1 which shows up under the PATH_INFO variable.

    However, I get a blank page and this error logged in Apache:

    [Sat Jan 11 10:33:40 2003] [error] [client 127.0.0.1] PHP Fatal error: Unable to open c:\apache\www\www.mxportal.com\public_html\dir\resources\d in Unknown on line 0

    So it looks like Apache is not reading back to resources, but thinks there is folder called resources and a file called d in which it's trying to open and pass it to PHP.

    This however works under *NIX systems. I'm not sure if there's a different of doing it under Windows or if this is a bug in Apache. Any ideas?

    attached mail follows:


    As far as I know, this technique doesn't work under windows...

    Jonathan Chum wrote:

    >I'm following various tutorials online that uses the PATH_INFO to do this, >however Apache isn't playing nicely. I read a few documents that Apache has >a built in look back feature, but a query on google on lead me back to a few >articles that I just read so I'm assuming this feature is made up in the >article? > >I've gotten the .htaccess to run a file as a .php, however I can't attach >arguments to the right hand side of the URL. An example would be, I have a >file called index.php. I turn this into index and run it as a .php file. It >works fine, though I should be able to add /name/1 which shows up under the >PATH_INFO variable. > >However, I get a blank page and this error logged in Apache: > >[Sat Jan 11 10:33:40 2003] [error] [client 127.0.0.1] PHP Fatal error: >Unable to open c:\apache\www\www.mxportal.com\public_html\dir\resources\d in >Unknown on line 0 > >So it looks like Apache is not reading back to resources, but thinks there >is folder called resources and a file called d in which it's trying to open >and pass it to PHP. > >This however works under *NIX systems. I'm not sure if there's a different >of doing it under Windows or if this is a bug in Apache. Any ideas? > > > > >

    -- 
    Gerard Samuel
    http://www.trini0.org:81/
    http://dev.trini0.org:81/
    

    attached mail follows:


    Toying with Apache further, I actually was able to get this to work a few minutes I posted the thread. What I was doing wrong was running PHP as a CGI rather than using it as SAPI module.

    Hopefully this helps other folks as I was going nuts going through google.com trying to find a solution.

    Add this line to your httpd.conf with the path to php4apache.dll included in the Windows distribution:

    LoadModule php4_module C:\apache\php\sapi\php4apache.dll

    Then add this line:

    AddModule mod_php4.c

    Then add the MIME types for PHP:

    AddType application/x-httpd-php .php3 AddType application/x-httpd-php .php AddType application/x-httpd-php .phtml

    Also, you'll need to copy php4ts.dll into your c:\Windows\System32 folder.

    After all that, this feature works under Windows whoohoo :)

    "Gerard Samuel" <gsamtrini0.org> wrote in message news:3E203CCB.50403trini0.org... > As far as I know, this technique doesn't work under windows... > > Jonathan Chum wrote: > > >I'm following various tutorials online that uses the PATH_INFO to do this, > >however Apache isn't playing nicely. I read a few documents that Apache has > >a built in look back feature, but a query on google on lead me back to a few > >articles that I just read so I'm assuming this feature is made up in the > >article? > > > >I've gotten the .htaccess to run a file as a .php, however I can't attach > >arguments to the right hand side of the URL. An example would be, I have a > >file called index.php. I turn this into index and run it as a .php file. It > >works fine, though I should be able to add /name/1 which shows up under the > >PATH_INFO variable. > > > >However, I get a blank page and this error logged in Apache: > > > >[Sat Jan 11 10:33:40 2003] [error] [client 127.0.0.1] PHP Fatal error: > >Unable to open c:\apache\www\www.mxportal.com\public_html\dir\resources\d in > >Unknown on line 0 > > > >So it looks like Apache is not reading back to resources, but thinks there > >is folder called resources and a file called d in which it's trying to open > >and pass it to PHP. > > > >This however works under *NIX systems. I'm not sure if there's a different > >of doing it under Windows or if this is a bug in Apache. Any ideas? > > > > > > > > > > > > -- > Gerard Samuel > http://www.trini0.org:81/ > http://dev.trini0.org:81/ > >

    attached mail follows:


    Check out the Smarty tutorial links page from it's site resources section - http://smarty.php.net/resources.php?category=0

    Also the Smarty manual is excellent - very comprehensive and well written. I just about taught myself Smarty using this alone.

    I think Smarty is the absolute biz when it comes to php template engines; well worth giving a really good test run.

    D.

    "Chad Day" <cdayatpco.com> wrote in message news:MCEKJHBJAFFPOKFICJHMMENOLJAA.cdayatpco.com... > I'm googling around for template tutorials and such after seeing a link to > the Smarty template engine .. can anyone point me to any particularly good > ones? I've always been going with the 'one-file' approach .. which I think > it's time I changed. > > Thanks, > Chad >

    attached mail follows:


    Im trying to clean up xml data of illegal characters. I need a pointer as to how to get a regex to perform this. Here is my feable attempt ->

    <?php

    header('Content-type: text/plain');

    $foo = '<title>It\'s a test</title>';

    //$bar = preg_replace('/[^\w\s<>\/]+/', '&apos;', $foo); $bar = preg_replace('/(<title>)([\'])(<\/title>)/', '$1' . '&apos;' . '$3', $foo);

    echo $bar;

    ?>

    Im trying the 2nd way, because I want to only do this clean up between certain tags.. Thanks for any help you may provide.

    -- 
    Gerard Samuel
    http://www.trini0.org:81/
    http://dev.trini0.org:81/
    

    attached mail follows:


    You should probably mention that this is called WebFolders in M$-speak and it actually works quite well when combined with the mod_dav and mod_digest Apache modules.

    -Rasmus

    On Fri, 10 Jan 2003, Timothy Hitchens (HiTCHO) wrote:

    > So you want to be able to have a directory that when saved to it is > really the server well > besides ftp or samba integration into explorer the only other option you > have is to use > webdav with apache and that way it would be a post of sorts to the mod > webdav module in apache. > > > > Timothy Hitchens (HiTCHO) > Open Platform Consulting > e-mail: timhitcho.com.au > > > -----Original Message----- > > From: tryneasys.com [mailto:tryneasys.com] > > Sent: Friday, 10 January 2003 4:06 PM > > To: php-generallists.php.net > > Subject: [PHP] Is this possible with php? > > > > > > I would like to know if the follwing function can be > > implemneted in php with help of other tools: > > > > using MS Word in windows, when a file is saved, can it be > > AUTOMATICALLY uploaded (via http POST or other mechanism) to a server? > > > > Currently I need to first save it on my desktop, then upload > > that copy to a php-supported server. > > > > Thanks in advance. > > > > Tim > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > >

    attached mail follows:


    tryneasys.com wrote:

    >using MS Word in windows, when a file is saved, can it be AUTOMATICALLY >uploaded (via http POST or other mechanism) to a server? > Yes, in a webDAV enabled directory on your webserver (http://www.webdav.org). Its a module that you can compile for use with Apache (I'm using it under linux). M$ are one of the authors of the standard (RFC2518).

    >Currently I need to first save it on my desktop, then upload that copy >to a php-supported server. > Yes, that is the problem statement. In a webDAV enabled directory, its like an ordinary directory from your webserver but read/write, with file locking. Any authorisation your webserver supports may be used.

    Nothing to do with PHP though.

    Regards

    Chris

    attached mail follows:


    tryneasys.com wrote:

    >using MS Word in windows, when a file is saved, can it be AUTOMATICALLY >uploaded (via http POST or other mechanism) to a server? > Yes, in a webDAV enabled directory on your webserver (http://www.webdav.org). Its a module that you can compile for use with Apache (I'm using it under linux). M$ are one of the authors of the standard (RFC2518).

    >Currently I need to first save it on my desktop, then upload that copy >to a php-supported server. > Yes, that is the problem statement. In a webDAV enabled directory, its like an ordinary directory from your webserver but read/write, with file locking. Any authorisation your webserver supports may be used.

    Nothing to do with PHP though.

    Regards

    Chris

    attached mail follows:


    I have a array as below I wish to sort if by the key "fff"

    name => blah fff => 4 join => pppop

    name => ttoo fff => 3 join => wewe

    name => blff fff => 9 join => ppeep

    Any1 know of a quick way to do this, I have been looking at the sorting of arrays in the Manual but cant see anything..

    Thanks in advance

    Regards Chris Kay

    attached mail follows:


    Hello everybody! Can anybody advice me the best free web-hosting with PHP? Thank you.

    attached mail follows:


    hi guys just noticed php5 cvs in the snaps page , does this have the zend 2.0 engine ? more specific question has it got the proper OO built in yet ?

    attached mail follows:


    It includes the latest CVS build of ZendEngine 2.0 - AFAIK it hasn't even reached beta status yet, so don't even think about using it for production work. That said, I didn't have any problems building it and it seems pretty stable.

    A list of changes and features can be found at http://www.php.net/ZEND_CHANGES.txt.

    HTH

    Danny.

    ----- Original Message ----- From: "electroteque" <danielelectroteque.org> To: <php-generallists.php.net> Sent: Saturday, January 11, 2003 6:50 PM Subject: [PHP] php5 cvs

    > hi guys just noticed php5 cvs in the snaps page , does this have the zend > 2.0 engine ? more specific question has it got the proper OO built in yet ? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    On Saturday 11 January 2003 18:39, Noel Wade wrote: > Nevermind, just found the $HTTP_SESSION_VARS array...

    If you're using a relatively recent version of PHP, you should use $_SESSION.

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* Sic transit gloria mundi. [So passes away the glory of this world.] -- Thomas `a Kempis */

    attached mail follows:


    On Saturday 11 January 2003 19:47, Jason k Larson wrote: > FYI: > Don't like auto register globals ... try the following at the beginning > of your script. > > ini_set ('register_globals','Off'); > > Works for me places I'm hosted at.

    register_globals cannot be set at runtime (to be precise, it can be set but it has no effect). If it works for you, you should report it as a bug!

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* Do not worry about which side your bread is buttered on: you eat BOTH sides. */

    attached mail follows:


    I have a database that was created on an earlier version of PostgreSQL and uses global variables with register_globals = on for php4. I have migrated the database to postgresql-7.3.1 with mod_php-4.2.3 and have set the register_globals to on. In order to use the default setting of register_globals = off, I need to reprogram my php files. I would appreciate some suggestions on how to go about modifying the code. Is there a script that could be run on each file to convert to the superglobals that would work with the register_globals off? I also need to know the exact syntax: for example, one current line is -

    include "$DOCUMENT_ROOT/../lib/somefile.conf";

    Someone did suggest the following:

    include $_SERVER['DOCUMENT_ROOT'].'/../lib/somefile.conf';

    however, there is a difference in the use of the quotation marks and I do not understand the use of the . and ..

    Could someone explain, please?

    PJ

    attached mail follows:


    On Sunday 12 January 2003 03:45, pippobellnet.ca wrote:

    > I have a database that was created on an earlier version of PostgreSQL and > uses global variables with register_globals = on for php4. > I have migrated the database to postgresql-7.3.1 with mod_php-4.2.3 and > have set the register_globals to on. In order to use the default setting of > register_globals = off, I need to reprogram my php files. > I would appreciate some suggestions on how to go about modifying the code. > Is there a script that could be run on each file to convert to the > superglobals that would work with the register_globals off?

    If only it was that easy ;)

    The best thing to do is crank up error reporting to maximum (errors AND notices). You should see a lot of undefined or uninitialized variables notices/warnings. Find out where those variables are coming from (GET, POST or whatever) and change them appropriately. Eg you have a form with method=POST and a single text element called 'name'. Instead of using just $name in your code you need to use $_POST['name'].

    > I also need to know the exact syntax: for example, one current line is - > > include "$DOCUMENT_ROOT/../lib/somefile.conf"; > > Someone did suggest the following: > > include $_SERVER['DOCUMENT_ROOT'].'/../lib/somefile.conf'; > > however, there is a difference in the use of the quotation marks and I do > not understand the use of the . and ..

    It used to be that $DOCUMENT_ROOT was a predefined variable in the global scope. Thus you could use it directly in a string like in your first statement. Now DOCUMENT_ROOT can only be obtained from the $_SERVER array.

    Between strings and variables the period (.) acts as a concatenation operator. The second statement can be reformatted to make it clearer:

    $_SERVER['DOCUMENT_ROOT'] . '/../lib/somefile.conf';

    Hopefully you can clearly see that the left side is equivalent to $DOCUMENT_ROOT and the right side is just a string. The '..' in the string on the right has nothing to with PHP, it's just the standard way to denote the parent directory.

    Single-quoted strings are literal strings, double-quoted strings does variable expansion.

    The second statement can also be rewritten as:

    "{$_SERVER['DOCUMENT_ROOT']}/../lib/somefile.conf";

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* Positive, adj.: Mistaken at the top of one's voice. -- Ambrose Bierce, "The Devil's Dictionary" */

    attached mail follows:


    At 04:16 AM 1/12/2003 +0800, you wrote: >On Sunday 12 January 2003 03:45, pippobellnet.ca wrote: > > > I have a database that was created on an earlier version of PostgreSQL and > > uses global variables with register_globals = on for php4. > > I have migrated the database to postgresql-7.3.1 with mod_php-4.2.3 and > > have set the register_globals to on. In order to use the default setting of > > register_globals = off, I need to reprogram my php files. > > I would appreciate some suggestions on how to go about modifying the code. > > Is there a script that could be run on each file to convert to the > > superglobals that would work with the register_globals off? > >If only it was that easy ;)

    That should be: "If only it were that easy" - subjunctive, :)) sorry, it's my English studies that keep coming back at me....

    >The best thing to do is crank up error reporting to maximum (errors AND >notices). You should see a lot of undefined or uninitialized variables >notices/warnings. Find out where those variables are coming from (GET, POST >or whatever) and change them appropriately. Eg you have a form with >method=POST and a single text element called 'name'. Instead of using just >$name in your code you need to use $_POST['name']. > > > I also need to know the exact syntax: for example, one current line is - > > > > include "$DOCUMENT_ROOT/../lib/somefile.conf"; > > > > Someone did suggest the following: > > > > include $_SERVER['DOCUMENT_ROOT'].'/../lib/somefile.conf'; > > > > however, there is a difference in the use of the quotation marks and I do > > not understand the use of the . and .. > >It used to be that $DOCUMENT_ROOT was a predefined variable in the global >scope. Thus you could use it directly in a string like in your first >statement. Now DOCUMENT_ROOT can only be obtained from the $_SERVER array. > >Between strings and variables the period (.) acts as a concatenation >operator. >The second statement can be reformatted to make it clearer: > > $_SERVER['DOCUMENT_ROOT'] . '/../lib/somefile.conf'; > >Hopefully you can clearly see that the left side is equivalent to >$DOCUMENT_ROOT and the right side is just a string. The '..' in the string on >the right has nothing to with PHP, it's just the standard way to denote the >parent directory. > >Single-quoted strings are literal strings, double-quoted strings does >variable >expansion. > >The second statement can also be rewritten as: > > "{$_SERVER['DOCUMENT_ROOT']}/../lib/somefile.conf";

    Thanks, Jason. This helps somewhat.

    Most of the variables should be fairly obvious, I should think. So, it should not be too difficult to do some search & replace of stuff like the $_SERVER['DOCUMENT_ROOT'] stuff. I suppose I could then try to run the stuff with error reporting maxed out. Does that seem about right or should I start with the error reports and go at it one by one. Being terribly lazy, I suppose makes me want to find shortcuts. I understand laziness is also a sign of genius... :))

    PJ

    attached mail follows:


    On Saturday 11 January 2003 19:45, Christian Stalberg wrote: > what does debug_phpinfo.php read to get its information? > > When I run debug_phpinfo.php in my browser it says version 4.2.3 > > But when I execute php -v at the command line I get 4.0.4pl1

    You have started a new thread by taking an existing posting and replying to it while you changed the subject.

    That is bad, because it breaks threading. Whenever you reply to a message, your mail client generates a "References:" header that tells all recipients which posting(s) your posting refers to. A mail client uses this information to build a threaded view ("tree view") of the postings.

    With your posting style you successfully torpedoed this useful feature; your posting shows up within an existing thread it has nothing to do with.

    Always do a fresh post when you want to start a new thread. To achieve this, click on "New message" instead of "Reply" within your mail client, and enter the list address as the recipient. You can save the list address in your address book for convenience.

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* An age is called Dark not because the light fails to shine, but because people refuse to see it. -- James Michener, "Space" */

    attached mail follows:


    On Saturday 11 January 2003 06:53, Philip J. Newman wrote: > I have a table with images and comments. > > if i have $x amout of images that each have a comment. > > the comments are displayed in the center colum of the table with the images > loading left and right of each comment. > > http://www.philipnz.com/example.jpg > > I can get the images to load in their left and right position, how ever i > can't get the right array to print each comment with the image. > > Any help would be cool.

    Showing us your code would be even cooler!

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* "There are things that are so serious that you can only joke about them" - Heisenberg */

    attached mail follows:


    Hi,

    Were can i get scripts to send rintones/graphics to mobile phones using php ?.

    Arvind

    attached mail follows:


    Hi,

    Were can i get scripts to send rintones/graphics to mobile phones using php ?.

    Arvind

    attached mail follows:


    i have a database with unix path names of mp3s like:

    Patti Smith/Horses [1975]/01-Gloria.mp3

    which have to keep the spaces for part of another application. If i let the shell escape them from an ls command, i can get:

    Patti\ Smith/Horses\ \[1975\]/01-Gloria.mp3

    but fopen will still refuse saying file not found. I have tried escaped and unescaped amnd yes, I am very sure the file is there.

    How can I get fopen to accept a path like this?

    cheers.

    --
    Mat Harrison			Network Systems Administrator
    mat.harrisgenestate.com	www.genestate.com
    

    -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (MingW32)

    iD8DBQE+IKPtEsYvZsN9V9kRApwlAJ0XUmtvQ50D65UN6JLIBmLJ9Yzm4QCfVjgc LKUx7avIBT1WMY0ExnD6L5k= =rANp -----END PGP SIGNATURE-----