php-general Digest 9 Jan 2001 23:21:12 -0000 Issue 445

Topics (messages 33429 through 33586):

Re: php and shell scripting
        33429 by: Toby Butzon

1114 : The table 'SQL43ec4_0' is full
        33430 by: Daniele Cesarini
        33447 by: Cynic

Re: database collision?
        33431 by: mailing-list.gmx.li

Re: LINK CHECKER! for testing one whole site at once ?
        33432 by: mailing-list.gmx.li
        33443 by: Yoeri De Bruyn
        33508 by: Philip Olson

Re: Quickie:  Why doesn't can't I get a value from this array?
        33433 by: April

Re: looking for a PHP editor
        33434 by: Carsten Gehling
        33435 by: Carsten Gehling
        33437 by: mailing_list.gmx.at
        33439 by: Yoeri De Bruyn
        33574 by: Jeffrey A. Stuart
        33584 by: Brad Hubbard

fork
        33436 by: Angus Calder
        33441 by: Tim Zickus

"Couldn't select database." --> database DOES exist!!!
        33438 by: Yoeri De Bruyn
        33440 by: William Bailey
        33442 by: hentis.twilyt.com
        33444 by: Yoeri De Bruyn
        33457 by: William Bailey

Running an .exe on localhost
        33445 by: Malcolm Clark

how to set user_agent
        33446 by: mailing_list.gmx.at

Re: Can PHP do this?
        33448 by: Sander Pilon
        33449 by: Sander Pilon
        33552 by: Ed Lazor
        33556 by: Sander Pilon

Re: oop
        33450 by: Cynic

God help us all
        33451 by: Hrishi

problems with functions using an include file connecting to mysql
        33452 by: First Name Last Name
        33453 by: Cynic

about installing gd library
        33454 by: Ben Chung
        33505 by: \"Cyb\"

What exactly is FrameWork???
        33455 by: Nikolajus Krauklis

[Newbie] Image Module needed ?
        33456 by: \"Cyb\"

Re: Editing php files in vim
        33458 by: Anuradha Ratnaweera

Re: File uploading
        33459 by: Anuradha Ratnaweera

PATH_INFO in Windows/IIS
        33460 by: Tom Harris
        33581 by: Chris Hayes

Date Validation
        33461 by: TV Karthick Kumar
        33474 by: Niel Zeeman
        33513 by: Bryne Jørg Vidar

Re: Installing PHP With GD
        33462 by: Anuradha Ratnaweera
        33571 by: Brad Hubbard

Problems with mysql_connect and mysql_pconnect
        33463 by: BrunoM

remove from array
        33464 by: AJDIN BRANDIC
        33466 by: Marcelo Gulin
        33467 by: Max A. Derkachev
        33469 by: Max A. Derkachev
        33471 by: AJDIN BRANDIC

suid to script owner?
        33465 by: Philip Mak
        33475 by: Jeff P

Re: include path confusion
        33468 by: Randy

XML error 1 0 - help with error codes
        33470 by: April

Calling a Windows Com object or an Extended Fetch?
        33472 by: Paulson, Joseph V. \"Jay\"
        33477 by: Miles Thompson
        33576 by: bard
        33585 by: Brad Hubbard

signing in as php user?
        33473 by: Jason Jacobs
        33580 by: Brian Clark

Upgrading to PHP 4.04
        33476 by: Scott Gerhardt
        33478 by: Mathias Meyer

How to develope and add a new user function or lib or extention to php
        33479 by: Allen Zhao

PHP vs. qmail
        33480 by: Nicklas af Ekenstam

need admin help please...
        33481 by: Sebastian Stadtlich
        33586 by: Brian Clark

Re: R: [PHP] HomeSite & color coding ...
        33482 by: Kulkarni, Vikram

unique id
        33483 by: AJDIN BRANDIC

moving directories
        33484 by: David Vázquez
        33512 by: Philip Olson
        33514 by: Alexander Wagner

Should PHP add 6 meg to httpd?
        33485 by: Dan Delaney
        33488 by: Rasmus Lerdorf
        33506 by: Dan Delaney

Email List Scripts?
        33486 by: Website4S.aol.com
        33497 by: Michael Kimsal
        33529 by: David Bouw

Cookie -> Delete -> Reset
        33487 by: Abe Asghar
        33489 by: Rasmus Lerdorf
        33499 by: Abe Asghar
        33502 by: Rasmus Lerdorf

comparisons
        33490 by: Christopher Allen
        33493 by: Rasmus Lerdorf

Browser?
        33491 by: Website4S.aol.com
        33494 by: Boget, Chris
        33495 by: Rasmus Lerdorf
        33498 by: DanO

Re: Simple error handling... but how? - Register your own error-handler with PHP
        33492 by: Diego Fulgueira
        33503 by: Neil Kimber

mysql_query
        33496 by: Augusto Cesar Castoldi
        33500 by: Rasmus Lerdorf
        33501 by: Nathan Cook
        33504 by: Augusto Cesar Castoldi
        33507 by: Augusto Cesar Castoldi
        33509 by: Rasmus Lerdorf
        33511 by: kmurrah

Re: php-general Digest 9 Jan 2001 11:19:11 -0000 Issue 444
        33510 by: cmead

PHP mail with attachments ....
        33515 by: kmurrah
        33517 by: Philip Olson
        33521 by: Marcelo Gulin

ext/java causes segfault in Apache
        33516 by: Brice Ruth

PHP and wap
        33518 by: Todd Cary
        33519 by: Robert Covell
        33520 by: jeremy brand
        33522 by: Philip Olson

FATAL: emalloc() error
        33523 by: Justin Smith

PHP Conference Call for Participation
        33524 by: Rasmus Lerdorf

How do I print Multi Dimensional Arrays?
        33525 by: Brandon Orther
        33527 by: Matt McClanahan
        33532 by: Monte Ohrt

PHP has encountered an Access Violation at 119F4CE6
        33526 by: Paulo Parola
        33528 by: Phil Driscoll

How do I make it easier to find the right array?
        33530 by: Brandon Orther
        33534 by: Chris Lee

[php&mysql&javascript] Preloading pictures from database
        33531 by: Siim Einfeldt aka Itpunk

is there a builtin php function for this ?
        33533 by: Chris Lee
        33536 by: MR
        33538 by: Chris Lee

Creating backup program (or problem with exec())
        33535 by: CDitty
        33544 by: mailing_list.gmx.at

Discussion board recommendation
        33537 by: H. Wade Minter

help please!!!!!!???
        33539 by: Wee Chua

Checking whether a MySQL table exists
        33540 by: Ben Wiechman
        33546 by: David Tod Sigafoos
        33547 by: Philip Olson
        33548 by: Web Master
        33551 by: mailing_list.gmx.at
        33562 by: Sander Pilon
        33565 by: David Tod Sigafoos

User Authentication Integration with NT
        33541 by: Phil Labonte

Any plans of a completely object oriented version of PHP?
        33542 by: Jan Aagaard
        33543 by: Rasmus Lerdorf

Credit Card Processing
        33545 by: ncook

escape()
        33549 by: matt.wong.tumbleweed.com
        33550 by: jeremy brand

Problem passing form parameters
        33553 by: Antonio Guerrieri
        33557 by: Miles Thompson
        33560 by: Ignacio Vazquez-Abrams

<BR> in html
        33554 by: Brandon Orther
        33558 by: Jade Ohlhauser
        33582 by: Chris Hayes

gdImageCreateFromGif compile
        33555 by: Dan Harrington

MySQL 3.22.xx/PHP4.xx installation issue
        33559 by: Gerald Neale
        33564 by: Ignacio Vazquez-Abrams

Speaking of OOP
        33561 by: John Guynn
        33566 by: Cal Evans
        33568 by: Ignacio Vazquez-Abrams
        33569 by: Rasmus Lerdorf

Can't figure out how to logoff...
        33563 by: Robert Covell
        33567 by: Sander Pilon

encrypt() and decrypt()
        33570 by: Robert Collins
        33583 by: Stefan Scherf

Serving files form DB
        33572 by: Boget, Chris

Re: Multi Dimensional Arrays
        33573 by: Brad Hubbard

more shopping cart crap
        33575 by: Jerry Lake

Show output of program in realtime on website
        33577 by: Stefan Scherf

Re: Problem passing form parameters (solved!)
        33578 by: Antonio Guerrieri

Re: installing PHP4 on Apache on Win2000
        33579 by: Brad Hubbard

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]


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


I use PHP for just about all the shell scripting I do (which isn't all that
much, but hey....)

Heh, I've been with PHP long enough that I've half-forgotten Perl (and even
worse, I don't care...)

Regards,

Toby Butzon
[ criticism spurs improvement ]


----- Original Message -----
From: "defender of the protocol" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 12:13 AM
Subject: [PHP] php and shell scripting


: Hi. I'm new to the list, and hope that my subscription here can be an
: enjoyable time.
:
: Now that that's out, I do have a *real* point to this post, so here goes:
:
: Do any of you (or should it be how many of you) use php for shell
scripting
: and other assorted tasks that you would normally use perl for?
:
: I do, and i've had great luck so far in writing function scripts to do a
: lot of stuff on my systems.
:
: So, there's my question/comment
:
: Thanks,
: - j
:
:
: --
: 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]
:
:





Hi, 

I have a table with more than 70000 records and when I do a SELECT *
from table limit 20 I receive this error.
PHP 4.0.3pl1
Mysql 3.22.32

I tried to rise the amount of memory php uses, no effect

Any help?

-- 
 Daniele




have a look at mysql startup options. one of them is 
--big-tables or so, and you need to start MySQL with it.

At 12:24 9.1. 2001, Daniele Cesarini wrote the following:
-------------------------------------------------------------- 
>Hi, 
>
>I have a table with more than 70000 records and when I do a SELECT *
>from table limit 20 I receive this error.
>PHP 4.0.3pl1
>Mysql 3.22.32
>
>I tried to rise the amount of memory php uses, no effect
>
>Any help?
>
>-- 
> Daniele
>
>-- 
>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 of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]






> hi there. i am developing a database app to manage dynamic sites. in a
> nutshell, i have an item table (to store all the content) and a
> permission
> table (to register who's allowed to edit/view specific items).
> 
> now, when creating a new item, i do the following things:
> 
> - determine a new permission id (which is the permission table primary
> key,
> kinda "SELECT MAX(id) FROM permission_table" and then increase the
> result by
> one. i don't use AUTO_INCREMENT columns on purpose.)
> - create an entry in the permission table
> - create an entry in the item table, including the permission id as
> relational attribute
> 
> now, my question is: since there may be multiple php processes running,
> if
> two users simultaneously create an item and post it at the same moment -
> couldn't it happen that the process of user#1 has already determined the
> permission id, while user#2 determines the SAME id, creates the entry
> and
> user#1 will get an error because the item id was already taken in the
> meantime? what can i do to avoid such security/integrity holes?
> 
this is db-dependend - I think you use mysql (because of the
AUTO_INCREMENT)

from the mysql-docu:
http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#LOCK_TABLES
---cut---
MySQL doesn't support a transaction environment, so you must use LOCK
TABES if you want to ensure that no other thread comes between a SELECT and an
UPDATE. The example shown below requires LOCK TABLES in order to execute
safely.
---cut---

so why not use AUTO_INCREMENT?

afaik in ORACLE there's a "select for update"

witty

-- 
Sent through GMX FreeMail - http://www.gmx.net




> Hi,
> 
> Does anybody have a clue on the best (and preferably freeware) link
> checker, but to check every link on every page of the whole site?
> 
> Any tip or hint is being very appreciated!
> 

I use Xenu:
http://home.snafu.de/tilman/xenulink.html

the best I have found (and I tried many!!!)

but it is only available for WIN95/98/NT/2000 !!!

witty

-- 
Sent through GMX FreeMail - http://www.gmx.net




Hi Witty,

That's exactly what I was looking for! It's really cool stuff!
Thanxxxxxxxxxxx a lot!!!!

S,
Yoeri.
> Hi,
> 
> Does anybody have a clue on the best (and preferably freeware) link
> checker, but to check every link on every page of the whole site?
> 
> Any tip or hint is being very appreciated!
> 

I use Xenu:
http://home.snafu.de/tilman/xenulink.html

the best I have found (and I tried many!!!)

but it is only available for WIN95/98/NT/2000 !!!

witty

-- 
Sent through GMX FreeMail - http://www.gmx.net

-- 
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]






    W3C Link Checker                     : 
    --------------------------------------
    http://validator.w3.org/checklink


150 limit, choose at 'options' and mark appropriatly.




Philip Olson
http://www.cornado.com/

On Tue, 9 Jan 2001 [EMAIL PROTECTED] wrote:

> > Hi,
> > 
> > Does anybody have a clue on the best (and preferably freeware) link
> > checker, but to check every link on every page of the whole site?
> > 
> > Any tip or hint is being very appreciated!
> > 
> 
> I use Xenu:
> http://home.snafu.de/tilman/xenulink.html
> 
> the best I have found (and I tried many!!!)
> 
> but it is only available for WIN95/98/NT/2000 !!!
> 
> witty
> 
> -- 
> Sent through GMX FreeMail - http://www.gmx.net
> 
> -- 
> 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]
> 





Oh, oops, figured it out with help from someone on the list.  I had
forgotten about case-folding, I needed to be trying R:RESOURCE, not
r:resource.


----- Original Message -----
From: Hsieh, Wen-Yang <[EMAIL PROTECTED]>
To: April <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 2:42 AM
Subject: Re: [PHP] Quickie: Why doesn't can't I get a value from this array?


>
> ----- Original Message -----
> From: "April" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, January 08, 2001 12:36 PM
> Subject: [PHP] Quickie: Why doesn't can't I get a value from this array?
>
>
> > Hi, I'm using PHP to process some XML, and I can't figure out how to
> access
> > the attributes of the tag.  Yeah, yeah, it's not brain surgery or
> anything,
> > but there's a reason I'm not a brain surgeon.
> >
> > from documentation:
> > The third parameter, attribs, contains an associative array with the
> > element's attributes (if any). The keys of this array are the attribute
> > names, the values are the attribute values. Attribute names are
> case-folded
> > on the same criteria as element names. Attribute values are not
> case-folded.
> >
> > my code snippet:
> >
> > function startElementHandler($parser, $name, $attribs) {
> >   if ($name == "NARROW") {
> >    echo("<br><br>A narrow.<br>");
> >    $array_element = $attribs["r:resource"];
> >    echo("r:resource of a narrow: $array_element <br><br>");
> >   }
> >  }
> >
> > and the xml looks like this:
> >
> > <Topic r:id="Top">
> >   <tag catid="1"/>
> >   <d:Title>Top</d:Title>
> >   <narrow r:resource="Top/Arts"/>
> >   <narrow r:resource="Top/Business"/>
> > </Topic>
> >
> >
> > My error code looks like:
> > Warning: Undefined index: r:resource in
> > c:\apache\htdocs\searchengine\categories.php on line 26
> > (over and over again, of course)
> >
> > But, count($attribs) returns 1.
>
> key($attribs) returns ?
>
> >
> > Anyway, any help would be greatly appreciated.
> >
> >
> > --
> > 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]
> >
>
>
>





From: "Brian Clark" <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 4:56 AM

> Sometimes I even use Paper and Pencil to "edit things."

Wow! Which version? Steer clear of the new MS P&P 2000, its lead kernel
(core) is unstable and tends to break when applying high pressure. Instead
go for the BeP&P 3.45.11-gamma - it even comes with a 128-bit eraser at the
opposite end...

- Carsten
~~~~~~~~~~~~~~~~







From: "Teodor Cimpoesu" <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 10:40 AM


> as for assembly, it's a good start in understanding PHP, really. Start
from
> the bottom.

Real programmers do "copy con >filename.exe" (well at least in
dos/windows... :-)

- Carsten
~~~~~~~~~~~~~~~~






> Real programmers do "copy con >filename.exe" (well at least in
> dos/windows... :-)

I think you mean "copy con filename.exe"
that's the correct way ;-)

witty

-- 
Sent through GMX FreeMail - http://www.gmx.net




Hi,

I use HTML kit 1.0 build 288. It's really cool and there are lots of
"plugins" (i.e. kind of libraries) you can download, and it's freeware! 
You can custimise lots of its features aswell.

So if your convinced,try it out! --> http://www.chami.com/html-kit/

Saludos,
Yoeri.


From: "Brian Clark" <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 4:56 AM

> Sometimes I even use Paper and Pencil to "edit things."

Wow! Which version? Steer clear of the new MS P&P 2000, its lead kernel
(core) is unstable and tends to break when applying high pressure.
Instead
go for the BeP&P 3.45.11-gamma - it even comes with a 128-bit eraser at
the
opposite end...

- Carsten
~~~~~~~~~~~~~~~~




-- 
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]





Yes and no.  HOWEVER... for us "oldtimers" who need to bang out code
quickly.... This is the BEST thing since sliced white bread. :)  It's even
better than sex... (Well... maybe LOL)  I got it myself and have fallen in
love with it in about 3 days!

--
Jeff Stuart
[EMAIL PROTECTED]

-----Original Message-----
From: Brian Clark [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 08, 2001 10:52 PM
To: PHP is not a drug .
Subject: Re: [PHP] looking for a PHP editor


Hello Sabina,

(SH == "Sabina Huang") [EMAIL PROTECTED] writes:

SH> tool that creates PHP automatically, so you don't
SH> need to code :-)

