php-general Digest 28 Jan 2002 03:40:38 -0000 Issue 1137

Topics (messages 82288 through 82353):

Re: HOT!!! PHP4.1.x - Step by Step Installation manual
        82288 by: Olexandr Vynnychenko

ereg(i) for form input validation for SQL - tutorial?
        82289 by: Simon H

Re: Memory usage with Apache
        82290 by: Paul A. Procacci

Re: Write to file?
        82291 by: Paul A. Procacci

binary file + fread
        82292 by: Michael Agbaglo
        82294 by: Paul A. Procacci
        82296 by: Michael Agbaglo

fread + binary file
        82293 by: Michael Agbaglo

Re: PHP in the University and Corporation [was RE: [PHP ] Computer Science and PHP]
        82295 by: Chris Lott

Porting from Linux to Windows!?$#
        82297 by: Andre Amaral
        82298 by: Sterling Hughes
        82299 by: Andre Amaral
        82311 by: Michael Sims

Re: CGI vs. ISAPI
        82300 by: Michael Kimsal

a quick question..
        82301 by: Tauntz
        82303 by: Miles Thompson
        82304 by: Edward van Bilderbeek - Bean IT
        82305 by: Nick Wilson
        82307 by: Miles Thompson
        82308 by: Tauntz
        82309 by: Paul A. Procacci
        82310 by: Nick Wilson

undefined symbol: uncompress
        82302 by: David Jackson
        82306 by: Miles Thompson
        82312 by: Michael Sims
        82313 by: David Jackson
        82317 by: Michael Sims
        82325 by: David Jackson
        82331 by: Miles Thompson

Re: set_time_limit() in a loop
        82314 by: Matthew Delmarter

Only one value.
        82315 by: Philip J. Newman
        82318 by: Michael Kimsal
        82319 by: Mark Charette
        82320 by: Michael Kimsal

Session updates ok first time only.
        82316 by: Floyd Baker
        82353 by: Jason Wong

Substitute for getenv() when using ISAPI ??
        82321 by: Christian Blichmann

Upload file to system
        82322 by: Duky Yuen
        82330 by: sundogcurt
        82333 by: Duky Yuen
        82348 by: sundogcurt

phplib
        82323 by: Kunal Jhunjhunwala
        82326 by: Nick Wilson
        82327 by: Kunal Jhunjhunwala

Trying to remove bad charactors.
        82324 by: Philip J. Newman
        82352 by: Jason Wong

MySQL-PHP-RAQ4 dilemma!
        82328 by: Greg Conway
        82329 by: Michael Kimsal

File uploading like hotmail
        82332 by: Duky Yuen

PHP and MYSQL Security`
        82334 by: Duky Yuen
        82338 by: Fred
        82345 by: Brian Clark
        82347 by: Alan McFarlane

Ouch that hurts
        82335 by: Philip J. Newman
        82339 by: Jeff Sheltren

Back button to Query Pages
        82336 by: phantom

Re: [PHP-DB] [PHP] PHP and MYSQL Security`
        82337 by: Miles Thompson
        82343 by: Gurhan Ozen

