php-general Digest 3 Oct 2004 23:37:40 -0000 Issue 3032

2004-10-03 Thread php-general-digest-help
php-general Digest 3 Oct 2004 23:37:40 - Issue 3032 Topics (messages 198533 through 198561): Re: set multiple variables 198533 by: argesson 198534 by: Graham Cossey 198535 by: dirk 198552 by: Matthew Fonda 198553 by: argesson 198554 by: Daniel

[PHP] How to install php5 on Fedora Core2

2004-10-03 Thread Teng Wang
I have some difficulties when installing php5.0.2 on FC2 I used the default settings: ./configure --with-apxs2=/usr/sbin/apxs build build install The installation is complete but when I test phpinfo() in a .php file from browser, the browser says Can't find the server My FC2 is fully installed

[PHP] Retrieving large results from a database ends in memory error.

2004-10-03 Thread RaTT
Hi Guys I am trying to retrieve over 5000 rows from a mysql database, i have to use a SELECT * query as i am required to use all the fields for display. Everytime i try to run the code below i get a Allowed memory size of 10485760 bytes exhausted (tried to allocate 40 bytes). Now if i change

Re: [PHP] Including function libraries

2004-10-03 Thread Marek Kilimajer
Jasper Howard wrote: it seems possible that this is the problem, you called it, checkLoggedIn() in your script then tried to call, checkloggedin(). Notice the caps aren't there when you tried to call it. Case does not matter for functions. Only for variable names. -- PHP General Mailing List

Re: [PHP] Retrieving large results from a database ends in memory error.