IMO, bad, _bad_ idea for the beginning PHPer.

<snip>

SH> Sabina

-Brian
--

I got vision, and the rest of the world
wears bifocals. -- Butch Cassidy



--
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]





> It's even better than sex... (Well... maybe LOL)  I got it myself and have
fallen in love with it in about 3 days!
>

What is it? HTML-Kit?

Cheers,
Brad





Does any one know if there is a "fork" function in php, I have been
unable to find any literature on the subject.
I am trying to send an email of a CSV database dump via a browser,
because the info is too large it keeps timing out my browser. 
Any ideas?

Angus




Try set_time_limit(0) instead.  That will prevent the timeout.

- Tim

----- Original Message ----- 
From: "Angus Calder" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 7:12 AM
Subject: [PHP] fork
> I am trying to send an email of a CSV database dump via a browser,
> because the info is too large it keeps timing out my browser. 






Hi,

When I use this php calls on Win2000 configuration everything works
fine, but migrating the site and DB to Linux, apparently the database
can not be found!
I use the following way to connect to my database:

//create connection   
   $connection = mysql_connect("localhost","","")
                or die("Couldn't connect to server.");
   
 //select database      
   $db = mysql_select_db("searchDB", $connection) 
                or die("Couldn't select database.");

and I get : --> "Couldn't select database."
PS: I can "browse" the DB on linux via command line without any probs,
so?!
If you feel like "damn! I've seen that once in my whole life!" (or even
if you didn't) please tell me what you did to get rit of that feeling...
;-) !!!
Thanks a llllllllot!
Saludos,
Yoeri.





Try adding mysql_error() to the die finction. It normally tells you exactly
what mysql is trying to do and why it went wrong.

        e.g:
$db = mysql_select_db("searchDB", $connection)  or die("Couldn't select
database. MySQL said: " .mysql_error());

Thanks
        William.


On 2001.01.09 12:14:03 +0000 Yoeri De Bruyn wrote:
> Hi,
> 
> When I use this php calls on Win2000 configuration everything works
> fine, but migrating the site and DB to Linux, apparently the database
> can not be found!
> I use the following way to connect to my database:
> 
> //create connection   
>    $connection = mysql_connect("localhost","","")
>               or die("Couldn't connect to server.");
>    
>  //select database    
>    $db = mysql_select_db("searchDB", $connection) 
>               or die("Couldn't select database.");
> 
> and I get : --> "Couldn't select database."
> PS: I can "browse" the DB on linux via command line without any probs,
> so?!
> If you feel like "damn! I've seen that once in my whole life!" (or even
> if you didn't) please tell me what you did to get rit of that feeling...
> ;-) !!!
> Thanks a llllllllot!
> Saludos,
> Yoeri.
> 
> 
> -- 
> 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]
> 





hi there :) 

I'm assuming you can access the database from your chell command using "mysql" command
this doesn't use a port connection but a socket connection.

have a look at the mysql database and the setting int the hosts and user and db fields 
is you acually have permissions to access the datatbase as the user from the host you 
are 
connecting from even if it is the localhost

Henti Smith

On Tue, Jan 09, 2001 at 01:14:03PM +0100, Yoeri De Bruyn wrote:
> Hi,
> 
> When I use this php calls on Win2000 configuration everything works
> fine, but migrating the site and DB to Linux, apparently the database
> can not be found!
> I use the following way to connect to my database:
> 
> //create connection   
>    $connection = mysql_connect("localhost","","")
>               or die("Couldn't connect to server.");
>    
>  //select database    
>    $db = mysql_select_db("searchDB", $connection) 
>               or die("Couldn't select database.");
> 
> and I get : --> "Couldn't select database."
> PS: I can "browse" the DB on linux via command line without any probs,
> so?!
> If you feel like "damn! I've seen that once in my whole life!" (or even
> if you didn't) please tell me what you did to get rit of that feeling...
> ;-) !!!
> Thanks a llllllllot!
> Saludos,
> Yoeri.
> 
> 
> -- 
> 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]




Yep! You got the bastard! Thanks a lot!!!

look here the result:
"Couldn't select database. MySql said: Access denied for user:
'@localhost' to database 'searchDB'"

Is there an easy way to create a user and determine his permissions on
the DB?

Thanx!!!
Yoeri.




Try adding mysql_error() to the die finction. It normally tells you
exactly
what mysql is trying to do and why it went wrong.

        e.g:
$db = mysql_select_db("searchDB", $connection)  or die("Couldn't select
database. MySQL said: " .mysql_error());

Thanks
        William.


On 2001.01.09 12:14:03 +0000 Yoeri De Bruyn wrote:
> Hi,
> 
> When I use this php calls on Win2000 configuration everything works
> fine, but migrating the site and DB to Linux, apparently the database
> can not be found!
> I use the following way to connect to my database:
> 
> //create connection   
>    $connection = mysql_connect("localhost","","")
>               or die("Couldn't connect to server.");
>    
>  //select database    
>    $db = mysql_select_db("searchDB", $connection) 
>               or die("Couldn't select database.");
> 
> and I get : --> "Couldn't select database."
> PS: I can "browse" the DB on linux via command line without any probs,
> so?!
> If you feel like "damn! I've seen that once in my whole life!" (or
even
> if you didn't) please tell me what you did to get rit of that
feeling...
> ;-) !!!
> Thanks a llllllllot!
> Saludos,
> Yoeri.
> 
> 
> -- 
> 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]
> 






RTFM: look at the MySQL docs, there is a whole section on the way the
access rights work (and is able to explain it beter then i could).

On 2001.01.09 12:38:10 +0000 Yoeri De Bruyn wrote:
> Yep! You got the bastard! Thanks a lot!!!
> 
> look here the result:
> "Couldn't select database. MySql said: Access denied for user:
> '@localhost' to database 'searchDB'"
> 
> Is there an easy way to create a user and determine his permissions on
> the DB?
> 
> Thanx!!!
> Yoeri.
> 
> 
> 
> 
> Try adding mysql_error() to the die finction. It normally tells you
> exactly
> what mysql is trying to do and why it went wrong.
> 
>       e.g:
> $db = mysql_select_db("searchDB", $connection)  or die("Couldn't select
> database. MySQL said: " .mysql_error());
> 
> Thanks
>       William.
> 
> 
> On 2001.01.09 12:14:03 +0000 Yoeri De Bruyn wrote:
> > Hi,
> > 
> > When I use this php calls on Win2000 configuration everything works
> > fine, but migrating the site and DB to Linux, apparently the database
> > can not be found!
> > I use the following way to connect to my database:
> > 
> > //create connection   
> >    $connection = mysql_connect("localhost","","")
> >             or die("Couldn't connect to server.");
> >    
> >  //select database  
> >    $db = mysql_select_db("searchDB", $connection) 
> >             or die("Couldn't select database.");
> > 
> > and I get : --> "Couldn't select database."
> > PS: I can "browse" the DB on linux via command line without any probs,
> > so?!
> > If you feel like "damn! I've seen that once in my whole life!" (or
> even
> > if you didn't) please tell me what you did to get rit of that
> feeling...
> > ;-) !!!
> > Thanks a llllllllot!
> > Saludos,
> > Yoeri.
> > 
> > 
> > -- 
> > 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]
> 

-- 

Thanks,
        William.





Can somebody please give me a starter in trying to run a local application
(.exe) from a html button eg. Does it involve exec() or system() ? And if
so, could somebody give me an example. I'm too dim to learn any other way ;)

TIA

Malx





Hi!

I want to get a page with "file('http://server.com/xxx.html')".
But I think the script on that server does a "HTTP_USER_AGENT"-checking,
and I don't get the content, I get with my browser!
my php sends "PHP/4.0.3pl1" as user_agent.
Can I change this to "Mozilla ...."??


thanks
witty

-- 
Sent through GMX FreeMail - http://www.gmx.net





Per user, just store in a table which messages he read or not.

> -----Original Message-----
> From: Ed Lazor [mailto:[EMAIL PROTECTED]]
> Sent: 9 January 2001 07:45
> To: Josh G
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Can PHP do this?
> 
> 
> At 02:38 PM 1/9/2001 +1100, you wrote:
> >There's a couple of ways... You can track individual messages (messy),
> >or better, simply keep a date of the last time a user requested 
> a message -
> >Hence, all messages since the last message request/login are new.
> >
> >This can be done with or without cookies, but with would be easier.
> 
> Yea, that would be pretty easy.  What's so cool about this 
> message board is 
> that it even manages to track which messages you haven't read between 
> visits.  That's the tough part that I'm trying to figure out.
> 
> Any ideas?
> 
> -Ed
> 
> 
> -- 
> 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]
> 
> 





> Re: [PHP] Can PHP do this?
> No! But developers can do this :-)
>
> And they can do this in any language, not ColdFusion or PHP.
>
> Sabina
>

I dare you!

Make it in miranda, and you've won my eternal respect :)

Some languages are just not suitable to make some projects.
PHP and CF are somewhat similar, so most - if not all things - you can do in
CF
you can do in PHP and the other way around. But if it were a perl or C++
program
there would be dozens of reasons why it might not be reproducable in PHP.
(process control, threading, memory requirements, speed requirements, ipc
requirements, just to name a few)





At 01:42 PM 1/9/2001 +0100, Sander Pilon wrote:
>Per user, just store in a table which messages he read or not.

Wouldn't that turn into a huge bloated (slow) table of 10,000 some odd 
messages times however many users you have?

-Ed





First, you dont store this forever. You store only the results for the last
<X> messages.
Second, you use ranges. Per SQL-Row have the possibility to set values for a
whole range of articles.

This would be an all-int table. Very fast and very small if properly
indexed.
(Something like 10 to 20 bytes per entry, times a million rows is still only
20Mb)

And you store only something if the user read it, so that would be ( #read
articles where article in last <X> articles per user).

Last, you could cache some of the results in RAM. (I'm doing something like
that now, although I dont use PHP for this particular project.)



>
> At 01:42 PM 1/9/2001 +0100, Sander Pilon wrote:
> >Per user, just store in a table which messages he read or not.
>
> Wouldn't that turn into a huge bloated (slow) table of 10,000 some odd
> messages times however many users you have?
>
> -Ed
>






yes, but watch out: http://bugs.php.net/bugs.php?id=8565

At 08:50 9.1. 2001, Przem Kowalczyk wrote the following:
-------------------------------------------------------------- 
>> -----Original Message-----
>> From: Luescher Samuel (MMVZSLU)
>> [mailto:[EMAIL PROTECTED]]
>> Sent: Tuesday, January 09, 2001 8:47 AM
>> To: '[EMAIL PROTECTED]'
>> Subject: [PHP] oop
>> 
>> 
>> hi there! is there any way to call an inherited class method if it is
>> overridden in the derived class?
>> 
>> e.g.
>> 
>> class foo {
>>     function bar() {
>>         // do something
>>     }
>> }
>> 
>> class better_foo extends foo {
>>     function bar() {
>>         // first, call inherited foo->bar()
>>         // then do some more stuff
>>     }
>> }
>> 
>> thanks - sam.
>
>You can use foo::bar();
>
>Przem
>
>
>-- 
>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 of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]






jeez, it was just a joke, if u remember, i had asked for space on peoples
servers, i for one would definitely like to know who i'm allowing to use the
insides of *my* server. i certainly didnt think it'd hurt.

i hope to stay here for a while, and i hope this topic is closed because
this forum is php-general-discussion, not bad-jokes-get-grilled-for-weeks.

apologies,
Hrishi

-------------------------------------------
Yeah, there are more important things in life than money, but they won't go
out with you if you don't have any.





hi,
I am having some very diffucly problems using global var's form functions espeically 
with mysql connections. I have created a small include file containing a couple of 
functions, mysql connection stuff. When I run my main script I can connect and change 
databse OK, calling the functions. But as soon as I use other mysql functions from my 
main script I get errors. When I run the script I get...

logged in
changed into to DB
Warning: Supplied argument is not a valid MySQL result resource 
....

On the following lines..
$num_rows=mysql_num_rows($mysql_result);
while ($row=mysql_fetch_array($mysql_result))

What am I doing wrong!. I have made the variables global.

Heres my small main script, followed by my functions file. 
<?php
require ("inc.php");
conn();
echo "logged in";
change_db();
echo "changed into to DB";
$sql="SELECT name, address,ID FROM mydb";
 $mysql_result=mysql_query($sql,$connect);
$num_rows=mysql_num_rows($mysql_result);

while ($row=mysql_fetch_array($mysql_result))
{
$name=$row["name"];
$address=$row["address"];
$ID=$row["ID"];
echo "$name:$address:$ID<BR>";
}
mysql_close($connection);
?>

<?php
# inc.php
function conn(){
global $connect;
$connect=mysql_pconnect("localhost","","");
if (!$connect) {
echo "could not connect";
exit;
 }
}

function change_db(){
global $db;
global $connect;
$db=mysql_select_db("mydb",$connect);
if (!$db)
 {
 echo "Could not select database";
 exit;
 }
}




------------------------------------------------------------
--== Sent via Deja.com ==--
http://www.deja.com/






this one is very simple:

function foo() 
{
        global $bar ;
        $bar = "something" ;
}

creates a reference to a global $bar, and then breaks the 
reference when you set $bar to 'something'. 
use $GLOBALS['bar'] instead.

At 14:08 9.1. 2001, First Name Last Name wrote the following:
-------------------------------------------------------------- 
>hi,
>I am having some very diffucly problems using global var's form functions espeically 
>with mysql connections. I have created a small include file containing a couple of 
>functions, mysql connection stuff. When I run my main script I can connect and change 
>databse OK, calling the functions. But as soon as I use other mysql functions from my 
>main script I get errors. When I run the script I get...
>
>logged in
>changed into to DB
>Warning: Supplied argument is not a valid MySQL result resource 
>....
>
>On the following lines..
>$num_rows=mysql_num_rows($mysql_result);
>while ($row=mysql_fetch_array($mysql_result))
>
>What am I doing wrong!. I have made the variables global.
>
>Heres my small main script, followed by my functions file. 
><?php
>require ("inc.php");
>conn();
>echo "logged in";
>change_db();
>echo "changed into to DB";
>$sql="SELECT name, address,ID FROM mydb";
> $mysql_result=mysql_query($sql,$connect);
>$num_rows=mysql_num_rows($mysql_result);
>
>while ($row=mysql_fetch_array($mysql_result))
>{
>$name=$row["name"];
>$address=$row["address"];
>$ID=$row["ID"];
>echo "$name:$address:$ID<BR>";
>}
>mysql_close($connection);
>?>
>
><?php
># inc.php
>function conn(){
>global $connect;
>$connect=mysql_pconnect("localhost","","");
>if (!$connect) {
>echo "could not connect";
>exit;
> }
>}
>
>function change_db(){
>global $db;
>global $connect;
>$db=mysql_select_db("mydb",$connect);
>if (!$db)
> {
> echo "Could not select database";
> exit;
> }
>}
>
>
>
>
>------------------------------------------------------------
>--== Sent via Deja.com ==--
>http://www.deja.com/
>
>
>
>-- 
>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 of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]






Hi, it is my first time pop up from here.
Can anybody kindly tell me, what step should i do so that i can make use of
the gd library in the Apache PHP module?
I am just a very beginner, pls tell me detail if possible. Thank you a lot
^_^

The apache is running in NT4.0 and i am using php3. ^____^







I have the very same "problem", could you please cc the List or me when
replying, thank you!

Alain




Hilow once again,

from one friend i hear word framework, then i speak about php. What's
framework means exactly i don't know. I guess it's somthing about templates
and page structure? where can i find more info about it?

Nikolajus Krauklis






Howdy,

Stipid question, Why do I have the following code being output as plain
text ?(yes, even the "<?" and "?>" are being written). 

It's supposed to be an Image. I do have the GD lib running... (Tried
with Gif, Jpg, Png...)

Cheers,

Alain

CODE:

<?
// send header
Header("Content-Type: image/gif");

// create image and colours
$im = ImageCreate(500, 75);
$red = ImageColorAllocate($im, 255, 0, 0);
$black = ImageColorAllocate($im, 0, 0, 0);

// fill image
ImageFill($im, 0, 0, $red);

// write string at (210,30) in black
ImageString($im, 4, 210, 30, "Hello John", $black);

// release image
ImageGIF($im);
?>





Hi,

I use syntax highlighting with all kinds of files on vim without
problems. However, this doesn't work if you just installed vim. You also
need vim runtime support (/usr/share/vim/... files). On debian you have to
install both vim and vim-rt packages, while on redhat you need vim and
vim-enhanced.

Here is my .vimrc