[PHP-DB] Re: [PHP] PHP and MYSQL Security`
        82340 by: Paul DuBois

PHP SITE ERROR
        82341 by: Philip J. Newman

One error after another.
        82342 by: Philip J. Newman
        82344 by: Jeff Sheltren

install error (NS + PHP + UNIX) !
        82346 by: Sang-Kyu Ahn

Server Communication.
        82349 by: Philip J. Newman
        82351 by: Jason Wong

Is it possible to bypass max time limit?
        82350 by: Alan McFarlane

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 ---
Hello Andre,

Friday, January 25, 2002, 3:16:38 AM, you wrote:

AA> Hi all. Here is my first attempt to make easy Step by Step installation
AA> manual for PHP4.1.x on Windows 2000 based systems running IIS5 using CGI or
AA> ISAPI. Here is the link that will ake a lot of people happy. :)
AA> http://www.experttek.com/php/installation.txt

AA> Fell free to contact me. Contacts are in the manual.

HTTP 404 - File not found

-- 
Best regards,
 Olexandr                            mailto:[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
Does anyone know of a good tutorial for using ereg and eregi to validate
standard fields for SQL input (i'm using PearDB).  Typically the type of
validation that I think I need would be, firstly to detect invalid
characters, or special characters, or things that can screw up the SQL
Query.  Others would be the alpha only, string lengths, email address, dates
and times, phone numbers.

These are standard items in a lot of systems...surely there's a tutorial out
there somewhere, or a sample script or something.  I've only just discovered
regex, so its all a bit hmmmmmmmm at the moment.

Any links for tutorials or sample scripts would be much appreciated.

Thanks

Simon H

--- End Message ---
--- Begin Message ---
How are you executing top?  Sounds like you need to use the -d option for
top.  Example:

$exec - exec("top -d1");

This way, top won't, run and run and run, and run, and run, etc, etc, etc.

Try that

Paul

"Thomas E. Ruth" wrote:

> Hello,
>
> I'm using PHP 4.0.4pl1 with Apache 1.3.14.
>
> I have a PHP script that accumulates data for insertion into a database.
> This script runs in peices and unset()'s variables that contain the data
> periodically in hopes of freeing memory for the next batch of records.
> Apparently it's not working that way. When I run top and run my PHP
> script, the httpd process runs up to 125M of memory usage, and
> segfaults.
>
> Is there a parameter somewhere that says that httpd can't grow to over
> 128M of memory usage, or that PHP can't grow to more then this amount
> that I can change to prevent my web server from crashing? Or perhaps a
> garbage cleanup routine in PHP that actually frees memory that is no
> longer being used (these arrays hold max 5X25 of small <10 char
> strings). I unset these arrays after they are placed in the database
> (and I free the result for the database), but memory just climbs and
> climbs until the script ends (if I run it with arguments that yield
> smaller results).
>
> Thanks,
>
> Tom

--- End Message ---
--- Begin Message ---
Try inserting a "\n" at the end of each string you write.  This is a new-
line character.

Paul

Mårten andersson wrote:

> Hello folks…
>
> I want to write to a textfile, but I want a row for each string I write
> to the file.
> As it is now when I write to the file it just starts writing where the
> last string ends..
>
> What should I do? =)
>
> Thanks! //M.
>
> ------------------------------------------------------------------------
> ----------
> Mårten Andersson
> Loddbygatan 2
> 60218 Norrköping
> Sverige
>
> ICQ: 86515830
> URL: http://www.vanvett.net/marten
>

--- End Message ---
--- Begin Message ---
Hi !

I've some trouble w/ the following peace of code... Althoug the file 
doesn't contain zeros at the beginning the output is
a= 0 b=0

Is there a problem w/ fread ? (php 4.0.6, RedHat 7.2)




<?php
$filename = "/export/html/log";
$fd = fopen( $filename, "r" );
$a = fread( $fd, 4 );
$b = fread( $fd, 4 );
printf( "a= %lx b=%lx", $a, $b);
fclose( $fd );
?>

--- End Message ---
--- Begin Message ---
Try
<?php
$filename = "/export/html/log";
$fd = fopen( $filename, "rb" ); //Notice the "b"
$a = fread( $fd, 4 );
$b = fread( $fd, 4 );
printf( "a= %lx b=%lx", $a, $b);
fclose( $fd );
?>

notice the "b" in the fopen, it stand for binary.

Paul

Michael Agbaglo wrote:

> Hi !
>
> I've some trouble w/ the following peace of code... Althoug the file
> doesn't contain zeros at the beginning the output is
> a= 0 b=0
>
> Is there a problem w/ fread ? (php 4.0.6, RedHat 7.2)
>
> <?php
> $filename = "/export/html/log";
> $fd = fopen( $filename, "r" );
> $a = fread( $fd, 4 );
> $b = fread( $fd, 4 );
> printf( "a= %lx b=%lx", $a, $b);
> fclose( $fd );
> ?>

--- End Message ---
--- Begin Message ---


[...]

> $fd = fopen( $filename, "rb" ); //Notice the "b"
> $a = fread( $fd, 4 );
> $b = fread( $fd, 4 );
> printf( "a= %lx b=%lx", $a, $b);
> fclose( $fd );
> ?>
> 
> notice the "b" in the fopen, it stand for binary.
[...]


I noticed the 'b' like in but - it's also mentioned in the 
documentation, BUT it doesn't seem to work !

--- End Message ---
--- Begin Message ---
Hello !

I've some tourble w/ the following piece of code. The file to read 
doesn't contain zeros at the beginning, but the output is

a= 0 b=0

is there a problem w/ fread ? (php 4.0.6, RedHat 7.2)




<?php
$filename = "/export/html/log";
$fd = fopen( $filename, "r" );
$a = fread( $fd, 4 );
$b = fread( $fd, 4 );
printf( "a= %lx b=%lx", $a, $b);
fclose( $fd );
?>

--- End Message ---
--- Begin Message ---
I agree about going to technical colleges and other areas. In fact, I made
that very point. There is no reason that these kinds of programs even NEED
to be four year degrees.

I don't want to get into a debate about certifications. As one who hires
programmers, I can say this for myself and many others: certification mreans
squat to myself and to most people I know. They have become as devalued as
Argentinian currency :)

On the other hand, the general truth is that certification WILL open doors
in some places, particularly those that are technologically clueless in the
first place. They may or may not be jobs worth having, it may or may not
happen for the job you are pursuing now or the job you might pursue in the
future. 

My real point in all of this is that establishing a LAMP certification, for
instance, or a PHP certification, is no panacea and is no guarantee of
opening any doors, not to mention the possibility of such certifications
becoming a joke as MCSE and other Microsoft Certs (for instance, and a cert
I can speak of with firsthand experience :) have become in many circles and
actually having as much negative impact as positive.

c
--
Chris Lott
http://www.chrislott.org/
--- End Message ---
--- Begin Message ---
Hi all,

I would like to ask my experienced friends here if its possible to port a
script made for linux to run in windows IIS. I've been trying to make linux
scripts run on my server and some of them do and some don't. I also notice
that the problem relies how Linux and Windows refer to firectories.

Linux Ex.
$base_dir = "/home/somescript/"

Windows Ex.
$base_dir = "C:\home\somescript"

Now. My question is... Is there any way to use script made for Linux in
Windows? If YES what have to be done in order to make it to work?

Thank you,
Andre


--- End Message ---
--- Begin Message ---
> Hi all,
> 
> I would like to ask my experienced friends here if its possible to port a
> script made for linux to run in windows IIS. I've been trying to make linux
> scripts run on my server and some of them do and some don't. I also notice
> that the problem relies how Linux and Windows refer to firectories.
> 
> Linux Ex.
> $base_dir = "/home/somescript/"
> 
> Windows Ex.
> $base_dir = "C:\home\somescript"
> 
> Now. My question is... Is there any way to use script made for Linux in
> Windows? If YES what have to be done in order to make it to work?
> 
> Thank you,
> Andre
> 
>
    Well, that depends on the script greatly.  Both Win32 and Linux have
    difference sets of functions, and features.  Issues such as relative
    path's are easy enough to solve, however, it would greatly depend on
    what other features the piece of code use.

    In most cases, it is possible to port a script from Win32 to
    Linux, and vice-versa, with a few hours of hair-pulling and a little
    bit of luck...  But then again, this question depends on the
    application.

    -Sterling


> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
I wish I may, I wish I might, GIMME STUFF! 
http://www.amazon.com/exec/obidos/wishlist/E7I1IWUJDPB4/
:)))
--- End Message ---
--- Begin Message ---
Thank you for the wuick response.
Now. Can I make a script that works in both Linux and Windows without much
headache?


"Sterling Hughes" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi all,
> >
> > I would like to ask my experienced friends here if its possible to port
a
> > script made for linux to run in windows IIS. I've been trying to make
linux
> > scripts run on my server and some of them do and some don't. I also
notice
> > that the problem relies how Linux and Windows refer to firectories.
> >
> > Linux Ex.
> > $base_dir = "/home/somescript/"
> >
> > Windows Ex.
> > $base_dir = "C:\home\somescript"
> >
> > Now. My question is... Is there any way to use script made for Linux in
> > Windows? If YES what have to be done in order to make it to work?
> >
> > Thank you,
> > Andre
> >
> >
>     Well, that depends on the script greatly.  Both Win32 and Linux have
>     difference sets of functions, and features.  Issues such as relative
>     path's are easy enough to solve, however, it would greatly depend on
>     what other features the piece of code use.
>
>     In most cases, it is possible to port a script from Win32 to
>     Linux, and vice-versa, with a few hours of hair-pulling and a little
>     bit of luck...  But then again, this question depends on the
>     application.
>
>     -Sterling
>
>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
> --
> I wish I may, I wish I might, GIMME STUFF!
> http://www.amazon.com/exec/obidos/wishlist/E7I1IWUJDPB4/
> :)))


--- End Message ---
--- Begin Message ---
At 01:02 PM 1/27/2002 -0500, Andre Amaral wrote:
>Thank you for the wuick response.
>Now. Can I make a script that works in both Linux and Windows without much
>headache?

I'm currently working with a few developers to redesign my company's 
website using PHP.  I am developing on a Linux platform while some of the 
other developers are using Windows.  We are using CVS to merge our 
individual changes into one main source tree.

So far this has been working really well.  I've found that it's much easier 
to develop on Linux first and then tweak any oddities on the Windows 
side.  For example, the following is only valid on Windows:

$file = "some\\relative\\path\\filename.ext";

But the following is valid on either platform:

$file = "some/relative/path/filename.ext";

Another example is case sensitivity.  To Windows, "SomePath/filename.ext" 
is the same as "somepath/filename.ext" but not on Linux.  Since Linux is 
the more picky of the two (for good reason) then it's easier to make sure 
the case is correct on the Linux side.  Just be careful and don't create 
"Filename.ext" and "filename.ext" as two different files on the Linux side, 
because Windows obviously won't be able to handle that.

I would say for 95% of basic scripts, you are not going to have any 
troubles.  You could run into problems would be scripts that work with the 
filesystem (for example, umask() doesn't work on Windows).  COM components 
can only be used on Windows, so avoid them if your goal is platform 
independence.  Most DB functions behave exactly the same way, with minor 
differences (for example, mssql_next_result() does not work if you are 
using Linux/FreeTDS but it does on Windows)....etc.  I've found that the 
mail() function works exactly the same on either platform assuming you have 
both servers configured properly.

My best advice is to develop on Linux first, periodically testing your 
scripts on Windows and tweaking the oddities.  It's not too tricky.  Let me 
know if you have questions...

--- End Message ---
--- Begin Message ---
Benjamin Deruyter wrote:

> I'm fairly new to PHP, having worked with ColdFusion in the past.  Can
> somebody shed some light on to the key differences between the CGI
> installation and the ISAPI installation.  I working with IIS on Win2k and
> using MySQL for a db server.  Thanks.
> 
>  - Ben
> 
> 

 From all practical accounts the ISAPI is still not stable under 
Windows.  The claim is that PHP itself is stable, but the majority of 
the DLL files which provide the additional functionality (IMAP, GD, etc) 
are NOT stable (threadsafety I think is the issue) so unless you're 
doing something extremely basic ISAPI may not be the answer.

Only you can tell for certain - set it up on your system and if it 
works, great.  If it starts to crash, don't waste hours or days or weeks 
trying to fix it - it's not your problem.  Just go back to CGI.  If 
you're an experienced C coder under Windows, jump in and try to help 
debug and patch it, otherwise just stick with CGI.

Michael Kimsal
http://www.tapinternet.com/php/
PHP Training Courses
734-480-9961

--- End Message ---
--- Begin Message ---
If I have n variables:
$nr1 = "some text";
$nr2 = "some other text"
$nr3....
....
and I want to print the text "randomly" (like if I enter the page.. it displays 
$nr1... next time it displays $nr 5.. etc)
how can I achieve it ?

[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Try this:

Store variables in an array, say $msg_array. (For those of Hungarian preference, 
$arrMessages.)
$index = rand (0, $n)
echo $msg_array[ $index ]

Now this will require a bit of messing about, seeding the randomizer, etc., but you 
get the idea.

Miles Thompson


On Sunday 27 January 2002 03:00 pm, Tauntz wrote:
> If I have n variables:
> $nr1 = "some text";
> $nr2 = "some other text"
> $nr3....
> ....
> and I want to print the text "randomly" (like if I enter the page.. it
> displays $nr1... next time it displays $nr 5.. etc) how can I achieve it ?
>
> [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Or, if you've already set your massive list of variables...:

$varname = "nr".rand(0, $n);
print ${$varname};

----- Original Message -----
From: "Miles Thompson" <[EMAIL PROTECTED]>
To: "Tauntz" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, January 27, 2002 8:15 PM
Subject: Re: [PHP] a quick question..


> Try this:
>
> Store variables in an array, say $msg_array. (For those of Hungarian
preference, $arrMessages.)
> $index = rand (0, $n)
> echo $msg_array[ $index ]
>
> Now this will require a bit of messing about, seeding the randomizer,
etc., but you get the idea.
>
> Miles Thompson
>
>
> On Sunday 27 January 2002 03:00 pm, Tauntz wrote:
> > If I have n variables:
> > $nr1 = "some text";
> > $nr2 = "some other text"
> > $nr3....
> > ....
> > and I want to print the text "randomly" (like if I enter the page.. it
> > displays $nr1... next time it displays $nr 5.. etc) how can I achieve it
?
> >
> > [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


* and then Tauntz blurted....
> If I have n variables:
> $nr1 = "some text";
> $nr2 = "some other text"
> $nr3....
> ....
> and I want to print the text "randomly" (like if I enter the page.. it displays 
>$nr1... next time it displays $nr 5.. etc)
> how can I achieve it ?


Pop them all into an array and use array_rand()
See manual for details.

HTH
- -- 

Nick Wilson

Tel:    +45 3325 0688
Fax:    +45 3325 0677
Web:    www.explodingnet.com



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8VFSFHpvrrTa6L5oRAg7iAKCAvzPSf8E5LGXOF5AjYEhwJXmqrQCfVWYE
ycfLyu31AB+QDQmkcKaJKe0=
=pkfe
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
Even better!
mt

On Sunday 27 January 2002 03:27 pm, you wrote:
> * and then Tauntz blurted....
>
> > If I have n variables:
> > $nr1 = "some text";
> > $nr2 = "some other text"
> > $nr3....
> > ....
> > and I want to print the text "randomly" (like if I enter the page.. it
> > displays $nr1... next time it displays $nr 5.. etc) how can I achieve it
> > ?
>
> Pop them all into an array and use array_rand()
> See manual for details.
>
> HTH
--- End Message ---
--- Begin Message ---
Thank you, it worked :)


----- Original Message -----
From: "Nick Wilson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 27, 2002 9:27 PM
Subject: Re: [PHP] a quick question..


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> * and then Tauntz blurted....
> > If I have n variables:
> > $nr1 = "some text";
> > $nr2 = "some other text"
> > $nr3....
> > ....
> > and I want to print the text "randomly" (like if I enter the page.. it
displays $nr1... next time it displays $nr 5.. etc)
> > how can I achieve it ?
>
>
> Pop them all into an array and use array_rand()
> See manual for details.
>
> HTH
> - --
>
> Nick Wilson
>
> Tel: +45 3325 0688
> Fax: +45 3325 0677
> Web: www.explodingnet.com
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD8DBQE8VFSFHpvrrTa6L5oRAg7iAKCAvzPSf8E5LGXOF5AjYEhwJXmqrQCfVWYE
> ycfLyu31AB+QDQmkcKaJKe0=
> =pkfe
> -----END PGP SIGNATURE-----
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>

--- End Message ---
--- Begin Message ---
He meant push

Nick Wilson wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> * and then Tauntz blurted....
> > If I have n variables:
> > $nr1 = "some text";
> > $nr2 = "some other text"
> > $nr3....
> > ....
> > and I want to print the text "randomly" (like if I enter the page.. it displays 
>$nr1... next time it displays $nr 5.. etc)
> > how can I achieve it ?
>
> Pop them all into an array and use array_rand()
> See manual for details.
>
> HTH
> - --
>
> Nick Wilson
>
> Tel:    +45 3325 0688
> Fax:    +45 3325 0677
> Web:    www.explodingnet.com
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD8DBQE8VFSFHpvrrTa6L5oRAg7iAKCAvzPSf8E5LGXOF5AjYEhwJXmqrQCfVWYE
> ycfLyu31AB+QDQmkcKaJKe0=
> =pkfe
> -----END PGP SIGNATURE-----

--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


* and then Paul A. Procacci blurted....
> He meant push

Hehe, I didn't think of that. Actually I didn't mean push /or/ pop in
the array sense of the word, I meant *put* as in create!
I'll take more care in future :-)
- -- 

Nick Wilson

Tel:    +45 3325 0688
Fax:    +45 3325 0677
Web:    www.explodingnet.com



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8VFjiHpvrrTa6L5oRAjIyAJ0bT5tu/fwjSzyNgcpy1EcVk3yjlACfe3KK
ETC08e6y2v6ePJPj8JRgBkg=
=PNvr
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
I've seen similar question in the archive, but here it goes?
Setup: Slackware-8.0, Apache-1.3.23, mysql-3.23.47-pc-linux-gnu-i686
Config options:
Apache: ./configure --prefix=/usr/local/www --with-modules=most
compiles and run fine.

MySQl from binaires run fine into /usr/local/mysql (set ld.so.conf to
correct value).

PHP-4.1.1: ./configure --with-apxs=/usr/local/www/bin/apxs
--with-mysql=/usr/local/mysql
cp php-ini-recommanded /usr/local/lib/php.ini
Added AddType statement to httpd.conf


Results in following error when I try to start Apache:

Syntax error on line 236 of /usr/local/www/conf/httpd.conf:
Cannot load /usr/local/www/libexec/libphp4.so into server:
/usr/local/www/libexec/libphp4.so: undefined symbol: uncompress

Line 236 of http.conf:
LoadModule php4_module        libexec/libphp4.so


Thanks for you help.
David Jackson
--- End Message ---
--- Begin Message ---

Add the path to libphp4.so to the file /etc/ld.conf.so  
and run ldconfig

or

copy libphp4.so to the libexec directory found beneath the main apach directory. 
It's most likely in the libs directory of your php source directory.

The second way is probably the best.

HTH - Miles Thompson


On Sunday 27 January 2002 03:11 pm, David Jackson wrote:
> I've seen similar question in the archive, but here it goes?
> Setup: Slackware-8.0, Apache-1.3.23, mysql-3.23.47-pc-linux-gnu-i686
> Config options:
> Apache: ./configure --prefix=/usr/local/www --with-modules=most
> compiles and run fine.
>
> MySQl from binaires run fine into /usr/local/mysql (set ld.so.conf to
> correct value).
>
> PHP-4.1.1: ./configure --with-apxs=/usr/local/www/bin/apxs
> --with-mysql=/usr/local/mysql
> cp php-ini-recommanded /usr/local/lib/php.ini
> Added AddType statement to httpd.conf
>
>
> Results in following error when I try to start Apache:
>
> Syntax error on line 236 of /usr/local/www/conf/httpd.conf:
> Cannot load /usr/local/www/libexec/libphp4.so into server:
> /usr/local/www/libexec/libphp4.so: undefined symbol: uncompress
>
> Line 236 of http.conf:
> LoadModule php4_module        libexec/libphp4.so
>
>
> Thanks for you help.
> David Jackson
--- End Message ---
--- Begin Message ---
At 12:11 PM 1/27/2002 -0700, David Jackson wrote:
>I've seen similar question in the archive, but here it goes?
>Setup: Slackware-8.0, Apache-1.3.23, mysql-3.23.47-pc-linux-gnu-i686
[...]
>Config options:
>Syntax error on line 236 of /usr/local/www/conf/httpd.conf:
>Cannot load /usr/local/www/libexec/libphp4.so into server:
>/usr/local/www/libexec/libphp4.so: undefined symbol: uncompress

I had this problem on RedHat 7.2.  Turns out I needed zlib support 
(libz.so).  Not sure how to do it on Slackware, but on RedHat 7.2 you need 
two RPMs, both zlib-1.1.3-24 and zlib-devel-1.1.3-24.  After I installed 
these RPMs I had to do a make clean, rm config.cache, and then configure 
again adding "--with-zlib" to the configure command.

(I saw some saying that you needed to add "-ld" to the LTLIBRARY_LDFLAGS 
line in the top level Makefile but this did not work for me.)

To be honest, I have no idea why any of this was needed, I got all this 
info from various sources on Google Groups.  But it worked for me.  Maybe 
this can point you in the right direction...

--- End Message ---
--- Begin Message ---
Mike --
Thanks for you reply, I made the changes an am stilling getting the same
error?
On the other hand if I compile PHP with out specifing mysql home. I
don't get the error.

David Jackson

Miles Thompson wrote:
> 
> Add the path to libphp4.so to the file /etc/ld.conf.so
> and run ldconfig
> 
> or
> 
> copy libphp4.so to the libexec directory found beneath the main apach directory.
> It's most likely in the libs directory of your php source directory.
> 
> The second way is probably the best.
> 
> HTH - Miles Thompson
> 
> On Sunday 27 January 2002 03:11 pm, David Jackson wrote:
> > I've seen similar question in the archive, but here it goes?
> > Setup: Slackware-8.0, Apache-1.3.23, mysql-3.23.47-pc-linux-gnu-i686
> > Config options:
> > Apache: ./configure --prefix=/usr/local/www --with-modules=most
> > compiles and run fine.
> >
> > MySQl from binaires run fine into /usr/local/mysql (set ld.so.conf to
> > correct value).
> >
> > PHP-4.1.1: ./configure --with-apxs=/usr/local/www/bin/apxs
> > --with-mysql=/usr/local/mysql
> > cp php-ini-recommanded /usr/local/lib/php.ini
> > Added AddType statement to httpd.conf
> >
> >
> > Results in following error when I try to start Apache:
> >
> > Syntax error on line 236 of /usr/local/www/conf/httpd.conf:
> > Cannot load /usr/local/www/libexec/libphp4.so into server:
> > /usr/local/www/libexec/libphp4.so: undefined symbol: uncompress
> >
> > Line 236 of http.conf:
> > LoadModule php4_module        libexec/libphp4.so
> >
> >
> > Thanks for you help.
> > David Jackson
--- End Message ---
--- Begin Message ---
At 12:50 PM 1/27/2002 -0700, David Jackson wrote:
>Mike --
>Thanks for you reply, I made the changes an am stilling getting the same
>error?
>On the other hand if I compile PHP with out specifing mysql home. I
>don't get the error.

Check and see which directory libmysqlclient.so is in, and make sure that 
directory is listed in /etc/ld.so.conf and rerun ldconfig.  Then try to 
start the server.

--- End Message ---
--- Begin Message ---
Micheal --
Thanks for your replys.
What I see in /usr/local/mysql/lib is:

libmysqlclient.a 

I'm wondering if the MySQL binaaries use static libs?



Thanks, 
David


Michael Sims wrote:
> 
> At 12:50 PM 1/27/2002 -0700, David Jackson wrote:
> >Mike --
> >Thanks for you reply, I made the changes an am stilling getting the same
> >error?
> >On the other hand if I compile PHP with out specifing mysql home. I
> >don't get the error.
> 
> Check and see which directory libmysqlclient.so is in, and make sure that
> directory is listed in /etc/ld.so.conf and rerun ldconfig.  Then try to
> start the server.
--- End Message ---
--- Begin Message ---

Try it t wo ways ...
1. w/o the with-mysql, run a script containing phpinfo() and see what it returns. 
MySQL support is compiled in by default to a default location.

2. Check that the with-mysql parameter is correct. On one system I had a path that was 
/usr/local/mysql/bin/mysql
and yes, that fina lmysql was a directory. It caused so me problems.

It would help if the error messages were clearer, but they're still better than Winows 
GPF's.

Miles Thompson

On Sunday 27 January 2002 03:50 pm, David Jackson wrote:
> Mike --
> Thanks for you reply, I made the changes an am stilling getting the same
> error?
> On the other hand if I compile PHP with out specifing mysql home. I
> don't get the error.
>
> David Jackson
>
> Miles Thompson wrote:
> > Add the path to libphp4.so to the file /etc/ld.conf.so
> > and run ldconfig
> >
> > or
> >
> > copy libphp4.so to the libexec directory found beneath the main apach
> > directory. It's most likely in the libs directory of your php source
> > directory.
> >
> > The second way is probably the best.
> >
> > HTH - Miles Thompson
> >
> > On Sunday 27 January 2002 03:11 pm, David Jackson wrote:
> > > I've seen similar question in the archive, but here it goes?
> > > Setup: Slackware-8.0, Apache-1.3.23, mysql-3.23.47-pc-linux-gnu-i686
> > > Config options:
> > > Apache: ./configure --prefix=/usr/local/www --with-modules=most
> > > compiles and run fine.
> > >
> > > MySQl from binaires run fine into /usr/local/mysql (set ld.so.conf to
> > > correct value).
> > >
> > > PHP-4.1.1: ./configure --with-apxs=/usr/local/www/bin/apxs
> > > --with-mysql=/usr/local/mysql
> > > cp php-ini-recommanded /usr/local/lib/php.ini
> > > Added AddType statement to httpd.conf
> > >
> > >
> > > Results in following error when I try to start Apache:
> > >
> > > Syntax error on line 236 of /usr/local/www/conf/httpd.conf:
> > > Cannot load /usr/local/www/libexec/libphp4.so into server:
> > > /usr/local/www/libexec/libphp4.so: undefined symbol: uncompress
> > >
> > > Line 236 of http.conf:
> > > LoadModule php4_module        libexec/libphp4.so
> > >
> > >
> > > Thanks for you help.
> > > David Jackson
--- End Message ---
--- Begin Message ---
Thanks for your reply Paul.

The script is getting subscriber details from a database and then
firing our personalised emails in HTML and text format. The while
statement loops through the query results and fires out the emails
using the mail() command.

It works well so far and indeed does finish the loop OK - but as
mentioned the script is still running 13 hours later. I don't get it.

Any ideas? Is it possible to kill a script via PHP code?

Matthew

PS Here is the script again

<?
 ignore_user_abort(true);
 set_time_limit(1800);
 while:
        personalise the message;
          mail();
        set_time_limit(1800);
 endwhile;
?>

-----Original Message-----
From: Paul Roberts [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 27, 2002 12:08 AM
To: Matthew Delmarter
Cc: PHP Mailing List
Subject: Re: [PHP] set_time_limit() in a loop


what are you doing a while on

if while never ends and you reset the time out each loop and use
ignore_user_abort(true), it will still be going 13 hours latter.

maybe if you send the full code so we can look at it.

Paul Roberts
[EMAIL PROTECTED]
++++++++++++++++++++++++
----- Original Message -----
From: "Matthew Delmarter" <[EMAIL PROTECTED]>
To: "Martin Towell" <[EMAIL PROTECTED]>
Cc: "PHP Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, January 25, 2002 12:55 AM
Subject: RE: [PHP] set_time_limit() in a loop


> I should also mention that the loop is sending mail using mail().
>
> Is it possible that this is the problem somehow?
>
> -----Original Message-----
> From: Martin Towell [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 25, 2002 1:16 PM
> To: 'Matthew Delmarter'; PHP Mailing List
> Subject: RE: [PHP] set_time_limit() in a loop
>
> your first thought was correct - it sets it to 1800, it's NOT
> accumulative.
>
> it would have something to do with  ignore_user_abort(true); and
also
> is your while loop's exit check working?
>
> Martin
>
>
> -----Original Message-----
>
> Just wondering about set_time_limit() in a loop.
>
> The current code looks something like this:
>
> <?
>  ignore_user_abort(true);
>  set_time_limit(1800);
>  while:
>         do stuff;
>         set_time_limit(1800);
>  endwhile;
> ?>
>
> Does this reset the timeout to 1800 seconds every time it loops? Or
> does it accumulate so that the timeout has 1800 seconds added to it
> every time?
>
> The reason I ask is that my ISP informs me that the script is still
> running 13 hours later! Or is this related to the ignore_user_abort?
>
> Regards,
> Matthew Delmarter
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
[EMAIL PROTECTED]
>
>
>


--- End Message ---
--- Begin Message ---
Don't know is this is a Mysql problem or PHP, but I have a table with 100 records in 
it.  One of the field names is $iName.

When listing all the records I want only the 1st Uneak value to be displayed. 

For excample

if values where, Bob, Jan, Mike, James, Bob, James, James, Mike ...

I would like to call: Bob, Jan, Mike, James ... Any Idenas

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012
--- End Message ---
--- Begin Message ---
Philip J. Newman wrote:

> Don't know is this is a Mysql problem or PHP, but I have a table with 100 records in 
>it.  One of the field names is $iName.
> 
> When listing all the records I want only the 1st Uneak value to be displayed. 
> 
> For excample
> 
> if values where, Bob, Jan, Mike, James, Bob, James, James, Mike ...
> 
> I would like to call: Bob, Jan, Mike, James ... Any Idenas
> 


I suspect you mean the mysql field name is 'iName', not '$iname' ($iName 
being the PHP variable name).

try

select distinct(iName) from tablename

and loop through those result sets.



Michael Kimsal
http://www.tapinternet.com/php/
PHP Training Courses
734-480-9961

--- End Message ---
--- Begin Message ---
From: "Michael Kimsal" <[EMAIL PROTECTED]>

> Philip J. Newman wrote:
>
> > Don't know is this is a Mysql problem or PHP, but I have a table with
100 records in it.  One of the field names is $iName.
> >
> > When listing all the records I want only the 1st Uneak value to be
displayed.
> >
> > For excample
> >
> > if values where, Bob, Jan, Mike, James, Bob, James, James, Mike ...
> >
> > I would like to call: Bob, Jan, Mike, James ... Any Idenas
> >
>
>
> I suspect you mean the mysql field name is 'iName', not '$iname' ($iName
> being the PHP variable name).
>
> try
>
> select distinct(iName) from tablename
>
> and loop through those result sets.

Almost right. DISTINCT is not a SQL function:

select distinct iName from tablename

would be the correct syntax.



--- End Message ---
--- Begin Message ---
Mark Charette wrote:


>>
> 
> Almost right. DISTINCT is not a SQL function:
> 
> select distinct iName from tablename
> 
> would be the correct syntax.
> 
> 


Seems to work fine on every version of MySQL I've used for the past few 
years, and I believe SQL Server 6.5 and 7, if memory serves correct.



--- End Message ---
--- Begin Message ---


Can someone tell me why this is not working right?  Two pages are
basically the same, passing an accumulating value back and forth.
There is no other session being created.  The first time it increments
and passes to the second page, and is picked up.  It puts a 1 in the
session file.  After that, it seems to try, as in editor wanting to
reload, but the contents don't increase beyond 1.        
 
I have 4.1, register globals off, on Windows 98.

TIA


session_start(); 

print "<html>";
print "<body>";

// determine session id
$session = $_REQUEST['session'];
if ($session == ''){
    $session = session_id();}

print "SESSION = $session";

// create a registered variable.
session_register('page_views');


//pull value from session file:
$page_views = $_SESSION['page_views'];

print "<br>Send Page";
print "<br>Before increment = $page_views";

$page_views++;

print "<br>After increment = $page_views";

// go to next page with session id:
print "<FORM ACTION='sess_return.php3' METHOD='post'>";
print "<INPUT TYPE=hidden NAME='session' VALUE=$session>";
print "<INPUT TYPE=submit  VALUE=Submit> < or > <INPUT TYPE=reset
VALUE=Clear></form>";
?>
</body>
</html>



session_start();  

print "<html>";
print "<head>";
print "</head>";
print "<body>";

//determine a session id:
$session = $_REQUEST['session'];
if ($session == ''){
    $session = session_id();
}
print "SESSION = $session";

// create a registered variable.  
// alredy done.
//session_register('page_views'); 

//pull a value from the session file:
$page_views = $_SESSION['page_views'];

print "<br>Return Page";
print "<br>Before increment = $page_views";

//increment the counter:
$page_views++;
$page_views++;

print "<br>After increment = $page_views";

//going to next page with session id:
print "<FORM ACTION='sess_send.php3' METHOD='post'>";
print "<INPUT TYPE=hidden NAME='session' VALUE=$session>";
print "<INPUT TYPE=submit  VALUE=Submit> < or > <INPUT TYPE=reset
VALUE=Clear></form>";

?>
</body>
</html>



php.ini  

[Session]
session.save_handler = files
session.save_path = c:/tmp
session.use_cookies = 
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_maxlifetime = 1440
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 1
url_rewriter.tags =
"a=href,area=href,frame=src,input=src,form=fakeentry"

--

--- End Message ---
--- Begin Message ---
On Monday 28 January 2002 04:37, Floyd Baker wrote:
> Can someone tell me why this is not working right?  Two pages are
> basically the same, passing an accumulating value back and forth.
> There is no other session being created.  The first time it increments
> and passes to the second page, and is picked up.  It puts a 1 in the
> session file.  After that, it seems to try, as in editor wanting to
> reload, but the contents don't increase beyond 1.
>
> I have 4.1, register globals off, on Windows 98.
>
> TIA




> //pull value from session file:
> $page_views = $_SESSION['page_views'];

No need for this, in fact this is what is preventing it from working! Once 
you've used session_register('var'), $var is available for use.



> print "<br>Return Page";
> print "<br>Before increment = $page_views";
>
> //increment the counter:
> $page_views++;
> $page_views++;

You're inc'ing $page_views twice, this is what makes you *think* the session 
is working when in fact it isn't!

hth
-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
On the road, ZIPPY is a pinhead without a purpose, but never without a POINT.
*/
--- End Message ---
--- Begin Message ---
Hi there!
Sorry for posting this again, but I got no
answers...
Does anybody know a replacement for the
built-in getenv()-function, since according
to the manual it's not supported, when
running as an ISAPI-module under Internet
Information Server 5.0 on Windows 2k
Professional.
I've created a small counter that looks up the
user's IP in a database in order to prevent
duplicate hits when user is reloding the page
and to track how many users are "currently
online".

Suggestions welcome....

BTW, this is the code I'm using now
(temporarily running the CGI version):

=== CUT HERE ===
   // ...
   // Get user's IP and user agent (-->>> problem arises here <<<--)
   $ip = ip2long(($tmp = getenv("HTTP_X_FORWARD_FOR")) ? $tmp :
getenv("REMOTE_ADDR"));

   // -->>> and here <<<--
   $useragent = getenv("HTTP_USER_AGENT");

   // Check if visit already counted
   $id = 0;
   $counted = false;
   $r = mysql_query("SELECT visitor.id, visitor.ip, visitor.useragent,
visits.timestamp FROM visitor, visits WHERE visitor.id = visits.visitor_id
ORDER BY visitor.id DESC");
   // ...
=== CUT HERE ===

Christian Blichmann

_____________________________________________
don't hesitate - email me with your thoughts:
e-mail: [EMAIL PROTECTED]
 - please remove the ".nospam" from address.
_____________________________________________
do you want to know more?
web:    http://www.blichmann.de


--- End Message ---
--- Begin Message ---
I want to make something like when you are attaching something to an
email in hotmail. I want to make something that searches your own
computer for files on your harddisk that you want to upload to the
server.

But I don't know if this is possible. If this is possible.Can somebody
tell me which function I should use? Or if someone have an example...
please...

Duky

--- End Message ---
--- Begin Message ---
http://www.php.net/manual/en/features.file-upload.php
http://www.faqts.com/knowledge_base/view.phtml/aid/988

: )

[EMAIL PROTECTED] wrote:

>I want to make something like when you are attaching something to an
>email in hotmail. I want to make something that searches your own
>computer for files on your harddisk that you want to upload to the
>server.
>
>But I don't know if this is possible. If this is possible.Can somebody
>tell me which function I should use? Or if someone have an example...
>please...
>
>Duky
>
>


--- End Message ---
--- Begin Message ---
Thnx. it's working now. But.. Howcome I can only upload files no bigger
then 100 kb? I have changed the MAX_FILE_SIZE to 1000000000. Also, I can't
change the php.ini, coz the webserver isn't mine.. what to do now??

Sundogcurt wrote:

> http://www.php.net/manual/en/features.file-upload.php
> http://www.faqts.com/knowledge_base/view.phtml/aid/988
>
> : )
>
> [EMAIL PROTECTED] wrote:
>
> >I want to make something like when you are attaching something to an
> >email in hotmail. I want to make something that searches your own
> >computer for files on your harddisk that you want to upload to the
> >server.
> >
> >But I don't know if this is possible. If this is possible.Can somebody
> >tell me which function I should use? Or if someone have an example...
> >please...
> >
> >Duky
> >
> >

--- End Message ---
--- Begin Message ---
You could try contacting your server admin and seeing if he / she will 
increase the limit...

That would be where I would start.
If  that doesn't work, my hosting fees are quite reasonable  ahah



[EMAIL PROTECTED] wrote:

>Thnx. it's working now. But.. Howcome I can only upload files no bigger
>then 100 kb? I have changed the MAX_FILE_SIZE to 1000000000. Also, I can't
>change the php.ini, coz the webserver isn't mine.. what to do now??
>
>Sundogcurt wrote:
>
>>http://www.php.net/manual/en/features.file-upload.php
>>http://www.faqts.com/knowledge_base/view.phtml/aid/988
>>
>>: )
>>
>>[EMAIL PROTECTED] wrote:
>>
>>>I want to make something like when you are attaching something to an
>>>email in hotmail. I want to make something that searches your own
>>>computer for files on your harddisk that you want to upload to the
>>>server.
>>>
>>>But I don't know if this is possible. If this is possible.Can somebody
>>>tell me which function I should use? Or if someone have an example...
>>>please...
>>>
>>>Duky
>>>
>>>
>
>

--- End Message ---
--- Begin Message ---
hey...
i was wondering, is there any way to check wether the replacing of a
variable failed or no? example :
{one}

$t->set_var("one", "1");

I want to know wether one was replaced by 1.. or wether the term "one"
exists at all in the template.. any ideas on how to find this out?

Regards,
Kunal Jhunjhunwala

--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


* and then Kunal Jhunjhunwala blurted....
> hey...
> i was wondering, is there any way to check wether the replacing of a
> variable failed or no? example :
> {one}
> 
> $t->set_var("one", "1");
> 
> I want to know wether one was replaced by 1.. or wether the term "one"
> exists at all in the template.. any ideas on how to find this out?

No. Not AFAIK
What are the circumstances Kunal?

- -- 

Nick Wilson

Tel:    +45 3325 0688
Fax:    +45 3325 0677
Web:    www.explodingnet.com



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8VH7vHpvrrTa6L5oRAttnAJ0cE6ispcu22bd+mnnuN8PEljOx+QCfUKvE
69/xTQAg2jM28XU2rglVFtQ=
=EUJK
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
Well, when giving the flexibility to the user to change the look of a
program, it is impossible to track wether the user leaves your program copy
right code in the template... so, if the {copyright} variable doesnt exist,
just display the copy right info.. if {copyright} exists, replace it...
simple...

Regards,
Kunal Jhunjhunwala
----- Original Message -----
From: "Nick Wilson" <[EMAIL PROTECTED]>
To: "php-list" <[EMAIL PROTECTED]>
Sent: Monday, January 28, 2002 3:57 AM
Subject: Re: [PHP] phplib


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> * and then Kunal Jhunjhunwala blurted....
> > hey...
> > i was wondering, is there any way to check wether the replacing of a
> > variable failed or no? example :
> > {one}
> >
> > $t->set_var("one", "1");
> >
> > I want to know wether one was replaced by 1.. or wether the term "one"
> > exists at all in the template.. any ideas on how to find this out?
>
> No. Not AFAIK
> What are the circumstances Kunal?
>
> - --
>
> Nick Wilson
>
> Tel: +45 3325 0688
> Fax: +45 3325 0677
> Web: www.explodingnet.com
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD8DBQE8VH7vHpvrrTa6L5oRAttnAJ0cE6ispcu22bd+mnnuN8PEljOx+QCfUKvE
> 69/xTQAg2jM28XU2rglVFtQ=
> =EUJK
> -----END PGP SIGNATURE-----
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
>

--- End Message ---
--- Begin Message ---
I'm trying to replace !@#$%^&*() with nothing how ever every thing that I try it takes 
out the space too which is bad. Siggestions

$q=preg replace("!","",$q);

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012
--- End Message ---
--- Begin Message ---
On Monday 28 January 2002 06:24, Philip J. Newman wrote:
> I'm trying to replace !@#$%^&*() with nothing how ever every thing that I
> try it takes out the space too which is bad. Siggestions
>
> $q=preg replace("!","",$q);


Use str_replace(). Only use preg() and friends *IF* you need to search for 
regular expressions.


  $q = str_replace(array('!', '@', '#'), '', $q);


Also, please do not cross-post.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Slow day.  Practice crawling.
*/
--- End Message ---
--- Begin Message ---
Hi all,
 
I'm trying to add MySQL to my RaQ4. It came 
by default with PHP4 but no MySQL.      

I've installed all 4 RPMs (including the developer part and 
everything) of the latest version, and MySQL is working fine. 
I've got DbTools (fantastic!) to interact with it, no probs.

However, I have reason to believe that PHP has been compiled 
without MySQL support. Namely 'cause phpMyAdmin doesn't work and 
I'm clutching at the only thing on the install list that I didn't 
do myself (ie php4 was pre-installed and is built into the GUI, 
unlike my RaQ3 where I added it in).

When I first started tinkering around with adding PHP4 to my 
other RaQ3, I remember using tarballs with switches to ensure 
MySQL support was installed.

So, my question is, how can I tell if PHP has been compiled with 
MySQL support or not, and if not, how can I add it in without 
breaking whatever's already there!! I presume PHP will be an RPM 
(or even a .PKG?), so can I specify these options within RPM installation?

Many thanks for any help.

Regards,

Greg Conway.

 --
+-----------------------------------+
|  Greg Conway, Technical Director  |     
|    GML Networking Technologies    |
+-----------------------------------+
 Email/MSN:    mailto:[EMAIL PROTECTED]
 ICQ#:                     100219981
 mobile tel.:   +44 (0) 7974 666 967
 mobile fax:    +44 (0) 7970 087 935
 Internet:      http://www.gmlnt.com
 office tel.:   +44 (0) 1255 672 103
 office fax:    +44 (0) 1255 679 909
+-----------------------------------+
| GMLNT ** Sensible Smart Solutions |
+-----------------------------------+
***********************************************************************
This is a confidential communication between sender and addressee. If you are not the 
intended recipient of this message, please notify the sender and do not read, copy, 
use or disclose this communication to others. Any opinions or views expressed are 
those of the individual, and unless otherwise stated, are not those of the company. 
All attachments and intellectual rights remain the property of GML (NT) Limited.
***********************************************************************
--- End Message ---
--- Begin Message ---
Greg Conway wrote:

> Hi all,
<snip>
> So, my question is, how can I tell if PHP has been compiled with 
> MySQL support or not, and if not, how can I add it in without 
> breaking whatever's already there!! I presume PHP will be an RPM 
> (or even a .PKG?), so can I specify these options within RPM installation?
> 
> Many thanks for any help.
> 
> Regards,
> 
> Greg Conway.
> 


make a page with

<? echo phpinfo(); ?>

That'll give you the PHP internal information and you can see pretty 
quickly what's 'in' and what's 'not in'.

Michael Kimsal
http://www.tapinternet.com/php
PHP Training Courses
734-480-9961





--- End Message ---
--- Begin Message ---
I want to make something like when you are attaching something to an
email in hotmail. I want to make something that searches your own
computer for files on your harddisk that you want to upload to the
server.

But I don't know if this is possible. If this is possible.Can somebody
tell me which function I should use? Or if someone have an example...
please...

Duky

--- End Message ---
--- Begin Message ---
How can I secure my username and password? In 1 of my files, it contains
the following:

    $conn = mysql_connect( "12.34.56.78", "username", "password");
    mysql_select_db("database",$conn);

What should I do, so people can't get this information?

Duky

--- End Message ---
--- Begin Message ---
If this file has a .php extension remote users will not have access to the
variables because the file is parsed by php and they never see the actual
file contents when requesting the document via the web.  If you are
concerned with users on localhost having access to the file, simply give it
the correct permissions so that no one else has read access.

If you are concerned about web users having access, if, for example, the php
parser crashed and apache tried to pass the file through without parsing,
you can put the default server, user and pass variables in the php.ini file
which is not in the document root for apache.  Of course, this only works if
all of your scripts use the same server, user and password.

Fred

Duky Yuen <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> How can I secure my username and password? In 1 of my files, it contains
> the following:
>
>     $conn = mysql_connect( "12.34.56.78", "username", "password");
>     mysql_select_db("database",$conn);
>
> What should I do, so people can't get this information?
>
> Duky
>


--- End Message ---
--- Begin Message ---
* Miles Thompson ([EMAIL PROTECTED]) [Jan 27. 2002 19:55]:

Hi Miles,

[...]

> $hostname = "12.34.56.78";
> $user = "username";
> $password = "password";
> $dbname = "database";

> and change your connection string as follows:
>      include 'params.inc';
>     //maybe some other stuff her
>     $conn = mysql_connect( '$hostname', '$user', '$password');
>     mysql_select_db('$dbname',$conn) or die( mysql_errno()." : 
> ".mysql_error());

Careful there.

'$hostname', '$user', '$password', and '$dbname' aren't interpolated.
They're literally taken as the string $hostname, etc.

Leave off the 's or surround the variables in double quotes. But you
know that. ;-D

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Always proofread carefully to see if you

--- End Message ---
--- Begin Message ---
If you know you are running on an apache server, you could try using a
simple .htaccess file in a (say) etc directory which contains any or all
files you wish to secure.

ie:

/index.php
/etc/config.php
/etc/.htaccess

--index.php--------
<?php
include("etc/config.php");
...
?>

--etc/config.php--------
$config['db_host']="sql";
$config['db_name']="root";
$config['db_pass']="hooray";
?>

--etc/.htaccess--------
deny from all


And that's it!


Duky Yuen <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> How can I secure my username and password? In 1 of my files, it contains
> the following:
>
>     $conn = mysql_connect( "12.34.56.78", "username", "password");
>     mysql_select_db("database",$conn);
>
> What should I do, so people can't get this information?
>
> Duky
>


--- End Message ---
--- Begin Message ---
Warning: open(/tmp\sess_00fe5002ea636ad76223e15f3841da02, O_RDWR) failed: m (2) in 
d:\website\index.php on line 2

What dose this mean?

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012
--- End Message ---
--- Begin Message ---
It seems that you are running the script on a windows machine... Yet, I 
think that your php.ini must be trying to store session files in /tmp 
(which does not exist on windows).  Perhaps if you change the session path 
in the php.ini file it will fix the problem...

Jeff

At 01:50 PM 1/28/2002 +1300, Philip J. Newman wrote:
>Warning: open(/tmp\sess_00fe5002ea636ad76223e15f3841da02, O_RDWR) failed: 
>m (2) in d:\website\index.php on line 2
>
>What dose this mean?
>
>Philip J. Newman
>Philip's Domain - Internet Project.
>http://www.philipsdomain.com/
>[EMAIL PROTECTED]
>Phone: +64 25 6144012


--- End Message ---
--- Begin Message ---
Page 1 is a list of people's names (queried by State).

Page 2 is each person's profile.

When I hit the back button on Page 2 it tells me it has to requery the
List on Page 1 (apparently not stored in the client's browser cache).
Is there anyway to make it use the cached copy instead of requeurying
the database?  I know using Active Server Pages you could do this.

--- End Message ---
--- Begin Message ---

For a start, please don't cross-post.

Secondly, people don't see these files because the PHP engine parses them. 
However, you could remove each of the parameters to an include file outside 
the web tree and have PHP read it.

Set the include_path in php.ini

Thus in a file named parameters.inc you can have these lines:

$hostname = "12.34.56.78";
$user = "username";
$password = "password";
$dbname = "database";

and change your connection string as follows:
      include 'params.inc';
     //maybe some other stuff her
     $conn = mysql_connect( '$hostname', '$user', '$password');
     mysql_select_db('$dbname',$conn) or die( mysql_errno()." : 
".mysql_error());

There has been a lot of discussion on this topic, even within the past ten 
days, so a search of the archives will give you the full discussion.

Regards - Miles Thompson

At 01:37 AM 1/28/2002 +0100, Duky Yuen wrote:
>How can I secure my username and password? In 1 of my files, it contains
>the following:
>
>     $conn = mysql_connect( "12.34.56.78", "username", "password");
>     mysql_select_db("database",$conn);
>
>What should I do, so people can't get this information?
>
>Duky
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
The actual content of the .php files won't be seen from the net since it is
server side scripting language.. But if you are still concerned you can put
database connection info into another file (preferably .php file) and place
it somewhere outside your web directory and access it thru require() or
include() functions inside your actual web page.
  But if your concern is for local users' access to those file , just set
your file/directory permissions accordingly.

Gurhan

-----Original Message-----
From: Duky Yuen [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 27, 2002 7:38 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] [PHP] PHP and MYSQL Security`


