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:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
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 :-(


--- End Message ---
--- Begin Message ---
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 [EMAIL PROTECTED] (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 :-(
> 
> 
--- End Message ---
--- Begin Message ---
So Thanks, but can you get me some example code?

Regards,
Sadeq

"Thomas Seifert" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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 [EMAIL PROTECTED] (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 :-(
> >
> >


--- End Message ---
--- Begin Message ---
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 [EMAIL PROTECTED] (Sadeq Naqashzade) wrote:

> 
> So Thanks, but can you get me some example code?
> 
> Regards,
> Sadeq
> 
> "Thomas Seifert" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > 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 [EMAIL PROTECTED] (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 :-(
> > >
> > >
> 
> 
--- End Message ---
--- Begin Message ---
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
*/

--- End Message ---
--- Begin Message ---
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 [EMAIL PROTECTED] (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-----
--- End Message ---
--- Begin Message ---
who knowes how to count the charcaters in a string without the space
character?

thanks harry


--- End Message ---
--- Begin Message ---
On Saturday 11 January 2003 08:51 pm, [EMAIL PROTECTED] 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.
--- End Message ---
--- Begin Message ---
> 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

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

Best Wishes,
S. Naqashzade



--- End Message ---
--- Begin Message ---
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 [EMAIL PROTECTED] (Sadeq Naqashzade) wrote:

> Hi every one,
> I want to create thumbnail of a photo stored in MySQL table online.
> 
> Best Wishes,
> S. Naqashzade
> 
> 
> 
--- End Message ---
--- Begin Message ---
use imagecopyresized() or imagecopyresampled()
check the manual for details
----- Original Message ----- 
From: "Naqashzade, Sadeq" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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
> 

--- End Message ---
--- Begin Message --- 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

--- End Message ---
--- Begin Message ---
>----- Original Message -----
>From: "Dhaval Desai" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>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.


--- End Message ---
--- Begin Message ---
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 ..."
*/

--- End Message ---
--- Begin Message ---
How I can create a Word document through PHP?
Must I modify php.ini?

--- End Message ---
--- Begin Message ---
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!
--- Begin Message ---
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

--- End Message ---
--- End Message ---
--- Begin Message ---
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
                                       [EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
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!
--- Begin Message ---
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
                                       [EMAIL PROTECTED]



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

--- End Message ---
--- End Message ---
--- Begin Message ---
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.
--- End Message ---
--- Begin Message ---
> 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

--- End Message ---
--- Begin Message --- 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

--- End Message ---
--- Begin Message ---
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" <[EMAIL PROTECTED]>
To: "Jeff Lewis" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
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
>
>
>
>


--- End Message ---
--- Begin Message ---
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" <[EMAIL PROTECTED]>
To: "Jeffrey B. Ferland" <[EMAIL PROTECTED]>
Cc: "Jeff Lewis" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
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.



--- End Message ---
--- Begin Message ---
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)" <[EMAIL PROTECTED]>
> To: "'Jeff Lewis'" <[EMAIL PROTECTED]>; "'php-gen'" <[EMAIL PROTECTED]>
> 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: [EMAIL PROTECTED]
> >
> > > -----Original Message-----
> > > From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> > > 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
> > >
> >
> >
> >
> >
> 
> 
> 
--- End Message ---
--- Begin Message ---
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?


--- End Message ---
--- Begin Message ---
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/


--- End Message ---
--- Begin Message ---
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" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> 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/
>
>


--- End Message ---
--- Begin Message ---
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" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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
>








--- End Message ---
--- Begin Message --- 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/


--- End Message ---
--- Begin Message ---
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: [EMAIL PROTECTED]
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> > Sent: Friday, 10 January 2003 4:06 PM
> > To: [EMAIL PROTECTED]
> > 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
> > 
> 
> 
> 

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] 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

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] 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

--- End Message ---
--- Begin Message ---
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


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

--- End Message ---
--- Begin Message ---
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 ?


--- End Message ---
--- Begin Message ---
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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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
>

--- End Message ---
--- Begin Message ---
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
*/

--- End Message ---
--- Begin Message ---
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.
*/

--- End Message ---
--- Begin Message --- 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


--- End Message ---
--- Begin Message ---
On Sunday 12 January 2003 03:45, [EMAIL PROTECTED] 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"
*/

--- End Message ---
--- Begin Message ---
At 04:16 AM 1/12/2003 +0800, you wrote:
On Sunday 12 January 2003 03:45, [EMAIL PROTECTED] 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



--- End Message ---
--- Begin Message ---
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"
*/

--- End Message ---
--- Begin Message ---
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
*/

--- End Message ---
--- Begin Message ---
Hi,

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

Arvind




--- End Message ---
--- Begin Message ---
Hi,

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

Arvind


--- End Message ---
--- Begin Message --- 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
[EMAIL PROTECTED] www.genestate.com

Attachment: msg92625/pgp00000.pgp
Description: PGP signature

--- End Message ---

Reply via email to