syntax on
set cindent
set cino=>2:2=2
inoremap { {<cr>}<esc>ko  


Anuradha

On 7 Jan 2001, A Complete Luser wrote:

> Hi there,
> 
> I am using vim as my default editor for PHP files. The syntax
> highlighting normally works, but quite often if I page down or SHIFT-G
> to get to the end of a file, I lose all the highlighting and the text
> is all plain white.
> 
> Does anyone know of a solution to this, or have an alternative editor
> that will preserve my syntax highlighting? 
> 
> Thanks,
> 






On Mon, 8 Jan 2001, Tim E Patterson wrote:

> I'm using Linux 6.2 server, apache + php3 + mysql.

Please, please notice that there is nothing in this world called Linux 6.2
(yet). The latest linux version is 2.4 (released last week, and oh btw).

> The problem is that, apparently, there is a 2 Mb file size limitation
> for doing this. Does anyone out there have a way around this ? Clients
> very often upload excel, power point, and other files that greatly
> exceed the 2 Mb limit. Any help is greatly appreciated.

Look at php.ini file.

Anuradha





I've been using $PATH_INFO to get variables passed without using a "?" in
the URL (using Linux/Apache)

I copied our site over to a Win box with IIS and now when I goto to

http://localhost/testscript.php/43/2000

I'm told:

Warning: Failed opening 'C:\Inetpub\wwwroot\testscript.php\43\2000\' for
inclusion (include_path='') in Unknown on line 0

Did I install something wrong? Does this not work on Windows?  Someone
please tell me what to do.

Thanks!








To:                     [EMAIL PROTECTED]
From:                   "Tom Harris" <[EMAIL PROTECTED]>
Date sent:              Tue, 9 Jan 2001 09:34:32 -0500
Subject:                [PHP] PATH_INFO in Windows/IIS

> I've been using $PATH_INFO to get variables passed without using a "?" in the
> URL (using Linux/Apache)
 
> I copied our site over to a Win box with IIS and now when I goto to
> 
> http://localhost/testscript.php/43/2000
> 
> I'm told:
> 
> Warning: Failed opening 'C:\Inetpub\wwwroot\testscript.php\43\2000\' for
> inclusion (include_path='') in Unknown on line 0
> 
> Did I install something wrong? Does this not work on Windows?  Someone
> please tell me what to do.

I think the warning indicates it can't find the file. Looking at it it you 
are trying to open a file:
         http://localhost/testscript.php/43/2000
and php thinks you ean a directory:
        C:\Inetpub\wwwroot\testscript.php\43\2000\' 
Note that the slashes are all standard directory-dividing slashes now, and 
an end slash has been added, meaning it is looking for a directory.

So apparently windows does not understand you mean to open 
        file    C:\Inetpub\wwwroot\testscript.php
                with extension '\43\2000\' 

So if it does not hurt (security, ugly URL) i suggest just make it a 
question mark with a GET variable:      
C:\Inetpub\wwwroot\testscript.php?x=43\2000\
and apply the same searches you are used to.

If that really hurts I'm afraid you have to explain the server what you 
mean. I have no suggestions....
good luck,
Chris







--------------------------------------------------------------------
--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
--------------------------------------------------------------------

 




Hi all

    I have some strange problem in Validating the date.

    I am working on some web application which is like Events in an Address
book for our customers. The requirement is whenever the Event date is passed
today's date (crosses todays date), I should be able to allow the user
delete the particular event (record) and should be deleted.

    Here's my script, it's very simple and I am not able to get the exact
results at all. Please help me.

    <?
    $td=date("d/m/Y");
    echo $td;
    echo "<br>";
    $id='02/02/2001';
    echo $id;

    if ($td > $id) {
     echo 'todays date is greater than id';
     }
    else
    {
     echo 'todays date is lesser than id';
     }
    ?>

 -- The above script always prints the first echo statement saying that
'todays date is greater than <$id's value>'. Why is that so ?. What's the
other way that I can validate this date ?.

    Thanks in advance.

~ Karthick






Hi
Just a suggestion ... try using mktime to generate the timestamp for the
dates and then evaluate them as such eg.

for today's timestamp:
$td = mktime( 0,0,0, date('m'), date('d'), date('Y') )

break up the incoming date
list ($day, $month, $year) = split ('[/.-]', $datetocheck );

$id = mktime( 0,0,0,$month, $day, $year )

then you can use the evaluation '$td > $id'


----- Original Message -----
From: TV Karthick Kumar <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 4:34 PM
Subject: [PHP] Date Validation


> Hi all
>
>     I have some strange problem in Validating the date.
>
>     I am working on some web application which is like Events in an
Address
> book for our customers. The requirement is whenever the Event date is
passed
> today's date (crosses todays date), I should be able to allow the user
> delete the particular event (record) and should be deleted.
>
>     Here's my script, it's very simple and I am not able to get the exact
> results at all. Please help me.
>
>     <?
>     $td=date("d/m/Y");
>     echo $td;
>     echo "<br>";
>     $id='02/02/2001';
>     echo $id;
>
>     if ($td > $id) {
>      echo 'todays date is greater than id';
>      }
>     else
>     {
>      echo 'todays date is lesser than id';
>      }
>     ?>
>
>  -- The above script always prints the first echo statement saying that
> 'todays date is greater than <$id's value>'. Why is that so ?. What's the
> other way that I can validate this date ?.
>
>     Thanks in advance.
>
> ~ Karthick
>
>
>
> --
> 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]
>
>






But if the date is out of range for the unix timestamp, it wouldn't work.

Another "common" way of doing this is to make an integer using the the year,
month, and day. Ie 13. november 1287 = 12871113.
I made an example including a function:
It will split an the date using any non-numeric data. Year has to be 4
digits.

-Yurgh

<?
// DD MM YYYY format in input
function date2int( $date ) {
 list( $d, $m, $y ) = split( '[^0-9]', $date );
 $d = sprintf( "%02d", $d ); // Make sure the day and 
 $m = sprintf( "%02d", $m ); // month are two digits
 return "$y$m$d";
}

$a = "26 12 1972";
$b = "13.11.1976";
$c = "4-9-1192";

echo "$a ->".date2int( $a )."<br>";
echo "$b ->".date2int( $b )."<br>";
echo "$c ->".date2int( $c )."<br>";
?>

-----Original Message-----
From: Niel Zeeman [mailto:[EMAIL PROTECTED]]
Sent: 9. januar 2001 17:13
To: TV Karthick Kumar; php gen list
Subject: Re: [PHP] Date Validation


Hi
Just a suggestion ... try using mktime to generate the timestamp for the
dates and then evaluate them as such eg.

for today's timestamp:
$td = mktime( 0,0,0, date('m'), date('d'), date('Y') )

break up the incoming date
list ($day, $month, $year) = split ('[/.-]', $datetocheck );

$id = mktime( 0,0,0,$month, $day, $year )

then you can use the evaluation '$td > $id'


----- Original Message -----
From: TV Karthick Kumar <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 4:34 PM
Subject: [PHP] Date Validation


> Hi all
>
>     I have some strange problem in Validating the date.
>
>     I am working on some web application which is like Events in an
Address
> book for our customers. The requirement is whenever the Event date is
passed
> today's date (crosses todays date), I should be able to allow the user
> delete the particular event (record) and should be deleted.
>
>     Here's my script, it's very simple and I am not able to get the exact
> results at all. Please help me.
>
>     <?
>     $td=date("d/m/Y");
>     echo $td;
>     echo "<br>";
>     $id='02/02/2001';
>     echo $id;
>
>     if ($td > $id) {
>      echo 'todays date is greater than id';
>      }
>     else
>     {
>      echo 'todays date is lesser than id';
>      }
>     ?>
>
>  -- The above script always prints the first echo statement saying that
> 'todays date is greater than <$id's value>'. Why is that so ?. What's the
> other way that I can validate this date ?.
>
>     Thanks in advance.
>
> ~ Karthick
>
>
>
> --
> 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]





Have you installed both static and dynamic versions of libraries (i.e.,
libgd.so and libgd.a). When you just install gd (or any other library)
binary package, you get the dynamic one, and to get the static libs and
header files, you need gd-dev (on debian) or gd-devel (on redhat).

Same applies for other packages.

Anuradha

On Tue, 9 Jan 2001, James Snelling wrote:

> Hi, I have been trying to configure PHP 4 with GD, but not getting very far!
> 
> I'm running a red hat 7.0 box, fresh install with all packages apart from
> postgres, PHP and apache (I'll build them from tar.gz's later)
> 
> GD, Libpng, Zlib are all on the system by nature of the rpm's installed with
> the main linux install.
> 
> I've been using the configue option
> 
> ./configure --with-pgsql --with-apache=/usr/src/local/apache-_1.3.12 --with-
> gd-dir=/usr/lib/ --enable-track-vars
> 
> but the configure bombs out every time saying it cannot find libgd anywhere
> below the /usr/lib directory.
> 
> Has anyone else out there seen any web page tutorials that could help, or
> used php with GD?
> 
> Thanks in advance, James (Stressed out university student!)
> 
> 
> -- 
> 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've had the same problem. Try just --with-gd and no path i.e.

./configure --with-pgsql --with-apache=/usr/src/local/apache-_1.3.12 \
--with-gd --enable-track-vars

This forces PHP to do a "static" build of GD (someone who knows more about
this could
probably explain it better, anyone?).

I believe your original syntax of  --with-gd-dir=/usr/lib/  is wrong anyway
and should be --with-gd=/usr/lib
you'll also need the gd-devel-1.8.3-4.i386.rpm off the RH7 CD installed.

HTH,
Brad

----- Original Message -----
From: "James Snelling" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 11:30
Subject: [PHP] Installing PHP With GD


> Hi, I have been trying to configure PHP 4 with GD, but not getting very
far!
>
> I'm running a red hat 7.0 box, fresh install with all packages apart from
> postgres, PHP and apache (I'll build them from tar.gz's later)
>
> GD, Libpng, Zlib are all on the system by nature of the rpm's installed
with
> the main linux install.
>
> I've been using the configue option
>
>
./configure --with-pgsql --with-apache=/usr/src/local/apache-_1.3.12 --with-
> gd-dir=/usr/lib/ --enable-track-vars
>
> but the configure bombs out every time saying it cannot find libgd
anywhere
> below the /usr/lib directory.
>
> Has anyone else out there seen any web page tutorials that could help, or
> used php with GD?
>
> Thanks in advance, James (Stressed out university student!)
>
>
> --
> 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 encounter two kinds of problems while using MySQL (3.23.28) connections from PHP 
(4.0.4):
 1) with mysql_connect's, I am not able to open different connections to the same host 
with the same login without getting the same 'Ressouorce ID #i'. For example, running:
 -$id1=mysql_connect($thehost, $thelogin, $thepass);
 -$id2=mysql_connect($thehost, $thelogin, $thepass);
 returns $id1=1 and $id2=1, too. I really need to have distinct connections because of 
the connection class I use which associates one connction on each instantiated object. 
Why is it that it seems impossible to have two simultaneous connections to MySQL, 
therefore selecting a database on $id1 selects it on $id2, obviously?
 2) I have to use mysql_pconnect's to ensure that all different database servers are 
always available and connected in PHP, but it doesn't seem to work: 
 -$id1=mysql_pconnect($thehost, $thelogin, $thepass);
 -$id2=mysql_pconnect($thehost, $thelogin, $thepass);
 with theses two connections, two different IDs are returned and, having tested 
efficiency of both solutions, I can say that it takes longer to run 1000 connect's 
thant 1000 pconnect's. then tests was:
 -1 x connect, 1x pconnect
 -timer1 starts
 -100 x connect
 -timer1 stops, timer2 starts
 -100 x pconnect
 -timer2 stops
With his method, both connections should have been established and then the bunch of 
connect's should last 100x the time of one connect, and the 100x pconnect should be 
really fast as the db is already connected. No, for me it seems like times are about 
Below is the code I use to show the difference between the two methods. It seems like 
the mysql_pconnect causes only one connextion to the MySQL server ('mysqladmin 
processlist' shows a process not dying even when then PHP script has ended), but each 
'pconnect' takes really longer than a 'connect', whereas 'pconnect' should do really 
faster after the first connection.
------------------------------------------------------------------- 
$ta=new c_Timer();
$tb=new c_Timer();

$ta->start();
for ($i=0; $i<$NB; $i++)
 {
 $link = mysql_connect ($host, "test");
 echo "[".(int)$link."]";
 // mysql_close($link);
 }
$xa=$ta->stop_ms();

echo "-";

$tb->start();
for ($i=0; $i<$NB; $i++)
 {
 $link=mysql_pconnect ($host, "test");
 echo "[".(int)$link."]";
 }
$xb=$tb->stop_ms();

echo "<li>nb=$NB";
echo "<li>ta=$xa ms";
echo "<li>tb=$xb ms";
------------------------------------------------------------------- 
 If you have any suggestion or idea about this problem, you would be very nice to help 
me, my email is: [EMAIL PROTECTED]
 Many thanks!





Hi,

How can I remove an elent from an array.

ie.  myarray=(1,2,3,4,5);
     $num=3;

     while (list($key,$value) = each($myarray)) {
           if($num==$value) {
             remove 3 from array so $myarray contains 1,2,4,5
           }
         } 

Thanks

Ajdin




Hi!

  I think that array_splice function can do that.
  try...

  $myarray=array(1,2,3,4,5);
  array_splice( $myarray, 3, 1);        
  foreach( $myarray as $element )
    print "$element<br>";

this code remove 4 from $myarray

regards
Marcelo Gulin


AJDIN BRANDIC escribió:
> 
> Hi,
> 
> How can I remove an elent from an array.
> 
> ie.  myarray=(1,2,3,4,5);
>      $num=3;
> 
>      while (list($key,$value) = each($myarray)) {
>            if($num==$value) {
>              remove 3 from array so $myarray contains 1,2,4,5
>            }
>          }
> 
> Thanks
> 
> Ajdin
> 
> --
> 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]




Hello AJDIN,

Tuesday, January 09, 2001, 6:02:00 PM, you wrote:

AB> ie.  myarray=(1,2,3,4,5);
AB>      $num=3;