How can I secure my username and password? In 1 of my files, it contains
the following:

    $conn = mysql_connect( "12.34.56.78", "username", "password");
    mysql_select_db("database",$conn);

What should I do, so people can't get this information?

Duky


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
At 16:59 -0800 1/27/02, Fred wrote:
>If this file has a .php extension remote users will not have access to the
>variables because the file is parsed by php and they never see the actual
>file contents when requesting the document via the web.  If you are
>concerned with users on localhost having access to the file, simply give it
>the correct permissions so that no one else has read access.

No so easy.  The server itself must have read access.  If other users on
the local host can install scripts that the server executes, any of those
scripts can read the text of your scripts.

What then? You're hosed.

>
>If you are concerned about web users having access, if, for example, the php
>parser crashed and apache tried to pass the file through without parsing,
>you can put the default server, user and pass variables in the php.ini file
>which is not in the document root for apache.  Of course, this only works if
>all of your scripts use the same server, user and password.
>
>Fred
>
>Duky Yuen <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>  How can I secure my username and password? In 1 of my files, it contains
>>  the following:
>>
>>      $conn = mysql_connect( "12.34.56.78", "username", "password");
>>      mysql_select_db("database",$conn);
>>
>>  What should I do, so people can't get this information?
>>
>>  Duky
>>
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; 
If you would like to pass it by reference, modify the declaration of similar_text(). 
If you would like to enable call-time pass-by-reference, you can set 
allow_call_time_pass_reference to true in your INI file. However, future versions may 
not support this any longer. in /www/sites/nz.php.net/htdocs/quickref.php on line 41