2004-10-03 Thread Marek Kilimajer
Use mysql_unbuffered_query() RaTT wrote: Hi Guys I am trying to retrieve over 5000 rows from a mysql database, i have to use a SELECT * query as i am required to use all the fields for display. Everytime i try to run the code below i get a Allowed memory size of 10485760 bytes exhausted (tried

[PHP] Re: set multiple variables

2004-10-03 Thread argesson
try this: if ($REMOTE_ADDR == 212.3.54.65 $REMOTE_ADDR == 212.3.54.66) Joe Szilagyi wrote: Hi, I have this working: if ($REMOTE_ADDR == 212.3.54.65) { header(Location: http://www.google.com/search?q=huzzah;); Redirect browser exit; } But I want to specify multiple IPs.

Re: [PHP] How do I produce a random database query for each day or week?

2004-10-03 Thread dirk
My idea on your problem would be to use a random sql-query selecting a cd from your database. SELECT * FROM my_table ORDER BY RAND() LIMIT 1; This could be placed in a script that is executed only by the first user in a week and the result is stored e.g. in a text file and included in any later

Re: [PHP] How to install php5 on Fedora Core2

2004-10-03 Thread Marek Kilimajer
Teng Wang wrote: I have some difficulties when installing php5.0.2 on FC2 I used the default settings: ./configure --with-apxs2=/usr/sbin/apxs build build install The installation is complete but when I test phpinfo() in a .php file from browser, the browser says Can't find the server Can't find

[PHP] Re: set multiple variables

2004-10-03 Thread Daniel Schierbeck
Argesson wrote: try this: if ($REMOTE_ADDR == 212.3.54.65 $REMOTE_ADDR == 212.3.54.66) Joe Szilagyi wrote: Hi, I have this working: if ($REMOTE_ADDR == 212.3.54.65) { header(Location: http://www.google.com/search?q=huzzah;); Redirect browser exit; } But I want to specify

[PHP] Re: set multiple variables

2004-10-03 Thread argesson
Daniel Schierbeck wrote: Argesson wrote: try this: if ($REMOTE_ADDR == 212.3.54.65 $REMOTE_ADDR == 212.3.54.66) Joe Szilagyi wrote: Hi, I have this working: if ($REMOTE_ADDR == 212.3.54.65) { header(Location: http://www.google.com/search?q=huzzah;); Redirect browser exit;

RE: [PHP] Re: set multiple variables

2004-10-03 Thread Graham Cossey
||= OR = AND -Original Message- From: argesson [mailto:[EMAIL PROTECTED] Sent: 03 October 2004 11:30 To: [EMAIL PROTECTED] Subject: [PHP] Re: set multiple variables Daniel Schierbeck wrote: Argesson wrote: try this: if ($REMOTE_ADDR == 212.3.54.65 $REMOTE_ADDR == 212.3.54.66)

Re: [PHP] Re: set multiple variables

2004-10-03 Thread dirk
$REMOTE_ADDR == 212.3.54.65 || $REMOTE_ADDR == 212.3.54.66 is correct On Sun, 3 Oct 2004 12:39:11 +0100, Graham Cossey [EMAIL PROTECTED] wrote: ||= OR = AND -Original Message- From: argesson [mailto:[EMAIL PROTECTED] Sent: 03 October 2004 11:30 To: [EMAIL PROTECTED]

[PHP] Re: PHP (anti) crash policy?

2004-10-03 Thread Manuel Lemos
Hello, On 10/02/2004 06:01 PM, Olaf Van Der Spek wrote: AFAIK PHP runs safely in multi-threaded servers. What you can't expect is that PHP handles abnormal situations caused by flaws in the external libraries that PHP links with. When I link with the same library in a C app, this 'abnormal

[PHP] Re: PHP (anti) crash policy?

2004-10-03 Thread Olaf van der Spek
Manuel Lemos wrote: Hello, On 10/02/2004 06:01 PM, Olaf Van Der Spek wrote: AFAIK PHP runs safely in multi-threaded servers. What you can't expect is that PHP handles abnormal situations caused by flaws in the external libraries that PHP links with. When I link with the same library in a C app,

Re: [PHP] How to install php5 on Fedora Core2

2004-10-03 Thread Robert Cummings
On Sun, 2004-10-03 at 09:43, Teng Wang wrote: Surely apache is running. And I checked httpd.conf. There is no LoadModule php4.x.x Anyother settings should be removed? The first time I installed php5.0.0, I forgot to add --with-apxs2=/usr/sbin/apxs. It works but the version is 4.3.8 as

Re: [PHP] How to install php5 on Fedora Core2

2004-10-03 Thread Teng Wang
Thanks a lot. It works! But a new problem is: default setting loses all extensions. If I wanna install all extension in the package, how to configure the installation and reinstall? Thanks a lot! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: PHP (anti) crash policy?

2004-10-03 Thread Manuel Lemos
Hello, On 10/03/2004 10:18 AM, Olaf Van Der Spek wrote: That is not the problem. The problem is that zlib does not seem to be able to detect and deal with corrupted streams. That leads to requesting absurd amounts of memory that the PHP memory allocator has no way to distinguish whether it is

Re: [PHP] How to install php5 on Fedora Core2

2004-10-03 Thread Robert Cummings
On Sun, 2004-10-03 at 10:21, Teng Wang wrote: Thanks a lot. It works! But a new problem is: default setting loses all extensions. If I wanna install all extension in the package, how to configure the installation and reinstall? There are two ways... you can either compile in the extensions

[PHP] Re: PHP (anti) crash policy?

2004-10-03 Thread Olaf van der Spek
Manuel Lemos wrote: Hello, I think that making all failed memory allocations recoverable is not viable because more PHP C code that makes memory allocations assumes it only returns if it succeeds. Trying to change that everywhere memory is allocated is and monster job that I doubt that any PHP

[PHP] Re: PHP (anti) crash policy?

2004-10-03 Thread Manuel Lemos
Hello, On 10/03/2004 12:27 PM, Olaf Van Der Spek wrote: I think that making all failed memory allocations recoverable is not viable because more PHP C code that makes memory allocations assumes it only returns if it succeeds. Trying to change that everywhere memory is allocated is and monster

[PHP] Re: PHP (anti) crash policy?

2004-10-03 Thread Olaf van der Spek
Manuel Lemos wrote: Hello, On 10/03/2004 12:27 PM, Olaf Van Der Spek wrote: I think that making all failed memory allocations recoverable is not viable because more PHP C code that makes memory allocations assumes it only returns if it succeeds. Trying to change that everywhere memory is

[PHP] Re: PHP (anti) crash policy?

2004-10-03 Thread Manuel Lemos
Hello, On 10/03/2004 01:46 PM, Olaf Van Der Spek wrote: I think that making all failed memory allocations recoverable is not viable because more PHP C code that makes memory allocations assumes it only returns if it succeeds. Trying to change that everywhere memory is allocated is and monster

Re: [PHP] Using PHP4 or PHP5

2004-10-03 Thread Matthew Fonda
I would say PHP5, for sure. PHP5 is much better in nearly every way, and more and more people are using it every day. Also, for the most part, PHP4 is backwards compatible with PHP5, so it shouldn't be too much of a problem. I would absolutely recommend upgrading to PHP5. -- Regards, Matthew

Re: [PHP] How to install php5 on Fedora Core2

2004-10-03 Thread Matthew Fonda
Howdy, Redhat is notorious for leaving out things, such as apxs. To get php working, you will most likely have to download apache, build it, and install it. Make sure you configure apache with --enable-so. After apache builds, do make install. And then, when configuring php, do ./configure

RE: [PHP] Regular Expression - highlighting

2004-10-03 Thread Michael Sims
Aidan Lister wrote: Hello list, I'm pretty terrible with regular expressions, I was wondering if someone would be able to help me with this http://paste.phpfi.com/31964 The problem is detailed in the above link. Basically I need to match the contents of any HTML tag, except a link. I'm

Re: [PHP] A problem of installation

2004-10-03 Thread Matthew Fonda
Howdy, Redhat is notorious for leaving out things, such as apxs. To get php working, you will most likely have to download apache, build it, and install it. Make sure you configure apache with --enable-so. After apache builds, do make install. And then, when configuring php, do ./configure

Re: [PHP] How to install php5 on Fedora Core2

2004-10-03 Thread Matthew Fonda
Howdy, When you configure, you need to make sure you have --with-ext= or --enable-ext for all the extensions you want to use. If you want all the same extensions from your previous install, you could copy and paste them out of the configuration command of your old phpinfo() page. If you try and

RE: [PHP] Re: set multiple variables

2004-10-03 Thread Matthew Fonda
On Sun, 2004-10-03 at 04:39, Graham Cossey wrote: isn't the || same as ? Or I missed something? No, || is OR, and is AND Check out http://www.php.net/manual/en/language.operators.logical.php -- Regards, Matthew Fonda -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Re: set multiple variables

2004-10-03 Thread argesson
Matthew Fonda wrote: On Sun, 2004-10-03 at 04:39, Graham Cossey wrote: isn't the || same as ? Or I missed something? No, || is OR, and is AND Check out http://www.php.net/manual/en/language.operators.logical.php OK, sorry, my mistake. And thanks. newbie -- PHP General Mailing List

Re: [PHP] Re: set multiple variables

2004-10-03 Thread Daniel Schierbeck
Matthew Fonda wrote: On Sun, 2004-10-03 at 04:39, Graham Cossey wrote: isn't the || same as ? Or I missed something? No, || is OR, and is AND Check out http://www.php.net/manual/en/language.operators.logical.php Wll - sort of. The precedence level can be tricky, sometimes || doesn't

[PHP] HOWTO: Install PHP on Fedora Core / Redhat

2004-10-03 Thread Matthew Fonda
Howdy, I noticed that quite a few people were having a hard time installing PHP on Fedora Core or Redhat, so I put together a little tutorial explaining how to do it. Hope it helps :D http://mfonda.dotgeek.org/fcrh.php -- Regards, Matthew Fonda -- PHP General Mailing List

Re: [PHP] How to install php5 on Fedora Core2

2004-10-03 Thread Teng Wang
Finally I succeeded on the installation. Just manually add all --with-EXTENSIONS and remove all unvailable ones. The procedure is too completed. I hope there should be some scripts which automatically check the availability of each extension and generate the configuration file. Anyway, thanks a

[PHP] Why my browser always chooses UTF-8 charset?

2004-10-03 Thread Teng Wang
Although I have included charset (GB2312) information in my html/php files. meta http-equiv=Content-Type content=text/html; charset=gb2312 And my browser has Auto-select settings. How to make the browser select charset correctly, eruisi

Re: [PHP] Why my browser always chooses UTF-8 charset?

2004-10-03 Thread Robert Cummings
Look for this in your php.ini: default_charset Cheers, Rob. On Sun, 2004-10-03 at 17:56, Teng Wang wrote: Although I have included charset (GB2312) information in my html/php files. meta http-equiv=Content-Type content=text/html; charset=gb2312 And my browser has Auto-select

Re: [PHP] Why my browser always chooses UTF-8 charset?

2004-10-03 Thread Teng Wang
Hi But I still want the default language to be English, I can set a page to be Chinese if I wanna to do so. Is that possible? Why doesn't the meta information work? Teng Wang 2004/10/03

Re: [PHP] Why my browser always chooses UTF-8 charset?

2004-10-03 Thread Thomas Goyne
On Sun, 03 Oct 2004 18:05:32 -0400, Teng Wang [EMAIL PROTECTED] wrote: Hi: But I still want the default language to be English, I can set a page to be Chinese if I wanna to do so. Is that possible? Why doesn't the meta information work? Setting the charset in the html doesn't work very well for

Re: [PHP] How to install php5 on Fedora Core2

2004-10-03 Thread Marek Kilimajer
Teng Wang wrote: Finally I succeeded on the installation. Just manually add all --with-EXTENSIONS and remove all unvailable ones. The procedure is too completed. I hope there should be some scripts which automatically check the availability of each extension and generate the configuration file.

Re: [PHP] Why my browser always chooses UTF-8 charset?

2004-10-03 Thread Marek Kilimajer
Teng Wang wrote: Although I have included charset (GB2312) information in my html/php files. meta http-equiv=Content-Type content=text/html; charset=gb2312 And my browser has Auto-select settings. How to make the browser select charset correctly, W3C: Conforming user agents must observe the

[PHP] PHP4: getting a dom xml node's namespace

2004-10-03 Thread Jachin Rupe
hi there I'm parsing xml documents with php4's DOM extension and I would like to be able to see what namespaces are in the document. Is there any way to get at the xmlns attributes? Or a way to get the namespace of a node (not just the prefix). thanks -jachin -- PHP General Mailing List

Re: [PHP] How to install php5 on Fedora Core2

2004-10-03 Thread Teng Wang
Hi,Marek Kilimajer I had to test each module. That's why I said it's too complicated (sorrry for the typo). Is there any script to test it automatically? Teng Wang 2004/10/03 19:57:23

Re: [PHP] Re: PHP (anti) crash policy?

2004-10-03 Thread David Bevan
On October 3, 2004 12:46, Olaf van der Spek wrote: Manuel Lemos wrote: Hello, On 10/03/2004 12:27 PM, Olaf Van Der Spek wrote: I think that making all failed memory allocations recoverable is not viable because more PHP C code that makes memory allocations assumes it only returns if

[PHP] Re: HOWTO: Install PHP on Fedora Core / Redhat

2004-10-03 Thread John Swartzentruber
On 10/3/2004 4:02 PM Matthew Fonda wrote: Howdy, I noticed that quite a few people were having a hard time installing PHP on Fedora Core or Redhat, so I put together a little tutorial explaining how to do it. Hope it helps :D http://mfonda.dotgeek.org/fcrh.php I'm not complaining about any

[PHP] output a PDF, over header(). causes corruption on the file?

2004-10-03 Thread Louie Miranda
Im trying to output a pdf over a browser so i can hide the url link to it. but this one causes corruption. Try this.. http://dev.axishift.com/php/getpdf.php i got this part.. Note: There is a bug in Microsoft Internet Explorer 4.01 that prevents this from working. There is no workaround. There

[PHP] Downloadcounter

2004-10-03 Thread Simon Fredriksson
I'm writing a file-download system. In order to download, the user will have to login with username and password. Now, how do I feed the file to the user if it's not under htdocs? Or should the files be under htdocs (in subdirs of course) and have some .htaccess limitations? There is a chance

[PHP] Re: output a PDF, over header(). causes corruption on the file?

2004-10-03 Thread Louie Miranda
this is one problem i haven't seen some exact solutions. i tried this instead.. header(Content-type: application/pdf); header(Content-transfer-encoding: binary); header(Content-Disposition: attachment; filename=list.pdf); $fp = fopen($WCFPriceList, rb); fpassthru($fp); and it did work. but im

Re: [PHP] Downloadcounter

2004-10-03 Thread raditha dissanayake
Hi, Simon Fredriksson wrote: I'm writing a file-download system. In order to download, the user will have to login with username and password. Now, how do I feed the file to the user if it's not under htdocs? Or should the files be under htdocs (in subdirs of course) and have some .htaccess

[PHP] Newbie needs help with MySQL and multiple databases

2004-10-03 Thread Matthew
Hi, im fairly new to php and mysql and need a little help. im running a forum community and would like to have it run on multiple databases because of performance issues others have encountered using the same software on on database. My question is is it possible to have the software connect to 2

[PHP] Re: Newbie needs help with MySQL and multiple databases

2004-10-03 Thread M. Sokolewicz
Matthew wrote: Hi, im fairly new to php and mysql and need a little help. im running a forum community and would like to have it run on multiple databases because of performance issues others have encountered using the same software on on database. My question is is it possible to have the