AB>      while (list($key,$value) = each($myarray)) {
AB>            if($num==$value) {
AB>           //   remove 3 from array so $myarray contains 1,2,4,5

+              unset ($myarray[$key];

                 
AB>            }
AB>          } 


-- 
Best regards,
Max A. Derkachev mailto:[EMAIL PROTECTED]
Symbol-Plus Publishing Ltd.
phone: +7 (812) 324-53-53
http://www.Books.Ru -- All Books of Russia
 






should be:
unset ($myarray[$key]);

sorry.






-- 
Best regards,
Max A. Derkachev mailto:[EMAIL PROTECTED]
Symbol-Plus Publishing Ltd.
phone: +7 (812) 324-53-53
http://www.Books.Ru -- All Books of Russia
 






OK,  Thanks all

Ajdin


On Tue, 9 Jan 2001, Max A. Derkachev wrote:

> Hello AJDIN,
> 
> Tuesday, January 09, 2001, 6:02:00 PM, you wrote:
> 
> AB> ie.  myarray=(1,2,3,4,5);
> AB>      $num=3;
> 
> AB>      while (list($key,$value) = each($myarray)) {
> AB>            if($num==$value) {
> AB>           //   remove 3 from array so $myarray contains 1,2,4,5
> 
> +              unset ($myarray[$key];
> 
>                  
> AB>            }
> AB>          } 
> 
> 
> -- 
> Best regards,
> Max A. Derkachev mailto:[EMAIL PROTECTED]
> Symbol-Plus Publishing Ltd.
> phone: +7 (812) 324-53-53
> http://www.Books.Ru -- All Books of Russia
>  
> 
> 
> 




Hello,

I am installing PHP4 on my system soon and I am wondering about the
prospects of making it so that .php scripts will execute with the
privileges of their owner so that people don't have to chmod 777 their
flatfile databases.

The manual at http://www.php.net/manual/html/install.unix.html says
"However, the CGI version enables Apache users to run different
PHP-enabled pages under different user-ids."

The wording would imply that I must compile PHP as CGI (which is
inefficient?) in order to be able to do this. Is this true? Is there a way
I compile it as an Apache module, but still have it suid to the script
owner?

Thanks,

-Philip Mak ([EMAIL PROTECTED])






> The wording would imply that I must compile PHP as CGI (which is
> inefficient?) in order to be able to do this. Is this true? Is there a way
> I compile it as an Apache module, but still have it suid to the script
> owner?

No - because mod_php runs the scripts within the
apache process, meaning that there's no way to set
the effective user id per user (as the only
running process is httpd).

best,
jeff






I've done that too, but it's a real pain.

Does anyone know how php searches for include files?

Does everyone use the entire path?

Best regards,
 Randy   


Monday, January 08, 2001, 1:02:52 PM, you wrote:

W> I use the full path to help fix this problem. This way no matter where you
W> drop it in, it will work...

W> <?php include ('/home/sites/home/web/cgi-bin/ads/ad.php');?>

W> -----Original Message-----
W> From: Randy [mailto:[EMAIL PROTECTED]]
W> Sent: Monday, January 08, 2001 2:02 PM
W> To: [EMAIL PROTECTED]
W> Subject: [PHP] include path confusion


W> I'm confused on what should be a simple issue - where does php
W> look for an include file in the following example? My test
W> results seem very confusing and the docs never mention it.

W> In the program:
W>   include "../test/sample.php";

W> In php.ini:
W>   include_path="../include"

W> Does php:
W>   A. Look in the dir "../test" for sample.php first and if not found,
W>   look in "../include" for sample.php?
W>   B. Ignore the dir "../test/" and look in "../include" for
W>   sample.php?
W>   C. Look in dir "../test" for sample.php and if not found, look
W>   in "../include" for "../test/sample.php"? (and can't find it as
W>   invalid)
W>   D. Look only in dir "../include" for "../test/sample.php"? (and
W>   can't find it as invalid)

W> Does it work exactly the same for REQUIRE?

W> TIA
W> --
W> Best regards,
W>  Randy



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






Where can I get information on error codes like: XML error 1 0?  The
functions in php to get XML error codes don't seem to be talking about this.

Thanks,
April





Hello everyone--
I was wondering if PHP can call Windows COM objects in memory?  If PHP can
do this does anyone know how to do it or can you point me in the direction
were I can pissibly figure it out.  Also, does anyone know if PHP can call
an Extended Fetch?
Thanks,
Jay Paulson




I don't know, but I was glancing through an article on PHP in the current 
issue of Dr. Dobb's Journal last week. At the very end I *think* there was 
an example of calling a COM object. It was a VbScript <-> PHP comparision. 
Have a look, might help.

Miles

(Yes, I've been known to make notes while in the newsstand.)

At 10:01 AM 01/09/2001 -0600, Paulson, Joseph V. \"Jay\" wrote:
>Hello everyone--
>I was wondering if PHP can call Windows COM objects in memory?  If PHP can
>do this does anyone know how to do it or can you point me in the direction
>were I can pissibly figure it out.  Also, does anyone know if PHP can call
>an Extended Fetch?
>Thanks,
>Jay Paulson
>
>--
>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]







Or you could just look at the phpbuilder.com column on using COM objects in php, or 
you could RTFM at the php.net site. just type in php.net/com and see what happens. 

We use php and com here a lot, and while the implementation lacks a few features of 
the asp/vb implementation it's handy when migrating from NT/ASP to NT/PHP.


On Tue, 9 Jan 2001, Miles Thompson wrote:

> I don't know, but I was glancing through an article on PHP in the current 
> issue of Dr. Dobb's Journal last week. At the very end I *think* there was 
> an example of calling a COM object. It was a VbScript <-> PHP comparision. 
> Have a look, might help.
> 
> Miles
> 
> (Yes, I've been known to make notes while in the newsstand.)
> 
> At 10:01 AM 01/09/2001 -0600, Paulson, Joseph V. \"Jay\" wrote:
> >Hello everyone--
> >I was wondering if PHP can call Windows COM objects in memory?  If PHP can
> >do this does anyone know how to do it or can you point me in the direction
> >were I can pissibly figure it out.  Also, does anyone know if PHP can call
> >an Extended Fetch?
> >Thanks,
> >Jay Paulson
> >
> >--
> >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]
> 
> 
> 
> 
> 





> Or you could just look at the phpbuilder.com column on using COM objects
in php, or you could RTFM at the php.net site. >just type in php.net/com and
see what happens.
>
> We use php and com here a lot, and while the implementation lacks a few
features of the asp/vb implementation it's handy >when migrating from NT/ASP
to NT/PHP.

Has anyone worked out how to communicate with a ActiveX control that's
actually embedded in a web page from PHP?

Cheers,
Brad






Does anyone know how I can sign into a site through a shell (Telnet, FTP
program, etc) with the PHP user?  How can I find out the password that PHP
uses (or does it...)?  Thanks.

Jason






Hello Jason, 

(JJ == "Jason Jacobs") [EMAIL PROTECTED] writes:

JJ> Does anyone know how I can sign into a site through a shell
JJ> (Telnet, FTP program, etc) with the PHP user?

$ ps aux | egrep '([w]ww|[n]obody)' | su `awk '{ print $1 }'`

or

$ which php | ls -l `awk '{ print $1 }'`

..And look in columns 3 and 4 for user and group, respectively.


JJ> How can I find out the password that PHP uses (or does it...)?

If it is a CGI, it's the password of the user that owns the
executable. (there may also be setuid/setgid issues but I'm not
getting into that).

If it's running as an Apache static or DSO, it's the user the
webserver is running as.

JJ> Jason

-Brian
--
Structured Programming supports the law of the excluded muddle.






Hello all PHP'ers

What is the best way to upgrade from PHP 4.03pl1 to 4.04?

I'm running Apache on RedHat with 4.03pl1 compliled from source.
Do I just run ./condigure > make > make install to upgrade or do I have to
remove elements from the previous version?


Thanks,

        - Scott

___________________________________

Scott A. Gerhardt  P.Geo.
Gerhardt Information Technologies
[EMAIL PROTECTED]
___________________________________






> -----Original Message-----
> From: Scott Gerhardt [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 09, 2001 5:20 PM
> To: PHP List
> Subject: [PHP] Upgrading to PHP 4.04
> 
> 
> Hello all PHP'ers
> 
> What is the best way to upgrade from PHP 4.03pl1 to 4.04?
> 
> I'm running Apache on RedHat with 4.03pl1 compliled from source.
> Do I just run ./condigure > make > make install to upgrade or 
> do I have to
> remove elements from the previous version?
> 
Maybe you should try the --with-apxs option. Then you'll have nothing to do
but ./configure --with-apxs=/path/to/apxs (normally in apache/bin)
--with-other-options, make and make install. It worked just fine for me.

Best Regards.




Hi all,

I am PHP develope newbie. I now meet a problem. What I want is, when someone
call my function, it will get the toppest caller's name/path and check its
MD5SUM and create time, if they are legal, I will return the the secret data
they want.
For example, someone visit the url: http://mydomain.com/test.php
in test.php,
 include ("func.inc")
in func.inc,
 call_user_function load_name <== this is the function I want
 this function will check the md5sum and create time of the script test.php,
if they match the condition, it will return the "value" according to the
parameter "name"
I think this function should not be a script. Because if it is script, any
hacker can remove the authtication in this function and call the decrypt
function to get my secret data directly.

So in this case, if a hacker intrudes my website, he can change anything,
but he can't get something like database passwords. This is exactly what I
want.

Actually I never develped any php lib or extention before. Can anybody give
me a suggestion? I really don't know how to do that. I just know what I
want.

Here is my question:
Is there any easy way to do that? e.g. call an external program. But how to
pass the top caller's name to the external program?
How to develpe and add a lib or extension or user function to php. I want to
make things easy. The idea case is, I don't need to change my current php,
just add the new module to the current php.
How to get the top caller's name in a extension or lib or user function. (I
use language C)

Allen Zhao









Hi!

I have a server running qmail and php on which I'm trying to do some php 
processing of incoming e-mail.
I have a virtual domain set up like this:

'.qmail-virtualdomain.com-default'
which contains the following:
'|/usr/local/php-4.0.1pl2/php /home/nille/script.php -q'

The script script.php looks like this:


<?php

mail($SENDER, "A subject", "The body");

?>

And what it does off course is just answering everybody who sends an email 
to any adress in the domain virtualdomain.com with an e-mail with the 
subject "A subject" and the body "The body". This isn't very helpful now is 
it? ;-) In case you wondered the variable $SENDER is a qmail environment 
variable.

What I would like to know is if there is a nice way of parsing out the body 
of the incoming message and place that into a variable and also the same 
thing with the subject so that I can process these using som regular 
expressions and respond to certain keywords using custom templates.

Any ideas?

- Nille





Hi all

I switched my provider and now i often get this error message 
when using mysql from my php-skripts:

"Warning: MySQL Connection Failed: Can't create a new
thread (errno 11). If you are not out of available
memory, you can consult the manual for a possible
OS-dependent bug in include/dbcall.inc.php3 on line 6
Unable to select database"

could someone tell me what this exactly want's to tell me?
and even better : what the admin of the server can do about it?

thanks for any help
Sebastian






Hello Sebastian, 

(SS == "Sebastian Stadtlich") [EMAIL PROTECTED] writes:

SS> I switched my provider and now i often get this error message when
SS> using mysql from my php-skripts:

SS> "Warning: MySQL Connection Failed: Can't create a new
SS> thread (errno 11). If you are not out of available
SS> memory, you can consult the manual for a possible
SS> OS-dependent bug in include/dbcall.inc.php3 on line 6
SS> Unable to select database"

SS> could someone tell me what this exactly want's to tell me?
SS> and even better : what the admin of the server can do about it?

*I'm no expert on this topic*, but..

Ask the admin to check the ulimit for mysql and to place this in it's
startup script:

# Increase number of file descriptors
ulimit -n 1024

I've had similar problems in the past. Also check the archives at
http://www.deadly.org/ as the site owner ran into that problem quite a
while ago. A whole article about it is there somewhere.

-Brian
--
Press any key to continue, or any other key to quit.






This is what you are looking for:

http://hshelp.com/mrspecial.html#ebphp

I have never used it, so I can't say if it works or not.  But if you do get
it working, please give us a feedback.

Vikram Kulkarni

-----Original Message-----
From: n e t b r a i n [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 08, 2001 3:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP] R: [PHP] HomeSite & color coding ...


****** Please Note: This message came from the INTERNET. ******

Hi Joe

>Just go to Options/Settings/Color Coding and select PHP. You can change all
>the colors from there.

Hmmm, yes you're right but ... I'm talking about the possibility of use
"function insight" and "color coding" with the (new) current php function
that are not listed in ExpressionElements.vtm ...

For example, with my configuration this (and more):

foreach
show_browser()
[all swf func]
etc. etc. etc.

are not highlighted and there are not "fuction insight" available ...
so, my question is: which HomeSite's file controll this behaviour?

Many thanks in advance
max




-- 
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]


*****************************************************************************
This message may contain privileged and confidential information. If you
think, for any reason, that this message may have been addressed to you in
error, you must not disseminate or copy this message, or use its content
as the basis for taking any action. Further, we would ask you to notify
us immediately by return e-mail, telephone or facsimile.
*****************************************************************************




Hi again,

I am generating a randum number but before inserting it into a table I 
want to make sure that onother number with the same value doesn't exist 
in the table. Here is what I have:

srand((double)microtime()*1000000);
    $ran_num = rand(10000, 99999); 

    $query01 = "SELECT thisnum FROM mytable";
    $results = mysql_query($query01) or die("Failed on select 
mytable!");

      while ($result = mysql_fetch_array($results)) {
        $thisnum=$result['thisnum'];
        if($ran_num==$thisnum) {
          srand((double)microtime()*1000000);
          $ran_num = rand(10000, 99999); 
          reset($results)
 // will this reset the pointer and will the 
while loop start from position 0??? If not how do I force the check to 
start from position 0?
        }  
      }

I donot want to use autoincrement???

Thanks

Ajdin





Hi all,

Any one knows how to move a directory to another directory, without using
copy and delete?


--
Saludos,

David.







Hey David,

Go here :

    http://www.php.net/manual/ref.exec.php

And consider using something like : mv -r  I'd assume permission
issues exist so consider that :)


philip


On Tue, 9 Jan 2001, David Vázquez wrote:

> 
> Hi all,
> 
> Any one knows how to move a directory to another directory, without using
> copy and delete?
> 
> 
> --
> Saludos,
> 
> David.
> 
> 
> 
> -- 
> 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]
> 






Philip Olson wrote:
>     http://www.php.net/manual/ref.exec.php
>
> And consider using something like : mv -r  I'd assume permission
> issues exist so consider that :)

mv should suffice (without -r)

This doesnt work when source and destination are on different partitions, at 
least on UNIX.
By the way, rename() should do the same, there is no need to use exec().

http://www.php.net/manual/function.rename.php

regards
Wagner

-- 
One maniac alone can do what 20 together cannot




Helo all. I just compiled mod_php 4.0.4 statically into Apache
1.3.12 on a Solaris/SPARC machine. I was surprised to see that my
httpd binary jumped from 840592 bytes to 6841916 bytes! That seems a
little excessive to me, especially considering that my httpd binary
on my FreeBSD machine with mod_php 4.0.3 in it is only 2770550
bytes. Anyone have any idea what's going on?

Thanks.
-- Dan
________________________________________________________________________
 [EMAIL PROTECTED]                                Daniel G. Delaney
 www.Dionysia.org/~dionysos/
 PGP Public Key: /~dionysos/pgp.html
------------------------------------------------------------------------
We have reason to believe that man first walked upright to free
his hands for masturbation.
                                           -- Lily Tomlin





Which external libraries did you compile in?  And what happens when you do
a "strip httpd" ?

-Rasmus

On Tue, 9 Jan 2001, Dan Delaney wrote:

> Helo all. I just compiled mod_php 4.0.4 statically into Apache
> 1.3.12 on a Solaris/SPARC machine. I was surprised to see that my
> httpd binary jumped from 840592 bytes to 6841916 bytes! That seems a
> little excessive to me, especially considering that my httpd binary
> on my FreeBSD machine with mod_php 4.0.3 in it is only 2770550
> bytes. Anyone have any idea what's going on?
>
> Thanks.
> -- Dan
> ________________________________________________________________________
>  [EMAIL PROTECTED]                                Daniel G. Delaney
>  www.Dionysia.org/~dionysos/
>  PGP Public Key: /~dionysos/pgp.html
> ------------------------------------------------------------------------
> We have reason to believe that man first walked upright to free
> his hands for masturbation.
>                                            -- Lily Tomlin
>
>
> --
> 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]
>





On Tue, 9 Jan 2001, Rasmus Lerdorf wrote:
> Which external libraries did you compile in?

This is my configure line for php:

./configure \
--with-apache=/clients/build/apache_1.3.12 \
--with-mysql=/usr/local/mysql \
--with-config-file-path=/usr/local/apache/conf \
--enable-debug=no


> And what happens when you do a "strip httpd" ?

That did it. When I did strip httpd it shrank it to 1760900 bytes

Thanks a lot.
--Dan
________________________________________________________________________
 [EMAIL PROTECTED]                                Daniel G. Delaney
 www.Dionysia.org/~dionysos/
 PGP Public Key: /~dionysos/pgp.html
------------------------------------------------------------------------
I doubt, therefore I might be.





I have been using PHP to send out a monthly newsletter to around 50 emails or 
so but now my list is growing I have concerns that PHP will not be able to 
handle it any longer as this has been said in the past on this forum.

Has anyone used any other systems for their Newsletters which are easy to 
setup, possibly ones that use MySQL would be great, and a link to where I can 
find info about it.

TIA

Ade




We send thousands with PHP - I dont' think it's PHP so much as your hardware that
will be the bottleneck.


[EMAIL PROTECTED] wrote:

> I have been using PHP to send out a monthly newsletter to around 50 emails or
> so but now my list is growing I have concerns that PHP will not be able to
> handle it any longer as this has been said in the past on this forum.
>
> Has anyone used any other systems for their Newsletters which are easy to
> setup, possibly ones that use MySQL would be great, and a link to where I can
> find info about it.
>
> TIA
>
> Ade
>
> --
> 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 agree, and even the limit of the hardware is fairly difficult to reach..

Install Qmail on a 486 and I guess that you will probably still be able to
send half-a-million of emails a day...

Only three words of advice when using PHP sending email..:

1. Make sure that you register in your database to which addresses a email
has send so that you can take-off where you left when
something goes wrong or breaks..

2. Set the time limit to 0 in this script to prevent it from stopping to
early..

3. Run this script via an cgi version of PHP on the command line.. This way
when thing go wrong you can stop it immediatly..
Also give it enought output.. This way you can see when the loop goes
wrong..
(This way you can prevent a script from accidently sending a few hundred SMS
messages to your mobile phone..)

Success..
Bye Bye
David




> We send thousands with PHP - I dont' think it's PHP so much as your
hardware that
> will be the bottleneck.
>
>
> [EMAIL PROTECTED] wrote:
>
> > I have been using PHP to send out a monthly newsletter to around 50
emails or
> > so but now my list is growing I have concerns that PHP will not be able
to
> > handle it any longer as this has been said in the past on this forum.
> >
> > Has anyone used any other systems for their Newsletters which are easy
to
> > setup, possibly ones that use MySQL would be great, and a link to where
I can
> > find info about it.
> >
> > TIA
> >
> > Ade
> >
> > --
> > 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]
>
>






Hey guys,

I wonder if U can help...

I have the following code that reads a cookie and deletes it and then resets a cookie 
of the same name.  However all it seems to do is delete the cookie and not set a new 
one.  Any ideas what I am missing?


$user = $HTTP_COOKIE_VARS["user"];

setcookie("user");
setcookie("user","$user",time()+1500,"/",".test.serve.co.uk",0);


Thanks in advance,
Abe




It makes no sense to delete and set.  Simply setting it will override the
previous.  Note also that using such a short expiry time puts you at the
mercy of people having the system clocks set correctly.  Many people
don't.  For short expiry cookies, I always do something like:

setcookie('user',$user.':'.time()+1500,0,'/','.test.serve.co.uk');

That is, put the timestamp in the value field.  This timestamp is relative
to the system clock on *my* server instead of the remote machine.  Then to
figure out it the cookie should actually be expired do:

  list($usr,$ti) = explode(':',$user);
  if($ti>time()) { ... do whatever you do when a cookie is expired ... }

-Rasmus

On Tue, 9 Jan 2001, Abe Asghar wrote:

>
> Hey guys,
>
> I wonder if U can help...
>
> I have the following code that reads a cookie and deletes it and then resets a 
>cookie of the same name.  However all it seems to do is delete the cookie and not set 
>a new one.  Any ideas what I am missing?
>
>
> $user = $HTTP_COOKIE_VARS["user"];
>
> setcookie("user");
> setcookie("user","$user",time()+1500,"/",".test.serve.co.uk",0);
>
>
> Thanks in advance,
> Abe
>