hehe

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012
--- End Message ---
--- Begin Message ---
Warning: Cannot send session cookie - headers already sent by (output started at 
d:\website\myphp\fitness\index.php:7) in d:\website\myphp\fitness\config.php on line 3

Warning: Cannot send session cache limiter - headers already sent (output started at 
d:\website\myphp\fitness\index.php:7) in d:\website\myphp\fitness\config.php on line 3

ARRRRRRRRRRRRRRRRRRRRRRRRRRRR

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012
--- End Message ---
--- Begin Message ---
Can you paste the code please?  You must send the cookie before you send 
anything else.

Jeff

At 02:20 PM 1/28/2002 +1300, Philip J. Newman wrote:
>Warning: Cannot send session cookie - headers already sent by (output 
>started at d:\website\myphp\fitness\index.php:7) in 
>d:\website\myphp\fitness\config.php on line 3
>
>Warning: Cannot send session cache limiter - headers already sent (output 
>started at d:\website\myphp\fitness\index.php:7) in 
>d:\website\myphp\fitness\config.php on line 3
>
>ARRRRRRRRRRRRRRRRRRRRRRRRRRRR
>
>Philip J. Newman
>Philip's Domain - Internet Project.
>http://www.philipsdomain.com/
>[EMAIL PROTECTED]
>Phone: +64 25 6144012