That makes sense Rasmus, but the reason I delete and reset the cookie is
because I am trying to measure activity and not just a set time.  So I have
the cookie reset every time somebody views a new page.  This way it expires
a set amount of time after they last clicked on a page.

However as you can see this doesn't work.  Is there a better way to do this
anyone knows?

Thanks,
Abe

----- Original Message -----
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Abe Asghar" <[EMAIL PROTECTED]>
Cc: "PHP General List" <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 5:24 PM
Subject: Re: [PHP] Cookie -> Delete -> Reset


> It makes no sense to delete and set.  Simply setting it will override the
> previous.  Note also that using such a short expiry time puts you at the
> mercy of people having the system clocks set correctly.  Many people
> don't.  For short expiry cookies, I always do something like:
>
> setcookie('user',$user.':'.time()+1500,0,'/','.test.serve.co.uk');
>
> That is, put the timestamp in the value field.  This timestamp is relative
> to the system clock on *my* server instead of the remote machine.  Then to
> figure out it the cookie should actually be expired do:
>
>   list($usr,$ti) = explode(':',$user);
>   if($ti>time()) { ... do whatever you do when a cookie is expired ... }
>
> -Rasmus
>
> On Tue, 9 Jan 2001, Abe Asghar wrote:
>
> >
> > Hey guys,
> >
> > I wonder if U can help...
> >
> > I have the following code that reads a cookie and deletes it and then
resets a cookie of the same name.  However all it seems to do is delete the
cookie and not set a new one.  Any ideas what I am missing?
> >
> >
> > $user = $HTTP_COOKIE_VARS["user"];
> >
> > setcookie("user");
> > setcookie("user","$user",time()+1500,"/",".test.serve.co.uk",0);
> >
> >
> > Thanks in advance,
> > Abe
> >
>





If you delete and set the cookie on the same request the delete is
completely redundant.  It serves no purpose whatsoever because of the way
cookies work and the way browsers accept them.  If you do:

  setcookie('abc',1);
  setcookie('abc',2);

This causes PHP to these headers:

  Set-Cookie: abc=1
  Set-Cookie: abc=2

The browser will only accept the second one.

However, in general there is nothing wrong with what you are doing.  Turn
on your cookie warnings in your browser or telnet to port 80 on your web
server and watch the raw cookies sent by your PHP script.  Make sure they
look the way you expect them to.

-Rasmus

On Tue, 9 Jan 2001, Abe Asghar wrote:

> That makes sense Rasmus, but the reason I delete and reset the cookie is
> because I am trying to measure activity and not just a set time.  So I have
> the cookie reset every time somebody views a new page.  This way it expires
> a set amount of time after they last clicked on a page.
>
> However as you can see this doesn't work.  Is there a better way to do this
> anyone knows?
>
> Thanks,
> Abe
>
> ----- Original Message -----
> From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
> To: "Abe Asghar" <[EMAIL PROTECTED]>
> Cc: "PHP General List" <[EMAIL PROTECTED]>
> Sent: Tuesday, January 09, 2001 5:24 PM
> Subject: Re: [PHP] Cookie -> Delete -> Reset
>
>
> > It makes no sense to delete and set.  Simply setting it will override the
> > previous.  Note also that using such a short expiry time puts you at the
> > mercy of people having the system clocks set correctly.  Many people
> > don't.  For short expiry cookies, I always do something like:
> >
> > setcookie('user',$user.':'.time()+1500,0,'/','.test.serve.co.uk');
> >
> > That is, put the timestamp in the value field.  This timestamp is relative
> > to the system clock on *my* server instead of the remote machine.  Then to
> > figure out it the cookie should actually be expired do:
> >
> >   list($usr,$ti) = explode(':',$user);
> >   if($ti>time()) { ... do whatever you do when a cookie is expired ... }
> >
> > -Rasmus
> >
> > On Tue, 9 Jan 2001, Abe Asghar wrote:
> >
> > >
> > > Hey guys,
> > >
> > > I wonder if U can help...
> > >
> > > I have the following code that reads a cookie and deletes it and then
> resets a cookie of the same name.  However all it seems to do is delete the
> cookie and not set a new one.  Any ideas what I am missing?
> > >
> > >
> > > $user = $HTTP_COOKIE_VARS["user"];
> > >
> > > setcookie("user");
> > > setcookie("user","$user",time()+1500,"/",".test.serve.co.uk",0);
> > >
> > >
> > > Thanks in advance,
> > > Abe
> > >
> >
>
>
> --
> 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]
>






Is there a special way in which I need to do this in php?

if (500 < $weight < 1000)  

Thanks,

Christopher C. M. Allen





> Is there a special way in which I need to do this in php?
>
> if (500 < $weight < 1000)

No special way, just the way it is typically done:

  if($weight > 500 && $weight < 1000)

-Rasmus





Is it possible using PHP to force a browser that isn`t already to full 
screen, I have seen some ASP sites that do it, just wondered if anyone could 
spare a snippet of code.

TIA

Ade




> Is it possible using PHP to force a browser that isn`t 
> already to full screen, I have seen some ASP sites that 
> do it, just wondered if anyone could spare a snippet of 
> code.

This would require Javascript.
But why would you want to?  I find it so incredibly
annoying when this happens and I make it a point
never to return to any site that does this...

Chris




Has nothing to do with PHP.  You would need some sort of JavaScript trick.
Find that ASP page you saw doing it and steal whatever JavaScript it
spews out that does this.  PHP can spew JavaScript as well as ASP can.

-Rasmus

On Tue, 9 Jan 2001 [EMAIL PROTECTED] wrote:

> Is it possible using PHP to force a browser that isn`t already to full
> screen, I have seen some ASP sites that do it, just wondered if anyone could
> spare a snippet of code.
>
> TIA
>
> Ade
>
> --
> 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]
>






you'd want to use javascript.

<script>
function fullScreen(URL) {
window.open(URL, 'nameOfWindow', 'fullscreen=yes');
}
</script>

make sense?

DanO


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 09, 2001 9:21 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Browser?


Is it possible using PHP to force a browser that isn`t already to full
screen, I have seen some ASP sites that do it, just wondered if anyone could
spare a snippet of code.

TIA

Ade

--
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]





Thanks Neil! It's working fine.
I got two questions now, I hope you have time to aswer them. The first one
might be too much to ask for, so don't mind to give me a short answer like
"You can't do that":

1. I don't want to handle warnings, only errors o even just fatal errors. I
tried setting error_reporting(), but this has no efect: all errors,
including warnings, are handled. Therefore, I need a way to know what type
of error has occurred. And, if i don't want to handle that error, how can I
return program control to line where the error happened?.

2. Where did you learned that? I want to know if there are other types of
handlers that I can register.

Thanks a lot.

-----Original Message-----
From: Neil Kimber [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 09 January, 2001 3:56 AM
To: Diego Fulgueira; Php-General
Subject: RE: [PHP] Simple error handling... but how? - Register your own
error-handler with PHP


You can register your own error-handler using the function:

        set_error_handler(<error_handler_function_name>);

Your customised error_handler will then get called whenever an error gets
called. Your function is passed the follwing parameters:

        function error_handler_function_name($errno, $errstr, $errfile, $errline)

This is nice as it passes you the file and line number as well as the error
number and the error string. You can then use this for sending your own
informational debug messages to the error handler by using the
trigger_error() routine.

The handler that I use dumps everything to a debug file - using error_log().
This is great as I get all of my parsing errors and informational debug
messages sent to the same place. By sending them to a file (rather than the
screen) you stop headers being sent, which in turn could cause you problems.

I believe that this functionality only became available in 4.02.

You may also want to check out the assert() functions. These are similar and
are great for putting sanity checks into your code. I think that the assert
handler code was the inspiration for the error handling code.

Hope this helps,
                        Neil


-----Original Message-----
From: Diego Fulgueira [mailto:[EMAIL PROTECTED]]
Sent: 08 January 2001 22:00
To: Php-General
Subject: [PHP] Simple error handling... but how?


Ok. This might have been widely discussed already, but I haven't been able
to find useful information about it:
How can I present a customized error page whenever a PHP error or warning
ocurrs?
Thanks in advance.


--
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]







Ques. 1
        I've also experienced the same thing. However, I'm not too concerned about
it as I normally try to write code that produces no warnings (better safe
than sorry). This is new functionality, so it's possible that it hasn't been
implemented very strongly. Since using an error handler I've picked up lots
(and I mean lots) of code problems, ranging from actual code errors through
to redefinitions or no declaration warnings. I just go through and fix each
one as I find them. It only takes a second and forces good coding practices.
        As for returning control to the program, this happens anyway. If the error
isn't fatal then you'll get a message logged and then control will simply
return. Maybe you mean that you want your error handler to ignore certain
errors. Not too sure of the best approach. It would be nice if the
error_reporting() method worked correctly.

Ques. 2
        I found this functionality mentioned in the change dox for 4.02. I was
already using asserts throughout my code and had been waiting for similar
functionality regarding error handling. You can see the release notes here:

http://www.php.net/ChangeLog-4.php

search for 'error handler'
There are some other handlers that are available - but they're of little use
to me and I don't use them.

Regards,
                Neil



-----Original Message-----
From: Diego Fulgueira [mailto:[EMAIL PROTECTED]]
Sent: 09 January 2001 17:32
To: Php-General; Neil Kimber
Subject: RE: [PHP] Simple error handling... but how? - Register your own
error-handler with PHP


Thanks Neil! It's working fine.
I got two questions now, I hope you have time to aswer them. The first one
might be too much to ask for, so don't mind to give me a short answer like
"You can't do that":

1. I don't want to handle warnings, only errors o even just fatal errors. I
tried setting error_reporting(), but this has no efect: all errors,
including warnings, are handled. Therefore, I need a way to know what type
of error has occurred. And, if i don't want to handle that error, how can I
return program control to line where the error happened?.

2. Where did you learned that? I want to know if there are other types of
handlers that I can register.

Thanks a lot.

-----Original Message-----
From: Neil Kimber [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 09 January, 2001 3:56 AM
To: Diego Fulgueira; Php-General
Subject: RE: [PHP] Simple error handling... but how? - Register your own
error-handler with PHP


You can register your own error-handler using the function:

        set_error_handler(<error_handler_function_name>);

Your customised error_handler will then get called whenever an error gets
called. Your function is passed the follwing parameters:

        function error_handler_function_name($errno, $errstr, $errfile, $errline)

This is nice as it passes you the file and line number as well as the error
number and the error string. You can then use this for sending your own
informational debug messages to the error handler by using the
trigger_error() routine.

The handler that I use dumps everything to a debug file - using error_log().
This is great as I get all of my parsing errors and informational debug
messages sent to the same place. By sending them to a file (rather than the
screen) you stop headers being sent, which in turn could cause you problems.

I believe that this functionality only became available in 4.02.

You may also want to check out the assert() functions. These are similar and
are great for putting sanity checks into your code. I think that the assert
handler code was the inspiration for the error handling code.

Hope this helps,
                        Neil


-----Original Message-----
From: Diego Fulgueira [mailto:[EMAIL PROTECTED]]
Sent: 08 January 2001 22:00
To: Php-General
Subject: [PHP] Simple error handling... but how?


Ok. This might have been widely discussed already, but I haven't been able
to find useful information about it:
How can I present a customized error page whenever a PHP error or warning
ocurrs?
Thanks in advance.


--
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]







a few days ago I asked you this:
____________________
when I do a mysql_query on php, like 

$result=mysql_query("select * from counter where date='2001-01-06'");

In case of there is no date='2001-01-06', what should be the contents of
$result?

How can I know that was no data of '2001-01-06' in database?
_____________________

you answer me like that:

$hoje=date("'Y-m-d'");
if (mysql_query("select unique,total from counter where data=$hoje")){
  echo "true";
}else{
  echo "false";
}

At the begining it was working. But now returns always true! I can put
anything, like "... where data='1999-05-05'", that it returns true, but
there is no date='1999-05-05' at database.

I was thinking that maybe the PHP4 server is not good... 

well, someone know what the solution.

thanks,

Augusto Cesar Castoldi





> when I do a mysql_query on php, like
>
> $result=mysql_query("select * from counter where date='2001-01-06'");
>
> In case of there is no date='2001-01-06', what should be the contents of
> $result?
>
> How can I know that was no data of '2001-01-06' in database?
> _____________________
>
> you answer me like that:
>
> $hoje=date("'Y-m-d'");
> if (mysql_query("select unique,total from counter where data=$hoje")){
>   echo "true";
> }else{
>   echo "false";
> }

This answer is incorrect.  mysql_query() will return true if the query
sent is valid and a result set is returned.  A result set with 0 elements
is still a valid result set.  You want something like this:

  $result=mysql_query(...)
  if(mysql_numrows($result) > 0) {
       ... rows found ...
  } else {
       ... no rows found ...
  }

-Rasmus





Double check the select buy having php print the variable.
For example:

$SELECT_TXT = "SELECT * FROM";
print("$SELECT_TXT");
$SELECT_QRY = MYSQL_QUERY($SELECT_TXT);

Try that and then manually run the $SELECT_TXT on your mysql server and see
if the results are different and let us know.

-nc
----------------------------------------------------------------------
.:: Nathan Cook                            - Network/Security Admin
office:  208.343.3110                   - Web Programmer
email:   [EMAIL PROTECTED]         - Qmail Admin
pager:  208.387.9983                   - MIS Admin
-----------------------------------------------------------------------
----- Original Message -----
From: "Augusto Cesar Castoldi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 10:33 AM
Subject: [PHP] mysql_query


> a few days ago I asked you this:
> ____________________
> when I do a mysql_query on php, like
>
> $result=mysql_query("select * from counter where date='2001-01-06'");
>
> In case of there is no date='2001-01-06', what should be the contents of
> $result?
>
> How can I know that was no data of '2001-01-06' in database?
> _____________________
>
> you answer me like that:
>
> $hoje=date("'Y-m-d'");
> if (mysql_query("select unique,total from counter where data=$hoje")){
>   echo "true";
> }else{
>   echo "false";
> }
>
> At the begining it was working. But now returns always true! I can put
> anything, like "... where data='1999-05-05'", that it returns true, but
> there is no date='1999-05-05' at database.
>
> I was thinking that maybe the PHP4 server is not good...
>
> well, someone know what the solution.
>
> thanks,
>
> Augusto Cesar Castoldi
>
>
> --
> 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]
>
>





that`s out of my knowledge.

I did not understand.

augusto cesar castoldi

On Tue, 9 Jan 2001, Nathan Cook wrote:

> Double check the select buy having php print the variable.
> For example:
> 
> $SELECT_TXT = "SELECT * FROM";
> print("$SELECT_TXT");
> $SELECT_QRY = MYSQL_QUERY($SELECT_TXT);
> 
> Try that and then manually run the $SELECT_TXT on your mysql server and see
> if the results are different and let us know.
> 
> -nc
> ----------------------------------------------------------------------
> .:: Nathan Cook                            - Network/Security Admin
> office:  208.343.3110                   - Web Programmer
> email:   [EMAIL PROTECTED]         - Qmail Admin
> pager:  208.387.9983                   - MIS Admin
> -----------------------------------------------------------------------
> ----- Original Message -----
> From: "Augusto Cesar Castoldi" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 09, 2001 10:33 AM
> Subject: [PHP] mysql_query
> 
> 
> > a few days ago I asked you this:
> > ____________________
> > when I do a mysql_query on php, like
> >
> > $result=mysql_query("select * from counter where date='2001-01-06'");
> >
> > In case of there is no date='2001-01-06', what should be the contents of
> > $result?
> >
> > How can I know that was no data of '2001-01-06' in database?
> > _____________________
> >
> > you answer me like that:
> >
> > $hoje=date("'Y-m-d'");
> > if (mysql_query("select unique,total from counter where data=$hoje")){
> >   echo "true";
> > }else{
> >   echo "false";
> > }
> >
> > At the begining it was working. But now returns always true! I can put
> > anything, like "... where data='1999-05-05'", that it returns true, but
> > there is no date='1999-05-05' at database.
> >
> > I was thinking that maybe the PHP4 server is not good...
> >
> > well, someone know what the solution.
> >
> > thanks,
> >
> > Augusto Cesar Castoldi
> >
> >
> > --
> > 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]
> 





I think that's almost working now.

It appears on browser:
____________
Warning: Supplied argument is not a valid MySQL result resource in
/home/cco/castoldi/public_html/teste/index.php on line 10
No Rows founded 
_____________

The php code is:
________
if (mysql_numrows($result) > 0) {
  echo "Rows founded";
} else {
  echo "No Rows founded";
}
_______

What is this message?


thanks,

Augusto Cesar Castoldi

On Tue, 9 Jan 2001, Rasmus Lerdorf wrote:

> > when I do a mysql_query on php, like
> >
> > $result=mysql_query("select * from counter where date='2001-01-06'");
> >
> > In case of there is no date='2001-01-06', what should be the contents of
> > $result?
> >
> > How can I know that was no data of '2001-01-06' in database?
> > _____________________
> >
> > you answer me like that:
> >
> > $hoje=date("'Y-m-d'");
> > if (mysql_query("select unique,total from counter where data=$hoje")){
> >   echo "true";
> > }else{
> >   echo "false";
> > }
> 
> This answer is incorrect.  mysql_query() will return true if the query
> sent is valid and a result set is returned.  A result set with 0 elements
> is still a valid result set.  You want something like this:
> 
>   $result=mysql_query(...)
>   if(mysql_numrows($result) > 0) {
>        ... rows found ...
>   } else {
>        ... no rows found ...
>   }
> 
> -Rasmus
> 
> 
> -- 
> 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]
> 





> It appears on browser:
> ____________
> Warning: Supplied argument is not a valid MySQL result resource in
> /home/cco/castoldi/public_html/teste/index.php on line 10
> No Rows founded
> _____________
>
> The php code is:
> ________
> if (mysql_numrows($result) > 0) {
>   echo "Rows founded";
> } else {
>   echo "No Rows founded";
> }
> _______
>
> What is this message?

That means your $result variable is invalid which usually happens when you
query fails.  Do this:

  $result = mysql_query(...);
  if(!$result) echo mysql_error();

-Rasmus





How do I use PHP's mail function to send email with an attachment?

Thanks,

Ken






----- Original Message ----- 
From: "cmead" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 1:04 PM
Subject: Re: php-general Digest 9 Jan 2001 11:19:11 -0000 Issue 444


> Hi,
> 
> I can't seem to view the .ezm files from the list Digest.
> 
> Can someone please tell me how they do this thanks
> 
> Oh BTW I'm using win98 box to check my mail cause Netscape on Linux just
> doesnt cut it
> 
> CM
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 09, 2001 6:19 AM
> Subject: php-general Digest 9 Jan 2001 11:19:11 -0000 Issue 444
> 
> 
> 





How do I use PHP's mail function to send email with an attachment?

Thanks,

Ken





Ken-

For some explanation, check out :

    http://www.faqts.com/knowledge_base/view.phtml/aid/1686/fid/384
    
A couple popular mail classes to do this nicely can be found  here :

    http://www.heyes-computing.net/scripts/
    
    http://phpclasses.upperdesign.com/browse.html?package=32

Regards,

Philip Olson
http://www.cornado.com/


On Tue, 9 Jan 2001, kmurrah wrote:

> How do I use PHP's mail function to send email with an attachment?
> 
> Thanks,
> 
> Ken
> 
> 
> -- 
> 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]
> 





Hi!

 take a look at http://phpclasses.upperdesign.com/ and browse for email
classes
 
regards
Marcelo Gulin


kmurrah escribió:
> 
> How do I use PHP's mail function to send email with an attachment?
> 
> Thanks,
> 
> Ken
> 
> --
> 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]




Platform info:
Apache 1.3.14
PHP 4.0.4
JDK 1.2.2 FCS
RedHat 7.0 (all updates applied from RHN)

Problem:
In order to get ext/java to compile correctly, I had to hard code values
into ext/java/config.m4 - apparently it wasn't able to autodetect all
the proper lib settings to be able to compile and to allow configure to
complete successfully.  I can include a diff of the config.m4 if 
necessary and a description of the problems I was experiencing before
modifying config.m4.

Note: ext/java works ... I'm able to instantiate new Java classes (both
system & ones I've provided).  However, after two script use ext/java
(doesn't seem to matter how many Java classes are instantiated - it
appears to be a problem with creating the JVM), I get the following
message in my syslog:

httpd: PHP Fatal error:  Unable to create Java Virtual Machine in
<myfile> on line 54

No subsequent loads can access Java classes - I have to restart Apache. 
When I do this, the following appears in the Apache error_log:

[Mon Jan  8 17:45:14 2001] [notice] Apache/1.3.14 (Unix) PHP/4.0.4
configured -- resuming normal operations
[Mon Jan  8 17:45:14 2001] [notice] suEXEC mechanism enabled (wrapper: 
/usr/local/apache/bin/suexec)
security properties not found. using defaults.
security properties not found. using defaults.
security properties not found. using defaults.
SIGSEGV   11*  segmentation violation
    si_signo [11]: SIGSEGV   11*  segmentation violation
    si_errno [0]: Success
    si_code [0]: SI_USER [pid: 0, uid: 0]
        stackpointer=0xbf5ff1f4

Full thread dump Classic VM (Linux_JDK_1.2.2_FCS, native threads):
    "Thread-0" (TID:0x411506a8, sys_thread_t:0x819bd28, state:CW, native
ID:0xc04) prio=5
    "Reference Handler" (TID:0x411433b0, sys_thread_t:0x8196b20,
state:CW, native ID:0x803) prio=10
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java, Compiled Code)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:114)
    "SIGQUIT handler" (TID:0x411433e0, sys_thread_t:0x81964b0, state:R,
native ID:0x402) prio=5
    "main" (TID:0x411431e0, sys_thread_t:0x810b5d8, state:R, native
ID:0x400) prio=5
Monitor Cache Dump:
    java.lang.ref.Reference$Lock@411433C0/41178B20: <unowned>
        Waiting to be notified:
            "Reference Handler" (0x8196b20)
    java.lang.ref.ReferenceQueue$Lock@41143338/41179028: <unowned>
        Waiting to be notified:
            "Thread-0" (0x819bd28)
Registered Monitor Dump:
    PCMap lock: <unowned>
    utf8 hash table: <unowned>
    JNI pinning lock: <unowned>
    JNI global reference lock: <unowned>
    BinClass lock: <unowned>
    Class linking lock: <unowned>
    System class loader lock: <unowned>
    Code rewrite lock: <unowned>
    Heap lock: <unowned>
    Monitor cache lock: owner "Reference Handler" (0x8196b20) 1 entry
    Thread queue lock: owner "Reference Handler" (0x8196b20) 1 entry
        Waiting to be notified:
            "Thread-0" (0x819bd28)
    Monitor registry: owner "Reference Handler" (0x8196b20) 1 entry

SIGSEGV   11*  segmentation violation
    si_signo [11]: SIGSEGV   11*  segmentation violation
    si_errno [0]: Success
    si_code [0]: SI_USER [pid: 0, uid: 0]
        stackpointer=0xbf5ff204
[Mon Jan  8 17:47:13 2001] [warn] child process 24763 still did not
exit, sending a SIGTERM
[Mon Jan  8 17:47:17 2001] [error] child process 24763 still did not
exit, sending a SIGKILL
[Mon Jan  8 17:47:17 2001] [notice] caught SIGTERM, shutting down

Any help or pointers on this would be greatly appreciated.  I have
absolutely no idea what's going on here.  It appears that this will
happen if I run my relatively complex script or if I run the include
jver.php script - doesn't matter *what* Java is doing, simply creating a
JVM appears to be the problem.

TIA & Regards,
-- 
Brice Ruth
WebProjkt, Inc.
VP, Director of Internet Technology
http://www.webprojkt.com/




Can PHP be used with WAP?  If so, how does one install PHP so that it
can work with WAP?

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






Yes...

You don't have to do anything to PHP.  You have to setup your webserver...

An apache http.conf:
    # MIME Types for WAP
    AddType text/vnd.wap.wml .wml
    AddType image/vnd.wap.wbmp .wbmp
    AddType application/vnd.wap.wmlc .wmlc
    AddType text/vnd.wap.wmlscript .wmls
    AddType application/vnd.wap.wmlscriptc .wmlsc
    AddType application/pdf .pdf

and mime.types:
application/vnd.wap.sic
application/vnd.wap.slc
application/vnd.wap.wbxml       wbxml
application/vnd.wap.wmlc        wmlc
application/vnd.wap.wmlscriptc  wmlsc

-Bob

-----Original Message-----
From: Todd Cary [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 09, 2001 12:35 PM
To: [EMAIL PROTECTED]
Cc: Bjarne Winkler
Subject: [PHP] PHP and wap


Can PHP be used with WAP?  If so, how does one install PHP so that it
can work with WAP?

Todd

--
Todd Cary
Ariste Software
[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]






It works.  There is no special installation needed.  Just simply code
your output so that it is in wap or HDML, or whatever and send the
appropriate headers with the PHP header() function.

Jeremy

Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED]
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more 
Get your own Free, Private email at http://www.smackdown.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   "<body>"   -- Quoted from Yahoo! homepage, http://www.yahoo.com

On Tue, 9 Jan 2001, Todd Cary wrote:

> Date: Tue, 09 Jan 2001 10:34:33 -0800
> From: Todd Cary <[EMAIL PROTECTED]>
> To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> Cc: Bjarne Winkler <[EMAIL PROTECTED]>
> Subject: [PHP] PHP and wap
> 
> Can PHP be used with WAP?  If so, how does one install PHP so that it
> can work with WAP?
> 
> Todd
> 
> --
> Todd Cary
> Ariste Software
> [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]
> 
> 





Check out these tutorials on wap and php :


    Building WML Applications Using PHP             :
    -------------------------------------------------
    http://www.zend.com/zend/tut/wap.php

    WAP-Enabling a Website with PHP3                :
    -------------------------------------------------
    http://www.devshed.com/Server_Side/PHP/PHP_WAP/

    WAP In Perspective                              :
    -------------------------------------------------
    http://phpbuilder.com/columns/markaw20001204.php3


Regards,

Philip Olson
http://www.cornado.com/

On Tue, 9 Jan 2001, Todd Cary wrote:

> Can PHP be used with WAP?  If so, how does one install PHP so that it
> can work with WAP?
> 
> Todd
> 
> --
> Todd Cary
> Ariste Software
> [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]
> 





I'm trying to query an MS Access database via ODBC, but the odbc_exec
command fails with this error:

FATAL:  emalloc():  Unable to allocate 2147483599 bytes

I don't know why it could possibly be trying to allocate 2GB, as the
database is only about 4MB.  Any suggestions would be appreciated.

Thanks,


Justin Smith
New Mexico Natural Heritage Program
University of New Mexico
Department of Biology
167 Castetter Hall
Albuquerque, New Mexico 87131
505-277-3822 x226
505-277-3844 (fax)
[EMAIL PROTECTED]







Call for Participation
======================

O'Reilly & Associates is pleased to announce the 1st annual PHP
Conference. This event is the central gathering place for the PHP
community to exchange ideas, techniques, and to advance the language. The
PHP Conference is a five-day event designed for PHP programmers and
developers and technical staff involved in PHP technology and its
applications. The conference will be part of the O'Reilly Open Source
Convention alongside the 5th annual Perl Conference at the Sheraton San
Diego Hotel and Marina, San Diego, California, July 23-27, 2001.

The Open Source Conference includes two days of intensely focused
tutorials aimed mainly at intermediate and advanced PHP, Perl and Python
programmers along with users of popular technologies such as XML, MySQL,
Mozilla, Apache, Tcl and Zope.  These tutorials are designed to provide
concrete knowledge that leads directly to better programs.  Three days
of multi-tracked conference sessions focus on the cutting edge technology
and feature talks, demonstrations, and panel debates on topics ranging from
object-orientation to data mining.

Technically sophisticated individuals who are actively working with the
technology make all tutorial and conference presentations. Presentations
by marketing staff or with a marketing focus will not be accepted.

Participation Opportunities
---------------------------
Individuals and companies interested in making technical presentations at
the Conference are invited to submit proposals to the conference
organizers following the guidelines below. Proposals will be considered in
two classes: tutorial programs and conference presentations.

Topics
------
The program committee invites submissions of tutorials, or conference
presentations on topics of interest to PHP programmers. Here are some
suggested topics:

        Extending PHP
        E-Commerce with PHP
        WebMail with PHP
        XML/XSLT/XML-RPC
        CORBA and PHP
        LDAP
        PHP on Windows
        Ways to connect to Windows ODBC from UNIX

Tutorial Presentations
----------------------
The first two days of the conference are devoted to tutorial
presentations.

Tutorial proposals must include:

 - Tutorial Title

 - Tutorial length (3 or 6 hours)

 - Target audience including any prerequisites for taking advantage of the
   material (i.e. a basic understanding of PHP is necessary)

 - What attendees will learn--the knowledge or skill take-away attendees
   will have at the completion of thetutorial

 - Tutorial outline--a short bullet list or description of the course
   itself and the material it covers

 - Speaker name

 - Speaker biography

 - Complete speaker contact information; if applicable, include
   administrative support contact information

Conference Presentations
------------------------
Conference presentations will take place on the third to fifth days of the
conference and participation will be considered for these types of talks:

Case studies showing an application of PHP, the problems that were solved
and the lessons learned

Focused technology discussions covering a specific PHP technology and
showing a variety of implementation or application options

New product/technology demonstrations--live demonstrations of released or
near released PHP extensions or applications

Panel participation--speakers to participate in one of the various panel
discussions that are part of the conference

Conference proposals must include:

 - Type of talk--technology, new product, case study, or panel

 - Title of talk or demonstration

 - Abstract of talk, maximum 250 words

 - Speaker name

 - Speaker biography

 - Complete speaker contact information; if applicable,
   include administrative support contact information

Submitting Your Proposal
------------------------
Please send all proposals to: [EMAIL PROTECTED]

Submit all proposals via electronic mail in plain text with no
attachments. Submit one proposal per email. The subject line of your email
must follow this format:

Your Last Name: proposal type (tutorial, proposal, paper): proposal title

for example:          Smith: Tutorial: Advanced PHP Programming

You will receive an automatic confirmation of receipt for each proposal.

Important Dates
---------------
Proposals due: February 15, 2001

Notification to conference and tutorial presenters: March 1, 2001

Tutorial presentations due: May 1, 2001

Conference presentations due: June 1, 2001





I am having troubles trying to print multi dimensional arrays.  Here is what
I though I would have to do:

echo "array[0][1]";

if you can help thanks in advance.

Thank you,

--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com
--------------------------------------------





On Sun, 9 Jan 2000, Brandon Orther wrote:

> I am having troubles trying to print multi dimensional arrays.  Here is what
> I though I would have to do:
> 
> echo "array[0][1]";

echo "{$array[0][1]}";

or simply

echo $array[0][1];

Matt






Hi Brandon,

echo $array[0][1];

That will print one element of that array.

If you want a quick and dirty way to "see" the entire array structure
without having to write a bunch of nested loops, use var_dump().

var_dump($array);

works great for debugging.

Monte


Brandon Orther wrote:
> 
> I am having troubles trying to print multi dimensional arrays.  Here is what
> I though I would have to do:
> 
> echo "array[0][1]";
> 
> if you can help thanks in advance.
> 
> Thank you,
> 
> --------------------------------------------
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.com
> --------------------------------------------
> 
> --
> 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]




The ISP where a client of us is hosted just started issuing this error when
accessing any PHP script (e.g. a script with a call to phpinfo() ):

PHP has encountered an Access Violation at 119F4CE6

The behaviour is totally unpredictable: it is functioning well now and then
it starts issuing this Access Violation errors, or Internal Server Errors,
and so on... I contacted them and they must probably have just restarted the
HTTP Server service (IIS) in order to make things come back to normal.

Has the PHP developer team tracked these errors down already? It shall most
probably be some problem related with the Windows OS *environment*, not
specifically Windows (be it NT, 95/98 or Win2K), HTTP server, or PHP.

My concern is that we *do have* clients that run over Microsoft platform, so
it is not a solution to us to move to UNIX at the moment. I have not seen
one port of PHP over Windows to be really stable.

We have tested almost all configurations always with some kind of
unpredictable memory errors, Internal HTTP Server Errors (error 500), or
caching problems: we have tested PHP versions CGI and ISAPI, versions 4.0.2,
4.0.3pl1, with and without ZEND optimizer, over IIS and Apache, over Win98
(Apache) and Win NT4 (IIS) with service pack 6 and option pack 4. We shall
still have more experimentation with these combinations, but if anybody has
already some more detailed information about these issues please inform us.

I reference here the following links to problems we've been experiencing or
similar to them:

http://marc.theaimsgroup.com/?l=php-general&m=96907546114684&w=2

http://marc.theaimsgroup.com/?l=php-general&m=95988426721865&w=2

http://marc.theaimsgroup.com/?l=php-general&m=97847365303717&w=2

http://marc.theaimsgroup.com/?l=php-general&m=97852842527618&w=2

TIA,
Paulo





It sounds like the ISP has installed the ISAPI version of PHP. Get them to
change to CGI and all the errors will just go away!

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org





Hello everyone,

Is there a way I can give an array a name instead of a value?

like:

array[PK17] = "6.50";

array[PK17] = "3.37";

I want to do this so I don't have to loop it until the value of the array is
found,  I would like to just call $array[var] and find the price.

Thank you,

--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com
--------------------------------------------





ya sure thats no problem

<?
  $test['one'] = "hello?";
  $test['two'] = "hi?";
  $test['three'] = "oi";

  $where = 'one';
  echo $test[$where];

?>

Chris Lee
Mediawaveonline.com


"Brandon Orther" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hello everyone,
>
> Is there a way I can give an array a name instead of a value?
>
> like:
>
> array[PK17] = "6.50";
>
> array[PK17] = "3.37";
>
> I want to do this so I don't have to loop it until the value of the array
is
> found,  I would like to just call $array[var] and find the price.
>
> Thank you,
>
> --------------------------------------------
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.com
> --------------------------------------------
>
>
> --
> 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]
>








Hi,

I would use some help. I have written all my pictures to a database and
now I need to make mouseovers with these pictures. Right now my picture
displaying 'systems' (good word...) is the following. 

<IMG SRC='showpic.php?picid=$picid' width=177 height=117>

and this is showpic.php
<?php
                
        $query = "SELECT * FROM pildid WHERE picnr='0'";
        $result = mysql_db_query("bt", $query);
                $r = mysql_fetch_array($result);

        Header("Content-Type: {$r[file_type]}");
        echo $r["file_data"];
        exit();
?>

And usually I use the following code for picture preload:

<script language="Javascript">
<!--
if (document.images) {

pilt1 = new Image();
pilt1.src="pildid/pilt1.jpg";
pilt2= new Image();
pilt2.src="pildid/pilt2.jpg";

}

function vaheta(a,b) {
if (document.images){
document.images[a].src=eval(b + ".src");
}
}
//-->

</script>

Now, if anyone could tell me how to preload all the needed pictures from
the database and then show them on mouseovers, please let me know asap. 

NB: if possible, send one copy to my private email as well.


Thank you in advance.
Siim Einfeldt






<?
 function add_all($array)
 {
  foreach($array as $pos => $val)
   @$sum += $val;
  return @$sum;
 }

 $price[123] = 5;
 $price[123] = 2;
 $price[123] = 7;
 $price[123] = 9;

 $tax = 0.14;

 echo add_all($price) * $tax;
?>

is there a built in function to replace add_all, I would like to have a
add_all, multiply_all, divide_all, etc etc. a php function would just be
nicer...

Chris Lee
Mediawaveonline.com








"Chris Lee" ...
>
> is there a built in function to replace add_all, I would like to have a
> add_all, multiply_all, divide_all, etc etc. a php function would just be
> nicer...

Have a look to array_walk() - it applies a function to every element of an array.






array_walk() doesnt seem to fit my code, unless Im not suing it right... I
cant see how I would use it. array_walk() will execute a function on every
element of my array ie.

<?
  function dsp($val, $pos)
  {
    echo "$pos : $val<br>\n";
  }

  $test[0] = "hello";
  $test[1] = "hi";
  $test[2] = "oi";

  array_walk($test, 'dsp');
?>

this will dsiplay all the keys and values. how can I add them?

the only way I could see your method of workings is imensly complex

<?
 class add
 {
  var $value;

   function dsp($val, $pos)
   {
     @$this->value += $val;
   }
 }

  $test[0] = 3;
  $test[1] = 2;
  $test[2] = 5;

 $class = new class;

  array_walk($test, 'class->dsp');

 echo $class->value * $tax;
?>

I am obviously missing something here, I would apreciate you clarifying me
:) such a simple function would be handy.

Chris Lee
Mediawaveonline.com


""MR"" <[EMAIL PROTECTED]> wrote in message
news:93fsm6$3gf$[EMAIL PROTECTED]...
> "Chris Lee" ...
> >
> > is there a built in function to replace add_all, I would like to have a
> > add_all, multiply_all, divide_all, etc etc. a php function would just be
> > nicer...
>
> Have a look to array_walk() - it applies a function to every element of an
array.
>
>
>
> --
> 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]
>






Hello all.

I am writing a small backup program and am having problems.  For some 
reason, no matter what I try, the exec() won't work.  If I remove the 
variable and put in the actual text, it works fine.  Any tips?

<?

$backup_date = date("mdY");
$backup_date = "redhot" . $backup_date;
$backup_path = "/home/httpd/html/sweeps/";
$backup_to = $backup_path . "stats/backups/";

exec("tar --exclude=stats -cf " . $backup_to . $backup_date . ".tar 
$backup_path");

//exec("gzip /backup.tar");
//exec("mv /backup.tar.gz /public_html/backup.tar.gz");

?>

Thanks

CDitty





> Hello all.
> 
> I am writing a small backup program and am having problems.  For some 
> reason, no matter what I try, the exec() won't work.  If I remove the 
> variable and put in the actual text, it works fine.  Any tips?
> 
> <?
> 
> $backup_date = date("mdY");
> $backup_date = "redhot" . $backup_date;
> $backup_path = "/home/httpd/html/sweeps/";
> $backup_to = $backup_path . "stats/backups/";
> 
> exec("tar --exclude=stats -cf " . $backup_to . $backup_date . ".tar 
> $backup_path");
> 
> //exec("gzip /backup.tar");
> //exec("mv /backup.tar.gz /public_html/backup.tar.gz");
> 
> ?>

try using the full path to your programs (you get them with the "which"
command!!)
for example not "tar" but "/bin/tar"

and check the directoy-rights where you want to write the files!

witty

-- 
Sent through GMX FreeMail - http://www.gmx.net




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm looking for a PHP/MySQL-or-Postgres based discussion board setup that
can easily be integrated into an existing user authentication setup,
instead of relying on its own user tables.  Does anyone have any
recommendations?

- --Wade
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE6W3aQX5y4ZKLK2pMRAtUDAJ9jlC0xR0BQBfH2cWYYl6qDOTV1HQCgqqwg
4OQE4Xtfy4mLf691ACz/DxQ=
=s8yv
-----END PGP SIGNATURE-----





Hi everyone,
Could anyone help me on my codes, I would like to have a function which
could generate the similar  variables and queries, how could I produce the
variable by calling the function? I need a function will generate those
codes when each time it was called. I hope you guys could understand what my
problem is. Thank you  very much for any helps.

                $query1=@mysql_query("select FKMotherEventType_ID 
                        from $table where EventType_ID='$ETpk'",$db);
                                                        
                $row1=@mysql_fetch_array($query1);

                $FKMET1=$row1["FKMotherEventType_ID"];
                        
                        if ($FKMET1){
                
                                $query2=@mysql_query("select
FKMotherEventType_ID 
                                        from $table where
EventType_ID='$FKMET1'",$db);
                                        
                                $row2=@mysql_fetch_array($query2);
                                $FKMET2=$row2["FKMotherEventType_ID"];

                                
                                if ($FKMET2){
        

                                        $query3=@mysql_query("select
FKMotherEventType_ID 
                                                from EventType where
EventType_ID='$FKMET2'",$db);
                                                                        
                                        $row3=@mysql_fetch_array($query3);
        
$FKMET3=$row3["FKMotherEventType_ID"];
                                                                        
                                        if ($FKMET3) {
        

                                                $query4=@mysql_query("select
FKMotherEventType_ID 
                                                        from $table where
EventType_ID='$FKMET3'",$db);
                                        
        
$row4=@mysql_fetch_array($query4);
        
$FKMET4=$row4["FKMotherEventType_ID"];
        

                                                if ($FKMET4) {
        

                                                        echo "<td 
                                                        bgcolor=" 
                                                        .$bgcolor. ">
                                                        <font size=" 
                                                        .$rsfontsize. ">4
                                                        &nbsp&nbsp&nbsp
                                                        &nbsp&nbsp&nbsp
                                                        &nbsp&nbsp&nbsp
                                                        <a
href=tbl_ProjSchedule2.php target=_self>
                                                        " .$data. "
                                                        </font></td>\n";
                                                
                                                }
                                        }
                                }
                        }               
Calvin Chua





Is there a command to check for the existence of a MySQL table?

Ben




BW> Is there a command to check for the existence of a MySQL table?

I believe you must 'select' the table and check the error

On creation you can create table xzy IF NOT EXISTS



-- 
DSig
David Tod Sigafoos
mailto:[EMAIL PROTECTED]

Using 'The Bat' 1.48f

            `````
           ( O O )