--- End Message ---
--- Begin Message ---
Hi everyone !

  I try to install PHP in the following environment.
    O/S : solaris 2.7
    PHP version : 4.0.6
    Web Server : Nestscape Enterprise 3.6

  But, I have some problems in installing PHP4.
  I referenced the following document fully.
           http://benoit.noss.free.fr/php/install-php4.html

  I had no problems until  "configure", "make" and "make install" the
PHP4.
  But, When I restarted the web server after I configured the
file,"obj,conf",
  the following error message occurred.

   ERROR : pclose() failed.(2 : Unknown early startup error)

  I added followig 2-lines to the "obj.conf" files.

        Init fn="load-modules"
funcs="php4_init,php4_close,php4_execute,php4_auth_trans"
shlib="/usr/local/netscape/server4/bin/libphp4.so"
        Init fn="php4_init" errorString="Failed to initialize PHP!"

  If I remove the second line('Init fn="php4_init" errorString="Failed
to initialize PHP!"'), there is no error message but PHP is don't work.


  What is the problem?  I cannot solve this problem.
  Please help me.

--- End Message ---
--- Begin Message ---
I'm trying to get the following ingotmation from my server.

The Actual ip# that the user has connected to the server with;
The Prioxy ip# that the user has connected to the server with;
The DNS name that the user has connected to the server with;

Is this possable with PHP?

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012
--- End Message ---
--- Begin Message ---
On Monday 28 January 2002 10:42, Philip J. Newman wrote:
> I'm trying to get the following ingotmation from my server.
>
> The Actual ip# that the user has connected to the server with;

$_SERVER['HTTP_X_FORWARDED_FOR']


> The Prioxy ip# that the user has connected to the server with;

$_SERVER['REMOTE_ADDR']


*NB* if user didn't connect through proxy (or NAT) then 
$_SERVER['HTTP_X_FORWARDED_FOR'] would be empty and Actual ip# would be 
$_SERVER['REMOTE_ADDR']



> The DNS name that the user has connected to the server with;

use gethostbyaddr()


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
You mean you don't want to watch WRESTLING from ATLANTA?
*/
--- End Message ---
--- Begin Message ---
I've got a live script which occasional has to retrieve a file via ftp,
download to the server, post-process it then display it.

I use caching to check to see if I've already got the file, but if I don't I
have to process the ftp_get operation which occasionally times out.

So, is it possible to trap the time limit exceeded error and return a fail
code?

For example:

function GetFileViaFTP( $filename )
{
    if (file_exists("cache/" . $filename))
    {
        return true;
    }

    $ftp = ftp_connect("some host");
    ftp_login($ftp, "some username", "some password");
    ftp_chdir($ftp, "some path");

    if (ftp_get($ftp, "cache/" . $filename, $filename, FTP_BINARY))  // This
will sometimes fail
    {
        ftp_quit($ftp);

        return true;
    }

    ftp_quit($ftp);

    return false;
}

function GetFile( $filename )
{
    if (file_exists("cache/" . $filename) || GetFileViaFTP($cache))
    {
        return file("cache/" . $filename);
    }

    return "Sorry, the file {$filename} could not be located";
}



--- End Message ---

Reply via email to