_______oOOo__( )__oOOo_______






Also, consider playing with :

    http://www.php.net/manual/function.mysql-list-tables.php

philip


On Tue, 9 Jan 2001, David Tod Sigafoos wrote:

> BW> Is there a command to check for the existence of a MySQL table?
> 
> I believe you must 'select' the table and check the error
> 
> On creation you can create table xzy IF NOT EXISTS
> 
> 
> 
> -- 
> DSig
> David Tod Sigafoos
> mailto:[EMAIL PROTECTED]
> 
> Using 'The Bat' 1.48f
> 
>             `````
>            ( O O )
> _______oOOo__( )__oOOo_______
> 
> 
> 
> -- 
> 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]
> 





Try doing the basic select on the table and trap the error. (like select
count(*) from tbl)

Ben Wiechman wrote:

> Is there a command to check for the existence of a MySQL table?
>
> Ben
>
> --
> 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]





> Is there a command to check for the existence of a MySQL table?
> 

$res=mysql_query("show tables");

you have to search for the name manually!
for example:

while ($row=mysql_fetch_array($res)){
  foreach ($row as $key => $value){
    echo  "$key -&gt; $value<br>";
  }
}

witty

-- 
Sent through GMX FreeMail - http://www.gmx.net




> > Is there a command to check for the existence of a MySQL table?
> > 
> 
> $res=mysql_query("show tables");
> 
> you have to search for the name manually!
> for example:
> 
> while ($row=mysql_fetch_array($res)){
>   foreach ($row as $key => $value){
>     echo  "$key -&gt; $value<br>";
>   }
> }
> 

Does nobody read the mysql manual anymore these days? :)

No manual searching needed - 

$r = mysql_query("show tables like '$whateveryouaresearchingfor'");
if( mysql_num_rows($r) == 1 )
{
 // found
}
else
{
 // not found
}




True .. but here you will have to parse the info .. 'select * from
table limit 1' will bring back and error pretty quickly with only a
check for DIE

PO>     http://www.php.net/manual/function.mysql-list-tables.php

>> BW> Is there a command to check for the existence of a MySQL table?
>> 
>> I believe you must 'select' the table and check the error
>> 
>> On creation you can create table xzy IF NOT EXISTS


-- 
DSig
David Tod Sigafoos
mailto:[EMAIL PROTECTED]

Using 'The Bat' 1.48f

            `````
           ( O O )
_______oOOo__( )__oOOo_______






Is there a way with PHP to use the Windows NT or Windows 2000 authentication
information.  So it can compare the username and password entered with
either the cached information or the user information from the NT server...
This is for an intranet setup...  Has anyone tried this kind of thing?

Phil Labonte
Systems Administrator
Atreus Systems
(p) 613-233-1741 x243
(c) 613-277-1697
[EMAIL PROTECTED]






Hi

I really like all the features of PHP, but it seems to me that the function
names are becoming more and more confusing. The best example is that all the
new array function start with array_, but for compatibility reasons the old
ones don't follow this rule.

I guess it would be possible to write a large include file that could work
as an object wrapper for all the functions i PHP, but that would probably
slow thigs down quite a bit.

Does anyone know if there ever will be a completely object orient version of
PHP?

- Jan Aagaard

P.S.: Why do most of the postings on the news server start with [PHP] or so?
Is there a webinterface somewhere, that adds them?






> I really like all the features of PHP, but it seems to me that the function
> names are becoming more and more confusing. The best example is that all the
> new array function start with array_, but for compatibility reasons the old
> ones don't follow this rule.
>
> I guess it would be possible to write a large include file that could work
> as an object wrapper for all the functions i PHP, but that would probably
> slow thigs down quite a bit.
>
> Does anyone know if there ever will be a completely object orient version of
> PHP?

There might be minor enhancements here and there to the OO, but a
completely rewrite to have an OO-only PHP, no chance.

> P.S.: Why do most of the postings on the news server start with [PHP] or so?
> Is there a webinterface somewhere, that adds them?

The mailing list software adds them.  They are handy for people who like
to visually scan through large mailboxes.

-Rasmus





What credit card authorization/processing suites, do you use/recommend?

I need something that will work with php or perl seamlessly and is easy to
setup.  It needs to be relatively inexpensive (percentage or fee based),
reliable, and reputable.

Please respond with your recommendations!

Thank You,
-nc
-----------------------------------------------------------------------
.:: Nathan Cook                            - Network/Security Admin
office:  208.343.3110                   - Web Programmer
email:   [EMAIL PROTECTED]         - Qmail Admin
pager:  208.387.9983                   - MIS Admin
-----------------------------------------------------------------------





Hello,

Is there any PHP equivalent of the javascript function escape()? For example
<?php
$name = "hello world!";
$name = escape($name);
echo $name; // prints "hello%20world%21"
?>

thanks!
   -Matt






urlencode()

Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED]
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more 
Get your own Free, Private email at http://www.smackdown.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   "<body>"   -- Quoted from Yahoo! homepage, http://www.yahoo.com

On Tue, 9 Jan 2001 [EMAIL PROTECTED] wrote:

> Date: Tue, 09 Jan 2001 13:31:30 -0800
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: [PHP] escape()
> 
> Hello,
> 
> Is there any PHP equivalent of the javascript function escape()? For example
> <?php
> $name = "hello world!";
> $name = escape($name);
> echo $name; // prints "hello%20world%21"
> ?>
> 
> thanks!
>    -Matt
> 
> 
> 
> -- 
> 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]
> 
> 





Hi all,
I have a very simple form with a text field but when I submit it the 
parameter is not passed. Also if I call something like 
http://myserver.com/myfile.php?myvar=test  I can't print myvar (i.e. 
echo $myvar;) because $myvar is empty.
This happened after installing GD. I have installed PHP 4.0.4 without 
GD support and the problem persists. Any idea?
TIA

ant




Antonio,

Does test contain anything?
Do you have a typo?  Shouldn't it be ..?myvar=$test rather that ?myvar=test

You may also want to look at the use of sessions to avoid passing a lot of 
stuff on the command line.

Miles

At 10:41 PM 01/09/2001 +0100, Antonio Guerrieri wrote:
>Hi all,
>I have a very simple form with a text field but when I submit it the 
>parameter is not passed. Also if I call something like 
>http://myserver.com/myfile.php?myvar=test  I can't print myvar (i.e. echo 
>$myvar;) because $myvar is empty.
>This happened after installing GD. I have installed PHP 4.0.4 without GD 
>support and the problem persists. Any idea?
>TIA
>
>ant
>
>--
>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]







On Tue, 9 Jan 2001, Antonio Guerrieri wrote:

> Hi all,
> I have a very simple form with a text field but when I submit it the
> parameter is not passed. Also if I call something like
> http://myserver.com/myfile.php?myvar=test  I can't print myvar (i.e.
> echo $myvar;) because $myvar is empty.
> This happened after installing GD. I have installed PHP 4.0.4 without
> GD support and the problem persists. Any idea?
> TIA
>
> ant
>

Is register_globals on in your php.ini? Does $HTTP_GET_VARS["myvar"] contain
anything?

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





Hello:

This may be a little off subject, but I am using PHP when this is happening
if that makes it any less wrong. : )

Anyways, I want a new line but when I use the <BR> to do it makes a gap
between the last line.  does anyone know how to make the <BR> or any new
line in html for that matter to only make a small gap?

Thank you,

--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com
--------------------------------------------





I use a transparent 1x1 pixel .gif. Using the height and width parameters
you can make it any size you want. Put it on a line by itself and you have
pixel control of the gap.

............. Jade Ohlhauser
[website architect]........... http://bandwidthplace.com


----- Original Message -----
From: "Brandon Orther" <[EMAIL PROTECTED]>
To: "PHP User Group" <[EMAIL PROTECTED]>
Sent: Sunday, January 09, 2000 2:47 PM
Subject: [PHP] <BR> in html


> Hello:
>
> This may be a little off subject, but I am using PHP when this is
happening
> if that makes it any less wrong. : )
>
> Anyways, I want a new line but when I use the <BR> to do it makes a gap
> between the last line.  does anyone know how to make the <BR> or any new
> line in html for that matter to only make a small gap?
>
> Thank you,
>
> --------------------------------------------
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.com
> --------------------------------------------
>
>
> --
> 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]
>






> Anyways, I want a new line but when I use the <BR> to do it makes a gap
> between the last line.  does anyone know how to make the <BR> or any new line
> in html for that matter to only make a small gap?


<BR> should just make a new line with the current font size. 
First check the output HTML: 
Are you in a <PRE> part? This also breaks at new lines in the source.
Did you just have a <H1> (or <H2..3..4..5..6>) that includes a blank line?
Are you using a large font size and the browser thinks you;re still using 
that?

If the line is in a TABLE come back here.

I was going to suggest the stylesheet line-height but i see Netscape 4.5 
shows it totally different than IE 5. 

Heck, I'll give it anyway, maybe you can get further with it.... 


<html>
<head>
<style type="text/css">
<!--
.thin_line_break {  font-family: sans-serif; font-size: 18px; 
line-height:14px}
-->
<!--!--! remove the email's new line in the part between the {}'s !--!-->

</style>
</head>

<body>
<p class="thin_line_break">This is a line<br>
                                                   This is the next line</p>
</body>
</html>




--------------------------------------------------------------------
--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
--------------------------------------------------------------------

 




Hello all,

I've installed: libpng-1.08, tiff-v3.5.5, zlib-1.1.3, freetype-2.0,
pdflib-3.03, and gd-1.8.3
reconfigured ldconfig, and I configured with:

./configure --with-apache=../apache_1.3.12 --enable-gd-imgstrttf --with-gd=.
./gd-1.8.3 \
--with-jpeg-dir --with-zlib-dir --with-png-dir --with-tiff-dir --with-pgsql 
--with-zlib

and now I get:

gcc  -I. -I/usr/local/src/php-4.0.4/ext/gd -I/usr/local/src/php-4.0.4/main -
I/us
r/local/src/php-4.0.4 -I/usr/local/src/apache_1.3.12/src/include -I/usr/loca
l/sr
c/apache_1.3.12/src/os/unix -I/usr/local/src/php-4.0.4/Zend -I/usr/local/src
/gd-
1.8.3 -I/usr/local/src/php-4.0.4/ext/mysql/libmysql -I/usr/local/src/php-4.0
.4/e
xt/xml/expat/xmltok -I/usr/local/src/php-4.0.4/ext/xml/expat/xmlparse -I/usr
/loc
al/src/php-4.0.4/TSRM  -DXML_BYTE_ORDER=12 -g -O2  -c gd.c && touch gd.lo

gd.c: In function `php_if_imagecreatefromgif':
gd.c:703: `gdImageCreateFromGif' undeclared (first use in this function)
gd.c:703: (Each undeclared identifier is reported only once
gd.c:703: for each function it appears in.)
gd.c: In function `php_if_imagegif':
gd.c:862: `gdImageGif' undeclared (first use in this function)

I thought that all my includes were correct.  What's going on?
Thank you
Dan Harrington





To all, 
My Linux/Apache/PHP/Mysql system will not work
properly after a clean source installation. The
problem seems to be a mysql-3.23.xx and PHP4.x
compatability issue. 

My system has been configured all combinations of the
following: 
Red Hat 6.1,  6.2,  7.0 
Apache 1.3.12,  1.3.14 
PHP 4.0.1,  4.0.4 
MySQL 3.22.32,  3.23.10,  3.23.30 

I systematically clean install: 
Red Hat Linux first.
Mysql second.
Apache third.
PHP last.

Everycombination works except MySql 3.23.xx and PHP
4.xx. Which is the one I need. What happens is
everything installs, configures and runs until the
last step . After I make, make install PHP.4.x and I
try to restart the apache server I get the following
error: 

[root@localhost apache_1.3.14]# ./bin/apachectl start 
Syntax error on line 207 of
/usr/local/apache_1.3.14/conf/httpd.conf: 
Cannot load
/usr/local/apache_1.3.14/libexec/libphp4.so into
server: undefined symbol: uncompress 
./bin/apachectl start: httpd could not be started  

It seems that PHP maybe messes up the libraries. Can
you help?  
Gerald Neale 

__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/




On Tue, 9 Jan 2001, Gerald Neale wrote:

> To all,
> My Linux/Apache/PHP/Mysql system will not work
> properly after a clean source installation. The
> problem seems to be a mysql-3.23.xx and PHP4.x
> compatability issue.
>
> My system has been configured all combinations of the
> following:
> Red Hat 6.1,  6.2,  7.0
> Apache 1.3.12,  1.3.14
> PHP 4.0.1,  4.0.4
> MySQL 3.22.32,  3.23.10,  3.23.30
>
> I systematically clean install:
> Red Hat Linux first.
> Mysql second.
> Apache third.
> PHP last.
>
> Everycombination works except MySql 3.23.xx and PHP
> 4.xx. Which is the one I need. What happens is
> everything installs, configures and runs until the
> last step . After I make, make install PHP.4.x and I
> try to restart the apache server I get the following
> error:
>
> [root@localhost apache_1.3.14]# ./bin/apachectl start
> Syntax error on line 207 of
> /usr/local/apache_1.3.14/conf/httpd.conf:
> Cannot load
> /usr/local/apache_1.3.14/libexec/libphp4.so into
> server: undefined symbol: uncompress
> ./bin/apachectl start: httpd could not be started
>
> It seems that PHP maybe messes up the libraries. Can
> you help?
> Gerald Neale
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - Share your holiday photos online!
> http://photos.yahoo.com/
>

Add --with-zlib to the configure line for PHP.

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





I am a hardware guy hacking my way through building dynamic web pages using
PHP and MySQL and I just can't get the concept of OOP.  I don't understand
what a class can offer that I can't do with a function.  I've tried to read
a couple of books about OOP and a chapter about classes and such in a PHP
book and I just can't grasp the concept.

Can someone explain to me how a class makes my life easier compared to using
functions.

Thanks in advance,

John Guynn

This email brought to you by RFCs 821 and 1225.





In short, nothing.  I can't think of a single thing I can do in an OOP
design that I can't do in a procedural design. A class simply allows related
code and data to reside together.

In a shopping cart system written in procedural code, (HEY! Who among you
hasn't written your own shopping cart yet???) you have functions like
saveLine() saveHeader() getItem() etc.  In an OOP shopping cart you would
have a Cart object that would contain a header object and an array of line
objects.  calling $myCart->save() would first call $myCart->header->save()
and then spin through the array of line items calling
$myCart-lineItems[$x]->save() Each line would know everything it needs to
know to save itself to the database.

I find that my OOP methods are usually smaller and more granular than my
procedural functions were.  most of my classes are subclasses that add a
little here and a little there.

The OOP way of thinking is difficult for procedural programmers to grok.
(Ok, it was for me when I made the switch.) but once you get there (IMHO)
it's much easier to design and code systems.

Cal
http://www.calevans.com




-----Original Message-----
From: John Guynn [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 09, 2001 4:06 PM
To: Php (E-mail)
Subject: [PHP] Speaking of OOP


I am a hardware guy hacking my way through building dynamic web pages using
PHP and MySQL and I just can't get the concept of OOP.  I don't understand
what a class can offer that I can't do with a function.  I've tried to read
a couple of books about OOP and a chapter about classes and such in a PHP
book and I just can't grasp the concept.

Can someone explain to me how a class makes my life easier compared to using
functions.

Thanks in advance,

John Guynn

This email brought to you by RFCs 821 and 1225.


--
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]






On Tue, 9 Jan 2001, John Guynn wrote:

> I am a hardware guy hacking my way through building dynamic web pages using
> PHP and MySQL and I just can't get the concept of OOP.  I don't understand
> what a class can offer that I can't do with a function.  I've tried to read
> a couple of books about OOP and a chapter about classes and such in a PHP
> book and I just can't grasp the concept.
>
> Can someone explain to me how a class makes my life easier compared to using
> functions.
>
> Thanks in advance,
>
> John Guynn
>
> This email brought to you by RFCs 821 and 1225.
>

You are absolutely right. There is not one single thing that can be done with
classes that couldn't be done with functions. Not in PHP anyway. The main use
of OOP is the abstraction of data along with the code used to manipulate it.
Observe:

<?php
$circle=Array();
$circle["radius"]=5;

$square=Array();
$square["width"]=4;
$square["length"]=3;

function area1($w, $h)
{
  return $w*$h;
};

function area2($shape)
{
  return $shape["width"]*$shape["height"];
};

$squarearea=area1($square["width"], $square["height"]);
$badarea=area1($square["height"], $circle["radius"]);

$squarearea=area2($square);
$badarea=area2($circle);
?>

Now using OOP:

<?php
class Circle
{
  var $radius;

  function Circle($r=0)
  {
    $this->redius=$r;
  }

  function area()
  {
    return $this->radius*$this->radius*3.1415;
  }
};

class Square
{
  var $width;
  var $height;

  function Square($w=0, $h=0)
  {
    $this->width=$w;
    $this->height=$h;
  }

  function area()
  {
    return $this->width*$this->height;
  }
};

$circle=New Circle(5);
$square=New Square(4, 3);

$circlearea=$circle->area();
$squarearea=$square->area();
?>

In short, OOP makes it just slightly more difficult to screw things up. PHP's
OOP model is missing two things (field scope [private, protected, public] and
class destructors) that prevent it from being as powerful as it could be, but
it beats flipping switches :)

-- 
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>










It isn't inherently obvious to us old-timers who grew up doing everything
in a procedural manner.  The main thing a class gives you is
encapsulation.  Meaning, you can group a bunch of simple functions
together along with a set of variables.  You can almost think of it as a
data structure with user-definable transformation functions.

For example:

  class wallet {
    var $total;

    function wallet($initial_amount) {
         $this->total = $initial_amount;
    }

    function add($amount) {
         $this->total += $amount;
    }

    function display() {
         echo '$'.number_format($this->total,2);
    }
  }

This wallet class has one variable (known as a property) and 3 functions
(known as methods).

You can then do:

  $w1 = new wallet(10);
  $w2 = new wallet(20);

This creates 2 wallet objects.  The first starts off with $10 in it and
the second starts with $20.

To add money to the first wallet:

  $w1->add(5);

And to display the current amount in the first wallet:

  $w1->display();

There is nothing here you couldn't do using straight procedural code, but
from a code organization point of view some will say that this is cleaner.

-Rasmus

On Tue, 9 Jan 2001, John Guynn wrote:

> I am a hardware guy hacking my way through building dynamic web pages using
> PHP and MySQL and I just can't get the concept of OOP.  I don't understand
> what a class can offer that I can't do with a function.  I've tried to read
> a couple of books about OOP and a chapter about classes and such in a PHP
> book and I just can't grasp the concept.
>
> Can someone explain to me how a class makes my life easier compared to using
> functions.
>
> Thanks in advance,
>
> John Guynn
>
> This email brought to you by RFCs 821 and 1225.
>
>
> --
> 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]
>





For some time now I have been trying to figure out how to let users log off
a page that has required access so they can log on as a different user.  But
all my attemps fail.  I can't unset the values.  I tried to force a:

Header("WWW-Authenticate: Basic realm=\"Clients\"");
Header("HTTP/1.0 401 Unauthorized");

so they could resubmit the info and it just does the standard 3 strikes and
your out deal.

I have tried to set and unset:

$REMOTE_USER
$REMOTE_PASSWORD
$PHP_AUTH_USER
$PHP_AUTH_PW

$GLOBALS['REMOTE_USER']
$GLOBALS['REMOTE_PASSWORD']
$GLOBALS['PHP_AUTH_USER']
$GLOBALS['PHP_AUTH_PW']

but the browser just remembers it.

Anybody have some tricks they have done.

-Bob





Just some guesses :)

1) Change the "Clients" string of the realm.
2) Redirect to an url with l/p embedded.
(http://wrong:[EMAIL PROTECTED]/script.php)

> -----Original Message-----
> From: Robert Covell [mailto:[EMAIL PROTECTED]]
> Sent: 9 January 2001 23:06
> To: [EMAIL PROTECTED]
> Subject: [PHP] Can't figure out how to logoff...
>
>
> For some time now I have been trying to figure out how to let
> users log off
> a page that has required access so they can log on as a different
> user.  But
> all my attemps fail.  I can't unset the values.  I tried to force a:
>
> Header("WWW-Authenticate: Basic realm=\"Clients\"");
> Header("HTTP/1.0 401 Unauthorized");
>
> so they could resubmit the info and it just does the standard 3
> strikes and
> your out deal.
>
> I have tried to set and unset:
>
> $REMOTE_USER
> $REMOTE_PASSWORD
> $PHP_AUTH_USER
> $PHP_AUTH_PW
>
> $GLOBALS['REMOTE_USER']
> $GLOBALS['REMOTE_PASSWORD']
> $GLOBALS['PHP_AUTH_USER']
> $GLOBALS['PHP_AUTH_PW']
>
> but the browser just remembers it.
>
> Anybody have some tricks they have done.
>
> -Bob
>
>
> --
> 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]
>
>





Hello,

There was an encrypt() and a decrypt() function available in php3 was this
removed from php4? if not how can I use it? I cant seem to find any info on
php.net on usage and I get an undefigned function error when I try to use
it.

Thanks,

Robert W. Collins
Web Developer II
Insight / TC Computers
www.insight.com
www.tccomputers.com




"Robert Collins" <[EMAIL PROTECTED]> wrote:
> There was an encrypt() and a decrypt() function available in php3 was this
> removed from php4? if not how can I use it? I cant seem to find any info
on
> php.net on usage and I get an undefigned function error when I try to use
> it.

try http://www.php.net/manual/ref.mcrypt.php

Stefan







I'm storing files in a mySQL table that looks like this:

| file_name        | varchar(100)        |      | MUL |         | |
| file_description | text                | YES  |     | NULL    | |
| file_type        | varchar(50)         |      |     |         | |
| file_size        | int(10) unsigned    |      |     | 0       | |
| added_by         | varchar(10)         |      |     |         | |
| access_types     | text                | YES  |     | NULL    | |
| access_users     | text                | YES  |     | NULL    | |
| file_num         | bigint(10) unsigned |      | PRI | 0       |
auto_increment |
| bin_data         | blob                |      |     | NULL    | |

the "file_type" field stores the actual data type for the file
(such as 'application/msword', etc).  To serve the file, I'm
using the following code:

<script language="php">

  $dbInfo = unserialize( base64_decode( $db_key ));
  if( is_array( $dbInfo )) {

    $fileQuery  = "SELECT * FROM $dbInfo[table_name] WHERE 
                            file_num=$dbInfo[record_num]";
    $fileResult = mysql( $dbInfo[db_name], $fileQuery );
                
    if(( $fileResult ) && ( mysql_errno() == 0 )) {
      $fileInfo = mysql_fetch_array( $fileResult );
                        
      header( "Content-Disposition: attachment;
filename=$fileInfo[file_name]" );
      header( "Content-Description: PHP Generated Data" );
      header( "Content-type: $fileInfo[file_type];" );
      header( "Content-length: $fileInfo[file_size]" );
                
      echo $fileInfo[bin_data];

      flush();
                        
    }
  }
        
</script>

Everything is working great.  If I echo the query that is getting
run, it's correct.  If I echo out the data that is getting passed via
the header() function, it looks all good.  However, when my 
browser actually tries to download/open the file, everything gets
all screwed up.  The file name that it says that it's downloading
is *nothing* like the actual file name and is in fact just a bunch
of garbage.  If I try to open anything other than a text file, I
get errors from the application that is getting run (MSWord, say)
and if I try to save if, the file is corrupt.  There are no spaces or
NULL characters being printed out by the script.
What's going on?  What am I doing wrong?

Chris




Your question almost answered itself ;)

$array[0][0] = 54;
$array[0][1] = 6.00;

$array[1][0] = 65;
$array[1][1] = 5.50;

$array[2][0] = 43;
$array[2][1] = 3.37;

Cheers,
Brad


----- Original Message -----
From: "Brandon Orther" <[EMAIL PROTECTED]>
To: "PHP User Group" <[EMAIL PROTECTED]>
Sent: Sunday, January 09, 2000 11:30
Subject: [PHP] Multi Dimensional Arrays


> Hello,
>
> have a flat text file in the below format:
>
> -----------------------------------------
> 54=6.00
> 65=5.50
> 43=3.37
> -----------------------------------------
> The first number represents the product number and the second number
> represents the price.  I have exploded this and created an array for each
> line.  Now what I would like to do is create a multi dimensional array
that
> is like bellow:
>
> $array[0][0] == 54
> $array[0][1] == 6.00
>
> $array[1][0] == 65
> $array[1][1] == 5.50
>
> $array[2][0] == 43
> $array[2][1] == 3.37
>
>
> Does anyone know how I could do this?
>
> Thank you,
>
> --------------------------------------------
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.com
> --------------------------------------------
>
>
> --
> 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've searched high and low for a pre-
built cart that suites my needs, and
as of yet have been unsuccessful, so now
I am looking to build a shopping cart
using php3 and MySQL, I'd like to use
php4, but as of the moment, it isn't
an option. if anyone knows of any tutorials
or anywhere to get started, please let
me know.

Regards,

Jerry Lake 





Hi,

the program "main" produces x times an output with an delay of 1 second
between each output.

I want to show this output in "realtime" on a website (this should become a
progress-bar).

The following code shows the output  a f t e r  the program ends:

CODE...
$fp = popen ("./main", "r");     // execute the program
while( $zeile=fgets($fp,100) ) { // read and show output
   echo $zeile;
   flush();                      // ?realtime?
}
pclose($fp);                     // close pointer
...CODE

Does anybody know how to realise this?

Greetings

Stefan

PS: Linux, PHP4






Hi all,
the problem was just register_global set to off. Now also phpMyAdmin 
works well again.
Thanks everybody (special tanks to Ignacio)
antonio
>On Tue, 9 Jan 2001, Antonio Guerrieri wrote:
>
>>  Hi all,
>>  I have a very simple form with a text field but when I submit it the
>>  parameter is not passed. Also if I call something like
>>  http://myserver.com/myfile.php?myvar=test  I can't print myvar (i.e.
>>  echo $myvar;) because $myvar is empty.
>>  This happened after installing GD. I have installed PHP 4.0.4 without
>>  GD support and the problem persists. Any idea?
>>  TIA
>>
>>  ant
>>
>
>Is register_globals on in your php.ini? Does $HTTP_GET_VARS["myvar"] contain
>anything?
>
>--
>Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>





Check out PHPTriad. It should get you up and running quickly.

Cheers,
Brad

----- Original Message -----
From: "Saied Gerami" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 08, 2000 08:57
Subject: [PHP] installing PHP4 on Apache on Win2000


> Dear Sir/Madam,
>
> I followed your instruction to install PHP4 on Apache on Win2000 and also
> Win95 carefully but it doesn't work.
>
> In Win2000, when i call a php file that exist in /htdocs/ of Apache, i
> receive an error mentioning "The page cannot be displayed".
>
> In Win98, it tries to Save a file! i saved it and found out that my PHP
code
> is still inside.
>
> Please let me know what the problem is and how can i solce it.
>
> I appreciate your prompt reply,
>
> Regards,
>
> Saied
>
>
> --
> 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]
>



Reply via email to