php-general Digest 2 May 2001 16:43:59 -0000 Issue 662

Topics (messages 51077 through 51168):

Re: a bit off the list  but....
        51077 by: Donald Goodwill
        51083 by: B. van Ouwerkerk

PDF online
        51078 by: Chris Schneck

Managing Multiple Conditions in a MySQL Query
        51079 by: Mike Gifford
        51082 by: Tomasz Abramowicz
        51141 by: Mike Gifford

PHP as MODULE & CGI Version of PHP
        51080 by: Thomas Edison Jr.
        51143 by: Phil Driscoll
        51152 by: Richard Lynch

Re: Problems compiling with PDF support
        51081 by: Bill Shupp

hmm sockets (again)
        51084 by: Joseph Blythe
        51088 by: Mukul Sabharwal
        51091 by: Joseph Blythe

Re: How to compile PDFLIB in FreeBSD 4.3
        51085 by: heinisch.creaction.de

Re: IMAGE
        51086 by: heinisch.creaction.de

Re: Your opinion on security issue: file extension
        51087 by: Yasuo Ohgaki

turning on error reporting
        51089 by: BigVeggie
        51092 by: elias

Weird error...
        51090 by: elias
        51103 by: Richard Verstegen

Re: Hosts.
        51093 by: elias

Something like PHP-SHOP-NUKE?
        51094 by: José León Serna

Re: Reporting from Database
        51095 by: Richard Lynch

Re: mailing list
        51096 by: Richard Lynch

Re: how to measure databases
        51097 by: Richard Lynch

Re: Browser Detection
        51098 by: Richard Lynch

session_register()
        51099 by: Jennifer
        51102 by: Richard Verstegen
        51161 by: Johnson, Kirk

FTP
        51100 by: E K L

Re: Emanuel virus
        51101 by: B. van Ouwerkerk

Re: session array :-/
        51104 by: Tim Ward
        51124 by: Richard Lynch

Re: split and array logic
        51105 by: Tim Ward

Re: SQL Query time?
        51106 by: Anuradha Ratnaweera
        51122 by: PHPBeginner.com

Re: date list
        51107 by: James Holloway

Re: SQL Select Unique() ?
        51108 by: Anuradha Ratnaweera

Re: LDAP Authentication
        51109 by: Richard Lynch

Sending information between pages???
        51110 by: Vanden Eynde Pascal

Re: Problem with Sablot/PHP4
        51111 by: ReadOnly

utfdecode() and ISO-8859-2
        51112 by: ReadOnly

Re: String Type Unknown
        51113 by: Rudolf Visagie
        51118 by: Anuradha Ratnaweera
        51120 by: Rudolf Visagie

Re: Compressing an upload
        51114 by: Geir Eivind Mork

open foxpro database
        51115 by: Benny K. Putera

Re: Starting PHP script with crontab
        51116 by: Anuradha Ratnaweera

Re: template solutions?
        51117 by: Anuradha Ratnaweera

Re: Please review our coding standards
        51119 by: Anuradha Ratnaweera
        51142 by: Steven Haryanto

ImageCopyResampled() -> Php 4.0.6
        51121 by: JFL

Re: Sort an array
        51123 by: Geir Eivind Mork

Help needed with multiple select form element and PHP !
        51125 by: Nicolas Guilhot
        51139 by: elias

Random number generation...
        51126 by: Tristan.Pretty.risk.sungard.com
        51131 by: elias
        51132 by: Jon Haworth
        51133 by: Avetis Avagyan
        51138 by: Jon Haworth
        51163 by: Phillip Bow

How to catch the output of http:// -> text file?
        51127 by: Kraa de Simon
        51140 by: elias

Re: zlib.output_compression - how to turn it on
        51128 by: Robert Mena

Re: COM
        51129 by: Hassan Arteaga
        51130 by: Hassan Arteaga
        51145 by: Iriton Jonath P. Andrade
        51146 by: Iriton Jonath P. Andrade
        51157 by: Hassan Arteaga

Next SEMPUG meeting - this Thursday
        51134 by: Michael Kimsal

$hello ?
        51135 by: elias
        51136 by: elias

About last release
        51137 by: Hassan Arteaga
        51162 by: Phil Driscoll

C modules vs PHP module for Apache
        51144 by: surinder singh

Re: Checking query suceeded
        51147 by: Richard Lynch
        51154 by: Jordan Elver

Re: Sort Question
        51148 by: Richard Lynch

Re: GD and arrays
        51149 by: Richard Lynch

Re: Problems with sprintf and swapping variables
        51150 by: Richard Lynch

Re: compare PHP with C for apache modules
        51151 by: Richard Lynch

Re: http_post_files not returning file type
        51153 by: Richard Lynch

Re: restrict access of Copy command
        51155 by: Sebastien Roy

error reporting
        51156 by: BigVeggie

Authorizer V1.0
        51158 by: Alain ROMERO

Re: Forms with Field Arrays and JavaScript
        51159 by: Diego Fulgueira

Please !!!!
        51160 by: Hassan Arteaga

PHP 4.0.5 module causes Apache child processes to segfault...
        51164 by: Darron Froese
        51165 by: John Huggins
        51166 by: Darron Froese

Browsers anachy !!!!!!!!!!!!
        51167 by: Sebastien Roy

¸Û¼°ÁܽÐ!
        51168 by: TopNews

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]


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


SAP, is a company producing a small little program
called R/3 and also known as "Enterprise Software",
which costs several $million to several $billion to
implement. It is used by Microsoft, General Motors and
other monster companies.
I don't know what it is written in, but SAP software
comes with a 4GL programming language called ABAP,
which can be used to create reports and customize some
of its modules.
If you saw an SAP job ad offering $250/hr., that's not
unusual.

Unless there are other SAPs. Search the web.


--- Jacky <[EMAIL PROTECTED]> wrote:
> It is a bit off the list here but is theer anybody
> know what is SAP? I mean, is that a script language
> or OS or a DB software?
> cheers
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the
> goal you set for yourself"
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/





>It is a bit off the list here but is theer anybody know what is SAP? I 
>mean, is that a script language or OS or a DB software?

SAP is a piece of ERP (=Enterprise Resource Planning) software. You can 
adapt it to fit the companies needs.

For more info visit the SAP and BAAN websites.. they both create ERP software.
Or use your favorite searchengine instead of asking questions to a list.

Bye,


B.





I'd actually like to see a site that uses php to create PDF's, anyone have
any good examples?





Hello,

I'd like to verify two conditions are true in the results that I pull out of my 
MySQL database.  In this case I wanted Verified and Public both to be listed as 
'yes' in the DB before they were displayed. The code I tried to use is as follows:

<?php
echo "<p>Recent Signatures\n<br><em><UL>";
$individuals_query = mysql_query("SELECT FirstName,LastName,CityState FROM 
phPetition WHERE Public='yes',Verified='yes' ORDER BY ID DESC LIMIT 0,5");
while ($individuals_array = mysql_fetch_array($individuals_query)) {
        echo "<LI>" . stripslashes($individuals_array["FirstName"]) . " " . 
stripslashes($individuals_array["LastName"]) . " from " . 
stripslashes($individuals_array["CityState"]);
}

However, it gave me the following error:

Warning: Supplied argument is not a valid MySQL result resource in 
/usr/local/rabble/petition/index.php3 on line 89

How do I get around this?

Mike
-- 
Mike Gifford, OpenConcept Consulting, http://openconcept.ca
Offering everything your organization needs for an effective web site.
Featured Client: http://rabble.ca - News For the Rest of Us!
Courage my friends, 'tis not too late to make a better world - T. Douglas





<?

echo "<p>Recent Signatures\n<br><em><UL>";
$query = "SELECT FirstName,LastName,CityState FROM phPetition WHERE
Public='yes' AND Verified='yes' ORDER BY ID DESC LIMIT 0,5";
$result =  mysql_query( $query )
    or die("never expect your query to work: $query");

while ( $row = mysql_fetch_array( $result ) ) {

    echo "<LI>" . stripslashes($row["FirstName"]) . " " .
stripslashes($row["LastName"]) . " from " . stripslashes($row["CityState"]);

}






Thanks Tomasz,

I believe that this will work just fine!  :)

Mike

Tomasz Abramowicz wrote:

> <?
> 
> echo "<p>Recent Signatures\n<br><em><UL>";
> $query = "SELECT FirstName,LastName,CityState FROM phPetition WHERE
> Public='yes' AND Verified='yes' ORDER BY ID DESC LIMIT 0,5";
> $result =  mysql_query( $query )
>     or die("never expect your query to work: $query");
> 
> while ( $row = mysql_fetch_array( $result ) ) {
> 
>     echo "<LI>" . stripslashes($row["FirstName"]) . " " .
> stripslashes($row["LastName"]) . " from " . stripslashes($row["CityState"]);
> 
> }



-- 
Mike Gifford, OpenConcept Consulting, http://openconcept.ca
Offering everything your organization needs for an effective web site.
Featured Client: http://rabble.ca - News For the Rest of Us!
Courage my friends, 'tis not too late to make a better world - T. Douglas





I was going through this fantastic tutorial on HTTP
Authentication at Zend.com! It mentioned that to have
this working, PHP must be "Installed as a Module" and
NOT as "CGI Version". Because it will not work in CGI
version. 
Tell me something, how and from where can i install
PHP as a Module on my system? I'm using a PWS
(Personal Web Server) on my Windows 98 machine. 
I had downloaded PHP from the php.net site and
installed as per the instructions in the manual. 

What is the difference between the Module & CGI
version? Is it possible for me to Install PHP as
module on my computer?

Regards,
T. Edison jr.


=====
Rahul S. Johari (Director)
******************************************
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
*******************************************

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/




There is an ISAPI module version of PHP but it is very creaky on anything
less than Windows 2K, however if you are prepared to change from PWS to
Apache, the PHP module for that server API is much more robust.

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






> I was going through this fantastic tutorial on HTTP
> Authentication at Zend.com! It mentioned that to have
> this working, PHP must be "Installed as a Module" and
> NOT as "CGI Version". Because it will not work in CGI
> version.
> Tell me something, how and from where can i install
> PHP as a Module on my system? I'm using a PWS
> (Personal Web Server) on my Windows 98 machine.
> I had downloaded PHP from the php.net site and
> installed as per the instructions in the manual.
>
> What is the difference between the Module & CGI
> version? Is it possible for me to Install PHP as
> module on my computer?

The Microsoft-ism for "as a module" would involve using the ISAPI filter
thingie.

The first "I" in ISAPI stands for IIS, so I have no reassurance that it can
be done with PWS at all.  Even if you *can* do it, you'll probably have to
edit the registry or something equally gnarly, since PWS is pretty
bare-bones.

You *could* switch to Apache which is way mo' better than PWS...

--
WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






on 5/1/01 11:43 PM, Yasuo Ohgaki at [EMAIL PROTECTED] wrote:

> "Bill Shupp" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> Hello,
> 
> SNIP
> 
>> --with-png-dir=/usr/local \
>> --with-pdflib=/usr/local/lib
> 
> --with-pdflib=/usr/local/
> 
> if you have pdflib in /usr/local/lib
> 
> You have /usr/local/lib in ld.so.conf, right?
> then you don't even have to specify directory.
> 
> --with-pdflib
> 
> should work.
> (I'm not sure if your pdflib version is supported by PHP, though)
> 
> Regards,
> --
> Yasuo Ohgaki

You were right.  I guess I never tried just "--with-pdflib".  But that
brought many errors during make.

To make pdflib-4.0.0 work with php 4.0.5, I had to copy the php files from
the pdflib source as described here:

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

Thanks so much!

Bill Shupp





Hey all,

Just looked through the changelog for 4.0.5 and was suprised to see that 
the socket functions had not been fixed,
(set_nonblock does not seem to work under linux), I have retried my 
scripts under the new version but nothing seems to have changed,

For the time being I am going back to the network and filesystem 
functions which do seem to be more reliable now.

I am a little confused though,about the following extracted from the 
changelog:

> Fixed a compatibility problem in some file functions (fgets, fputs, 
> fread, fwrite).
> The ANSI standard says that if a file is opened in read/write mode, 
> fseek() should be called before switching from
> reading to writing and vice versa.

How does this affect calls to a fsockopen?

Can anybody else can confirm that set_nonblock() is indeed broken. If it 
is I will make sure that the bug is reported.


Regards,


Joseph






Hi,

I might have missed a follow up or your original
message, but have you tried socket_set_blocking() ?

--- Joseph Blythe <[EMAIL PROTECTED]>
wrote: > Hey all,
> 
> Just looked through the changelog for 4.0.5 and was
> suprised to see that 
> the socket functions had not been fixed,
> (set_nonblock does not seem to work under linux), I
> have retried my 
> scripts under the new version but nothing seems to
> have changed,
> 
> For the time being I am going back to the network
> and filesystem 
> functions which do seem to be more reliable now.
> 
> I am a little confused though,about the following
> extracted from the 
> changelog:
> 
> > Fixed a compatibility problem in some file
> functions (fgets, fputs, 
> > fread, fwrite).
> > The ANSI standard says that if a file is opened in
> read/write mode, 
> > fseek() should be called before switching from
> > reading to writing and vice versa.
> 
> How does this affect calls to a fsockopen?
> 
> Can anybody else can confirm that set_nonblock() is
> indeed broken. If it 
> is I will make sure that the bug is reported.
> 
> 
> Regards,
> 
> 
> Joseph
> 
> 
> 
> -- 
> 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]
> 


=====
To find out more about me : http://www.geocities.com/mimodit
My bookmarks are available @ http://mukul.free.fr






Mukul Sabharwal wrote:

> Hi,
> 
> I might have missed a follow up or your original
> message, but have you tried socket_set_blocking()

Mukul,

Yes, socket_set_blocking  does not work with the new socket functions, 
it is for the network functions, one must use set_nonblock() which to 
the best of my knowledge does not work under linux (or windows?)

If you do a search in the list achive for sockets you will see some 
posts about this from me which go into more detail.

Regards,

Joseph







At 11:25 02.05.01 +0800, you wrote:
>I try to use configure to config pdflib in FreeBSD
>when i make it, i got a error messages
>
>cd bind/php && make
>make: no target to make.
>*** Error code 2 (ignored)
>--
first you have to make the pdflib
then you have to make install
(the include and lib files have to be present in the path)
then you have to configure php "--with-pdflib" then make and so on
look in the manual -> installation
Oliver





At 23:30 01.05.01 -0300, you wrote:
>Hy guys....
>how can i know the width and height of an image?
>[ r a f a e l   f a r i a] _____________________
>[EMAIL PROTECTED]
>WebMaster Universo Online - http://www.uol.com.br
try GetImageSize(string filename, array[imageinfo]);
oliver





I think

expose_php = Off

is first thing to do instead of changing association.
(As well as disabling server signature)

extension does not tell much, but expose_php tells PHP version also, if you care
about crackers.
Crackers will notice you care about security somewhat. It does not protect your
server from experienced crackers, though.

Regards,
--
Yasuo Ohgaki


""Johnson, Kirk"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I would like opinions on a security question.
>
> A co-worker suggested we rename our application files to some extension
> other than .php (for example, .htm). The reasoning being that the .php
> extension tells a cracker that we are using PHP, and not ASP, or ColdFusion,
> etc. The cracker can focus immediately on vulnerabilities of PHP.
>
> So, is there something to be gained by masking our server setup by changing
> our filename extension?
>
> TIA
>
> Kirk
>
> --
> 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]
>






Could any one tell me how I can turn on error reporting. The server i use has 
it turned off and when there is an error on one of my scripts the page goes 
blank, and i have know idea where or what type the error is. Can it be done 
using a .htaccess file? if it can how?

clint




in php.ini, this session
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

key name is "error_reporting", set it to E_ALL while developing...

-elias
http://eassoft.cjb.net


"BigVeggie" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Could any one tell me how I can turn on error reporting. The server i use
has
> it turned off and when there is an error on one of my scripts the page
goes
> blank, and i have know idea where or what type the error is. Can it be
done
> using a .htaccess file? if it can how?
>
> clint
>
> --
> 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 reason, whenever i run my script for the first time in the browser,
the static source file get parsed and produces errors....

My script have JavaScript in it, and also my script calls the
"session_start();"

Now first time the script is beeing run, i view source and see in my static
part of file:

          <td><img border="0"
src="../images/slogo.gif?PHPSESSID=a969d3d42b6277125c9830a7e09d3cc2"></td>

knowing that that previous line is a static part, why the ?PHPSESSID got
appeneded to it?

beside that, it changes my original javascript line from:

          <td><a href="../services/hosting/main.php"><img border="0"
src="../images/shared1.gif" onmouseover="JavaScript:
imgmenu1.src='../images/shared1over.gif'" onmouseout='JavaScript:
imgmenu1.src="../images/shared1.gif"' name="imgmenu1"></a></td>


to:

          <td><a
href="../services/hosting/main.php?PHPSESSID=a969d3d42b6277125c9830a7e09d3cc
2"><img border="0"
src="../images/shared1.gif?PHPSESSID=a969d3d42b6277125c9830a7e09d3cc2"
onmouseover="JavaScript: imgmenu1.src="../images/shared1over.gif""
onmouseout="JavaScript: imgmenu1.src="../images/shared1.gif""
name="imgmenu1"></a></td>


As you notice, the JavaScript statment is now erroneous because the single
quote got replaced with another double-quote.

Can any one tell me what's wrong? and how can i overcome this problem?

thanks.

-elias
http://www.eassoft.cjb.net








Check your php.ini

[SESSION]
url_rewriter.tags =  .....


Richard



""elias"" <[EMAIL PROTECTED]> wrote in message
9coco0$uq8$[EMAIL PROTECTED]">news:9coco0$uq8$[EMAIL PROTECTED]...
> For some reason, whenever i run my script for the first time in the
browser,
> the static source file get parsed and produces errors....
>
> My script have JavaScript in it, and also my script calls the
> "session_start();"
>
> Now first time the script is beeing run, i view source and see in my
static
> part of file:
>
>           <td><img border="0"
> src="../images/slogo.gif?PHPSESSID=a969d3d42b6277125c9830a7e09d3cc2"></td>
>
> knowing that that previous line is a static part, why the ?PHPSESSID got
> appeneded to it?
>
> beside that, it changes my original javascript line from:
>
>           <td><a href="../services/hosting/main.php"><img border="0"
> src="../images/shared1.gif" onmouseover="JavaScript:
> imgmenu1.src='../images/shared1over.gif'" onmouseout='JavaScript:
> imgmenu1.src="../images/shared1.gif"' name="imgmenu1"></a></td>
>
>
> to:
>
>           <td><a
>
href="../services/hosting/main.php?PHPSESSID=a969d3d42b6277125c9830a7e09d3cc
> 2"><img border="0"
> src="../images/shared1.gif?PHPSESSID=a969d3d42b6277125c9830a7e09d3cc2"
> onmouseover="JavaScript: imgmenu1.src="../images/shared1over.gif""
> onmouseout="JavaScript: imgmenu1.src="../images/shared1.gif""
> name="imgmenu1"></a></td>
>
>
> As you notice, the JavaScript statment is now erroneous because the single
> quote got replaced with another double-quote.
>
> Can any one tell me what's wrong? and how can i overcome this problem?
>
> thanks.
>
> -elias
> http://www.eassoft.cjb.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]
>






I'm not sure if www.f2s.com offer Perl5+ but it does offer MySql and Cgi and
PHP i guess.

-elias
http://eassoft.cjb.net

"David Bruce" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> My host is Windows 98, Xitami and unstable MySQL and Perl/CGI.
>
> I'm looking for a *free* host, with CGI, Perl 5+, MySQL access, SSI &
> PHP.
>
> Thanks,
> Owen
>
>
> --
> 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:
    Somebody knows if there are something similar to PHP-Nuke but for a
virtual shop?

Best Regards.
-------------------------------------------------------------
VCLCrawler.com, your VCL search engine
http://www.vclcrawler.com

W2Kwm, Windows 2000 interface for XWindow
http://www.vclcrawler.com/w2kwm/index.htm

ebnoud.com, El Boletín No Oficial de Usuarios de Delphi
http://www.ebnoud.com





You should be able to test the ending time field in PHP and output different
display based on that...

Show a snippet of source code.

PS  You've tackled a really hard problem as a beginner -- Calenders *look*
simple, are have all sorts of hidden complexities, as you've discovered.

--
WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Tim Thorburn <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Sunday, April 29, 2001 3:50 PM
Subject: [PHP] Reporting from Database


> Hi,
>
> I'm setting up an event calendar for an organization, and I'm running into
> several problems.  Firstly, there seems to be no standardization in the
> event listings - by this I mean that some events are single days while
> others span several days - some events have only one start time during the
> day while others have three or more.
>
> I have the database setup in MySQL already to cope with the different
> listings, however, I want to use a PHP script (version 3.0.16) to display
> the information in a web browser.  This part mostly works, I say mostly,
> because it displays everything in the database that satisfies the search
> (in this case by the month, then by the event).  I would like to have
> someway of making the PHP script determine if there is a value in the
table
> and if not, to not display anything.
>
> An example is as follows:
>
> Event A begins at 10:00AM and goes to 11:30AM, then begins again at 3:30PM
> until 5:00PM.  While Event B simply begins at 1:30PM.  In this example I
do
> not want the second time block to show up for Event B, but I do want it
for
> Event A.
>
> I hope this does not come across as too confusing, but I've been working
on
> it all weekend with my limited beginners knowledge of PHP.
>
> Thanks
> -Tim
>
>
> --
> 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]
>





> start sending email (this process would take many minutes). However before
> this script finished, another copy of the same script started, and this
new
> copy was sending emails to the same users again. The original script
> continued. Result: duplicate emails

Wild Guess:

You are using cron and have the settings in your crontab incorrect.

For example:
* * * * * 0 /full/path/to/your/spam/script

This would attempt to execute the script on Sundays.  EVERY MINUTE, during
Sunday, however.

Disclaimer: I probably got the *'s and 0 mixed up a bit.  I'm not a crontab
expert.

--
WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






You could maybe write a shell script owned by mysql, but executable by
world, that looks at the file sizes.

--
WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Mark Lo" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Sunday, April 29, 2001 8:01 AM
Subject: [PHP] how to measure databases


> Hi,
>
>      I would like to know how to measure how many MB of one particular
> databases is taken in PHP command.  I know I can always use the command of
> du ... .  But this command is not work under apache because the user and
> group are nobody, while the user and group for mysql is mysql, also the
> permission is set to read and write only for mysql user and group.  I
would
> like to know is there any other method to measure the databases then post
it
> on the web.
>
> Thank you
>
> Mark
>
>
> --
> 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 it possible with PHP (3.0.16) to detect which browser a user has and
> then load an image based on the browser type?  I've found the
get_browser()
> command in the manual, but it doesn't look like that does what I want, or
I
> could just be looking at it wrong.
>
> Has anyone tried this before?  and if so, could you provide some
assistance.

get_browser() only works in conjunction with a nice big fat browscap.ini
file you need to snarf from somewhere.

Probably easier to look at $HTTP_USER_AGENT variable and ereg_match() to
determine what browser it is -- Depending on just how fine-tuned you need to
check.

Check the output from <?php phpinfo();?> using a couple browsers.

--
WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






I have been racking my brain with this for hours and I am not
getting anywhere.

session_register doesn't seem to be registering my variables.

Several questions to see if I am even on the right track.

Do you need to register a variable with the session before you
assign it a value?  

session_register should return true if the variable was
successfully registered?

The variable name and it's value should be written to the file
with the same name as session_id()?

Jennifer




Maybe this example will help you:

Program 1:

<?php
session_start();
session_register('varA');
session_register('varA');

varA = ....
varB = ...
?>

Program 2:

<?php
session_start();
print("$varA $varB");
?>


Richard


"Jennifer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have been racking my brain with this for hours and I am not
> getting anywhere.
>
> session_register doesn't seem to be registering my variables.
>
> Several questions to see if I am even on the right track.
>
> Do you need to register a variable with the session before you
> assign it a value?
>
> session_register should return true if the variable was
> successfully registered?
>
> The variable name and it's value should be written to the file
> with the same name as session_id()?
>
> Jennifer
>
> --
> 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]
>






> -----Original Message-----
> From: Jennifer [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 02, 2001 2:51 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] session_register()
> 
> Do you need to register a variable with the session before you
> assign it a value? 

Not in my experience.
 
> session_register should return true if the variable was
> successfully registered?

It returns "1".

> The variable name and it's value should be written to the file
> with the same name as session_id()?

Yes, here's a sample from a session file: superUser|s:3:"Yes";
Here's a sample session filename: sess_01bc2e24aa5291300887948f0af74899

Kirk 




Hi all,

   I'm facing this serious problem where i can not ftp to my server. Any 
idea to help to solve the problem? It could be possibly caused by the 
ownership of the ftp folder. But, i don't know which folder is the right ftp 
folder for me to change mode. Please help.


E K

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.






>Once again, if it got passed to any of you, through me, my apologies. I 
>wouldn't trust my anti-virus software on this, I could find any reference 
>to it at Symantec. Maybe it has another name?
>
>Feeling like a leper - Miles Thompson

Look for Navidad or W32/Navidad.e

I think you should also look for a antivirus product. It's less expensive 
then reconfigure your system.. A reinstall is a good cleanup though..

Bye,


B.





every time you run mainpage.php, the array is being reinitialised. Lose the
line "$myArray=array();".

        Tim Ward
        Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html


> -----Original Message-----
> From: Christian [mailto:[EMAIL PROTECTED]]
> Sent: 30 April 2001 09:17
> To: [EMAIL PROTECTED]
> Subject: session array :-/
> 
> 
> Hi,
> 
> I'm having trouble with a two dimensional array with sessions.
> Following is an example of my code which is split between three pages.
> 
> --------------------------------
> ### myFunctions.php ###
> 
> function addToMyArray($newStuff)
> {
>    global $myArray;
>    $myArray[]=array("id"=>$newStuff[myId],"name"=>$newStuff[name]);
> }
> 
> 
> ### mainPage.php ###
> 
> session_start();
> include("myFunctions.php");
> 
> $myArray=array();
> session_register(myArray);
> 
> // add some stuff to myArray here to highlight the prob
> $myArray[]=array("id"=>"1","name"=>"gabby");
> $myArray[]=array("id"=>"2","name"=>"marla");
> 
> ..
> 
> // if conditions meet
>    addToMyArray($HTTP_POST_VARS);
> 
> // code to open myOtherWindow.php in a new window.
> 
> // code to submit a form whos action is PHP_SELF
> 
> 
> 
> ### myOtherWindow.php ###
> 
> session_start();
> 
> // code to display contents of myArray
> 
> ------------------------------
> 
> Now on first call to addToMyArray()
> I have three elements two that I added directly
> and one via the function call.
> 
> Now if the function gets called again there is still
> only 3 elements .. two that I added directly and the
> third one from the latest function call.
> The element from the first call has simply vanished !!!
> And that's my problem, why is the element vanishing ???
> 
> Thanx,
> Christian
> 
> 
> 
> 
> 
> 




> $myArray=array();

Is this line getting executed that second time?...

Also, I think it's better to register a variable *before* assigning any
value to it...  Whether this is just coding style or it actually matters, I
dunno.

--
WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






depends how reliable the format of the string you're splitting is. If they
are all like your examples then ...

foreach ($stuff as $key=>$element)
{       $dummy = explode(" ", $element);
        $stuff[$key] = array();
        $stuff[$key]["user"] = $dummy[0];
        $stuff[$key]["browser"] = $dummy[2];
}

foreach ($stuff as $element)
{       foreach($element as $field=>$value) echo("$field=>$value<br>");
}

... should do it. if the strings are more complicated you'll need to look at
stristr, substr, etc.

        Tim Ward
        Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html


> -----Original Message-----
> From: Matthew Luchak [mailto:[EMAIL PROTECTED]]
> Sent: 01 May 2001 19:09
> To: [EMAIL PROTECTED]
> Subject: split and array logic
> 
> 
> 
> I can't quite get the logic to create my own associative arrays:
> 
> if:
> 
>       $stuff[0]="165.33.114.63 anonymous Mozilla/4.0" 
>       $stuff[1]="213.35.354.93 anonymous Mozilla/4.0"
> 
> how do I end up with:
> 
>       $stuff[0][user]="165.33.114.63"
>       $stuff[0][browser]="Mozilla/4.0" 
> 
>       $stuff[1][user]="213.35.354.93"
>       $stuff[1][browser]="Mozilla/4.0" 
> 
> I am hacking away at:
> 
>       foreach( $stuff as $cFile ) {
>       
>               list ($user, $junk, $browser) = split (' ', $cFile);
>               }
> 
> 
> and it hurts.....any hints ?
> 
> TIA,
> 
> ____________________________ 
> Matthew Luchak 
> Webmaster
> Kaydara Inc. 
> [EMAIL PROTECTED]
> 
> 





I wonder if using microtime() gives _actual_ time spent for the query
while explain gives _processor_ time.

Anuradha

On Thu, 26 Apr 2001, Maxim Maletsky wrote:

> what about microtime() ?
> 
> you can do it your self:
> 
> $start = microtime();
> mysql_query()...
> $stop = microtime();
> 
> $token = round($stop-$start, 3);
> echo "Query took $token seconds";
> 
> I mean this is not as precise as SQL would do itself, but will work
> approximately.
> 
> 
> Sincerely, 
> 
>  Maxim Maletsky
>  Founder, Chief Developer
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
> 
> 
> 
> 
> -----Original Message-----
> From: James, Yz [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 5:17 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] SQL Query time?
> 
> 
> Hi all,
> 
> I have seen a few pages that echo the time it's taken to execute an SQL
> query, like "The results in the database were returned in 0.3 seconds."
> Anyone know if there's a built in function to display this, and if there is,
> what it is?  My more-than-useless-ISP seems to have taken an aversion to
> allowing me to surf tonight without disconnecting me.
> 
> Thanks.
> James.
> 
> 
> 
> -- 
> 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]
> 
> 





EXPLAIN gives you the time (through processor?) of the clauses translated
into WHERE (JOIN, GROUP, etc)

if you use 1000 billions of functions in your query, the real time of that
query will be somewhat slower, but not for EXPLAIN.

microtime() is in php, so it gives you the time of when he called the
module, when he received and gave you back the answer.

none of them is precise for the purpose of printing on web. Bad idea.
But for the database design I still prefer EXPLAIN since it is for where's,
where YOU are the one to play with INDEXes and KEYs.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-----Original Message-----
From: Anuradha Ratnaweera [mailto:[EMAIL PROTECTED]]On Behalf Of Anuradha
Ratnaweera
Sent: Wednesday, May 02, 2001 2:06 PM
To: Maxim Maletsky
Cc: 'James, Yz'; [EMAIL PROTECTED]
Subject: RE: [PHP] SQL Query time?



I wonder if using microtime() gives _actual_ time spent for the query
while explain gives _processor_ time.

Anuradha

On Thu, 26 Apr 2001, Maxim Maletsky wrote:

> what about microtime() ?
>
> you can do it your self:
>
> $start = microtime();
> mysql_query()...
> $stop = microtime();
>
> $token = round($stop-$start, 3);
> echo "Query took $token seconds";
>
> I mean this is not as precise as SQL would do itself, but will work
> approximately.
>
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
>
>
>
> -----Original Message-----
> From: James, Yz [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 5:17 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] SQL Query time?
>
>
> Hi all,
>
> I have seen a few pages that echo the time it's taken to execute an SQL
> query, like "The results in the database were returned in 0.3 seconds."
> Anyone know if there's a built in function to display this, and if there
is,
> what it is?  My more-than-useless-ISP seems to have taken an aversion to
> allowing me to surf tonight without disconnecting me.
>
> Thanks.
> James.
>
>
>
> --
> 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]
>
>


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






Jon,

Try this ...  I know the code could be trimmed down, but I wrote it this way
for ease of reading.

<select name="Date">
<?

$startday = "01";
$startmonth = "01";
$staryear = "01";

$endday = "01";
$endmonth = "07";
$endyear = "01";

$startperiod = mktime(0,0,0,$startmonth,$startday,$startyear);
$endperiod = mktime(0,0,0,$endmonth,$endday,$endyear);

while($startperiod <= $endperiod) {

 $date = getdate($startperiod);
 $year = $date['year'];
 $month =  $date['mon'];
 $day =  $date['mday'];

 echo "<option value=\"$year-$month-$day\">";
 echo "$month/$day/$year";
 echo "</option>\n";

 $startperiod = $startperiod + 86400;

}
?>
</select>

Basically just uses mktime() and getdate()

The 86400 is the number of seconds in the day, and the option value is set
to return in the format YYYY-MM-DD (that format's used a lot in MySQL
tables).

Have fun ;)

James.

> 01/01/01-01/07/01
> 01/08/01-01/14/01
> 01/15/01-01/21/01
> etc
> etc
> till the end of 2002 and further in the future eventually
>
> I'd like to make PHP generate this for me so I don't have to handcode it
for
> each year in the future.  I've looked at the date/time functions and I'm a
> bit confused.  Any help would be appreciated.  Thanks!
>
> Jon
>
>
> --
> 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 Thu, 19 Apr 2001, James, Yz wrote:

> Is there a method of extracting rows from a MySQL table Uniquely (as in only
> once) ?..... For example, when a user performs a search, using two words,
> it may return the same row twice if the search is spread over two or more
> SQL "selections".  An example:

I am not sure whether you can do it on mysql. On postgresql you can do a

select distinct ...

Anuradha





>I am trying ot understand how could a PHP script authenticate against a
LDAP tree (NDS) that >is not in the same host?
>
>Anyone has an example about that?

No sample code, but I assume you just pass in the IP or hostname of the
remote server for http://php.net/manual/en/function.ldap-connect.php

Disclaimer:  What I know about LDAP could fit on a matchbook cover, with
room for that cute girl's phone number. :-)

--
WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm







Hello,
I have a page A with a combobox. Next to the combobox I have a link to
another page (B). The idea is that I select a value in my combobox, then
click the link and the value of the selected value in the combobox should be
send to the page B. Is this possible with php and html? I've tried something
like:
<select name=choice>
    <option>aaa
    <option>bbb
</select>
....
<a href="B.php?var=$choice" target="this">B</a>

but this didn't work, guess it only works if you insert a value directly in
the link and not a variable.

I thought of working with buttons but the problem got more complicated. Page
A actually is a form (the global form), containing three comboboxes, each
one with a link (to page B). The global form has a submit button which leads
to page C. If I click the global forms button all the values selected in the
comboboxes should be sent (easily done with sessionvariables). If I click a
link then only the value of the combobox under whom the link is found should
be sent to page B. I tried to make  three subforms and to replace the links
with a postbutton but that didn't work (guess subform don't exist cause I
didn't find any information about them). So I tried something like:
<form action="page C" method="post">
        <form action = "page B" method="post">
                <select name="cmbox1">
                    <option>aaa
                    <option>bbb
                </select>
                <input type="submit" name="toB_1">
        </form>
        <form action = "page B" method="post">
                <select name="cmbox2">
                    <option>aaa
                    <option>bbb
                </select>
                <input type="submit" name="toB_2">
        </form>
        <form action = "page B" method="post">
                <select name="cmbox3">
                    <option>aaa
                    <option>bbb
                </select>
                <input type="submit" name="toB_3">
        </form>
<input type="submit" name="toC">
</form>

 The idea now was when I clicked toB_1 or toB_2 or toB_3 then page B would
be loaded and only one value (of the right combobox) should be sent to page
B. But when I click toC then all three values should be sent to page C.

My question is if there is a solution in php to solve this problem (to send
those variables seperately) and so to solve the above stated problem.

Thanks in advance

Pascal







On 30 kwietnia 2001 at 18:23:04
Yasuo Ohgaki <[EMAIL PROTECTED]>
wrote:

> I don't use the extension, but XML assumes UTF-8 charcode. If you
> have problem with ISO-8859-2, how about convert it to UTF-8 using
> iconv module?

XML assumes that parameter "encoding=ISO-8859-2" should work
correctly, but it does NOT work in Sablot/PHP4. And I do not want to
launch any external application from PHP because it will slow down my
web serwer.

--
Yarek





I found that utfdecode() can extract only ISO-8859-1. I need to
convert from UTF-8 to ISO-8859-2? Will it be possible soon?

--
Yarek





Hi Nathan,

With compliments:

<?php

function HexToChar($Txt) {

        // Read Hex and convert to characters
        // Rudolf Visagie - 1 May 2001
        
    $Txt = strtoupper($Txt);

    $NewTxt = "";

    for ($i = 0;  $i < strlen($Txt); $i=$i+2) {
        $LeftHexByte = substr($Txt, $i, 1);
        if ($LeftHexByte >= "0" AND $LeftHexByte <= "9") {
            $LeftOffset = 48;
        } else {
            $LeftOffset = 55;
        }
        $RightHexByte = substr($Txt, $i + 1, 1);
        if ($RightHexByte >= "0" AND $RightHexByte <= "9") {
            $RightOffset = 48;
        } else {
            $RightOffset = 55;
        }
        $CharValue = (ord($LeftHexByte) - $LeftOffset) * 16 +
(ord($RightHexByte) - $RightOffset);
        $NewTxt .= chr($CharValue);
    }

    return $NewTxt;

}

    $Txt =
"0ffffffac0ffffffed0005737200146a6176612e7574696c2e50726f7065727469657339120
fffff";
    $Txt .=
"fd07a70363e0ffffff980200014c000864656661756c74737400164c6a6176612f7574696c2
f5072";
    $Txt .=
"6f706572746965733b787200136a6176612e7574696c2e486173687461626c65130ffffffbb
0f252";
    $Txt .=
"14a0ffffffe40ffffffb803000246000a6c6f6164466163746f724900097468726573686f6c
64787";
    $Txt .=
"3f4000000000000877080000000300000002740005696d61676574004a3c494d47205352433
d226";
    $Txt .=
"87474703a2f2f6d6564696162616e6b2e656476656e74757265732e636f6d2f656476656e74
75726";
    $Txt .=
"5732f6c6162732f627269636b735f7765622e6a7067223e7400047465787474020249742069
73206";
    $Txt .=
"96d706f7274616e7420746f20656d70686173697a652074686174206120666163696c697461
746f7";
    $Txt .=
"220646f6573206e6f74206e65656420746f20626520616e2065787065727420696e20746865
20766";
    $Txt .=
"172696f7573207375626a6563742061726561732c206275742073686f756c64206265636f6d
65206";
    $Txt .=
"6616d696c6961722077697468207468652070726f6a6563747320616e64206d617465726961
6c732";
    $Txt .=
"0746861742073747564656e74732077696c6c20626520646f696e672c20616e642062652061
77617";
    $Txt .=
"265206f6620686f7720746f206765742068656c70206f72206c6f6f6b207570207465726d73
20616";
    $Txt .=
"e6420616e73776572732e2020496e20706172746963756c61722c2066616d696c6961726974
79207";
    $Txt .=
"769746820746865204c45474f3c7375703e267265673b3c2f7375703e20656c656d656e7473
20697";
    $Txt .=
"320686967686c79207265636f6d6d656e6465642e20205043532068617320646576656c6f70
65642";
    $Txt .=
"06120736570617261746520636f7572736520666f637573696e67206f6e2074686520757365
206f6";
    $Txt .=
"620746865204c45474f3c7375703e267265673b3c2f7375703e206d6174657269616c732e20
20416";
    $Txt .=
"c6c20666163696c697461746f72732073686f756c64207363686564756c652074696d652074
6f207";
    $Txt .= "4616b652074686973206164646974696f6e616c20636f757273652e7870";

?>

<html>
        <head>
                <title>Read Hex dump</title>
        </head>
        <body>
                <?echo HexToChar($Txt)?>
        </body>
</html>

Cheers,

Rudolf Visagie
QEDI

-----Original Message-----
From: Nathan Cook [mailto:[EMAIL PROTECTED]]
Sent: 01 May 2001 11:16
To: Rudolf Visagie
Subject: Re: [PHP] String Type Unknown


How were you able to convert that?

Thanks!
Nathan Cook
[EMAIL PROTECTED]
----- Original Message -----
From: "Rudolf Visagie" <[EMAIL PROTECTED]>
To: "Nathan Cook" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, May 01, 2001 2:53 AM
Subject: RE: [PHP] String Type Unknown


Hi Nathan,

It's a hex dump and it reads:

ÿÿúÀÿÿÿí sr java.util.Properties9ÿÿý§càÿÿÿ~ L defaultst
Ljava/util/Properties;xr java.util.Hashtableÿÿû°òR ÿÿÿäÿÿûEUR0 $`
¦ÆöDf7F÷$ -F?&W6?öÆG??@     w      t imaget J<IMG
SRC="http://mediabank.edventures.com/edventures/labs/bricks_web.jpg";>t
texttIt is important to emphasize that a facilitator does not need to be
an expert in the various subject areas, but should become familiar with the
projects and materials that students will be doing, and be aware of how to
get help or look up terms and answers.  In particular, familiarity with the
LEGO<sup>&reg;</sup> elements is highly recommended.  PCS has developed a
separate course focusing on the use of the LEGO<sup>&reg;</sup> materials.
All facilitators should schedule time to take this additional course.xp

Rudolf Visagie
QEDI

-----Original Message-----
From: Nathan Cook [mailto:[EMAIL PROTECTED]]
Sent: 30 April 2001 10:31
To: Php List
Subject: [PHP] String Type Unknown


I have this string:

0ffffffac0ffffffed0005737200146a6176612e7574696c2e50726f7065727469657339120f
ffff
fd07a70363e0ffffff980200014c000864656661756c74737400164c6a6176612f7574696c2f
5072
6f706572746965733b787200136a6176612e7574696c2e486173687461626c65130ffffffbb0
f252
14a0ffffffe40ffffffb803000246000a6c6f6164466163746f724900097468726573686f6c6
4787
03f4000000000000877080000000300000002740005696d61676574004a3c494d47205352433
d226
87474703a2f2f6d6564696162616e6b2e656476656e74757265732e636f6d2f656476656e747
5726
5732f6c6162732f627269636b735f7765622e6a7067223e74000474657874740202497420697
3206
96d706f7274616e7420746f20656d70686173697a652074686174206120666163696c6974617
46f7
220646f6573206e6f74206e65656420746f20626520616e2065787065727420696e207468652
0766
172696f7573207375626a6563742061726561732c206275742073686f756c64206265636f6d6
5206
6616d696c6961722077697468207468652070726f6a6563747320616e64206d6174657269616
c732
0746861742073747564656e74732077696c6c20626520646f696e672c20616e6420626520617
7617
265206f6620686f7720746f206765742068656c70206f72206c6f6f6b207570207465726d732
0616
e6420616e73776572732e2020496e20706172746963756c61722c2066616d696c69617269747
9207
769746820746865204c45474f3c7375703e267265673b3c2f7375703e20656c656d656e74732
0697
320686967686c79207265636f6d6d656e6465642e20205043532068617320646576656c6f706
5642
06120736570617261746520636f7572736520666f637573696e67206f6e20746865207573652
06f6
620746865204c45474f3c7375703e267265673b3c2f7375703e206d6174657269616c732e202
0416
c6c20666163696c697461746f72732073686f756c64207363686564756c652074696d6520746
f207
4616b652074686973206164646974696f6e616c20636f757273652e7870

And I don't know what type it is.  It is it a binary string?  Can I convert
it
to text and if so, how?

Thank You,
Nathan Cook
[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]






Since it contains only digits 0-9 and letters a-f, it looks like
hexadecimal. Why don't you try to read two characters at a time and either
convert them to binary or check their ascii values. There seem to be many
ascii values however.

Where did you get this from?

Anuradha

On Mon, 30 Apr 2001, Nathan Cook wrote:

> I have this string:
> 
> 0ffffffac0ffffffed0005737200146a6176612e7574696c2e50726f7065727469657339120fffff
> fd07a70363e0ffffff980200014c000864656661756c74737400164c6a6176612f7574696c2f5072
> 6f706572746965733b787200136a6176612e7574696c2e486173687461626c65130ffffffbb0f252
> 14a0ffffffe40ffffffb803000246000a6c6f6164466163746f724900097....
> 
> And I don't know what type it is.  It is it a binary string?  Can I convert it
> to text and if so, how?
> 
> Thank You,
> Nathan Cook
> [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]
> 
> 





Nathan,

Another way to do it (but much less fun):
<?php

function HexToChar($Txt) {

        // Read Hex and convert to characters
        // Rudolf Visagie - 1 May 2001

    $Txt = strtoupper($Txt);

    $NewTxt = "";

    for ($i = 0;  $i < strlen($Txt); $i+=2) {
        $CharValue = base_convert(substr($Txt, $i, 2), 16, 10);
        $NewTxt .= chr($CharValue);
    }

    return $NewTxt;

}


    $Txt =
"0ffffffac0ffffffed0005737200146a6176612e7574696c2e50726f7065727469657339120
fffff";
    $Txt .=
"fd07a70363e0ffffff980200014c000864656661756c74737400164c6a6176612f7574696c2
f5072";
    $Txt .=
"6f706572746965733b787200136a6176612e7574696c2e486173687461626c65130ffffffbb
0f252";
    $Txt .=
"14a0ffffffe40ffffffb803000246000a6c6f6164466163746f724900097468726573686f6c
64787";
    $Txt .=
"3f4000000000000877080000000300000002740005696d61676574004a3c494d47205352433
d226";
    $Txt .=
"87474703a2f2f6d6564696162616e6b2e656476656e74757265732e636f6d2f656476656e74
75726";
    $Txt .=
"5732f6c6162732f627269636b735f7765622e6a7067223e7400047465787474020249742069
73206";
    $Txt .=
"96d706f7274616e7420746f20656d70686173697a652074686174206120666163696c697461
746f7";
    $Txt .=
"220646f6573206e6f74206e65656420746f20626520616e2065787065727420696e20746865
20766";
    $Txt .=
"172696f7573207375626a6563742061726561732c206275742073686f756c64206265636f6d
65206";
    $Txt .=
"6616d696c6961722077697468207468652070726f6a6563747320616e64206d617465726961
6c732";
    $Txt .=
"0746861742073747564656e74732077696c6c20626520646f696e672c20616e642062652061
77617";
    $Txt .=
"265206f6620686f7720746f206765742068656c70206f72206c6f6f6b207570207465726d73
20616";
    $Txt .=
"e6420616e73776572732e2020496e20706172746963756c61722c2066616d696c6961726974
79207";
    $Txt .=
"769746820746865204c45474f3c7375703e267265673b3c2f7375703e20656c656d656e7473
20697";
    $Txt .=
"320686967686c79207265636f6d6d656e6465642e20205043532068617320646576656c6f70
65642";
    $Txt .=
"06120736570617261746520636f7572736520666f637573696e67206f6e2074686520757365
206f6";
    $Txt .=
"620746865204c45474f3c7375703e267265673b3c2f7375703e206d6174657269616c732e20
20416";
    $Txt .=
"c6c20666163696c697461746f72732073686f756c64207363686564756c652074696d652074
6f207";
    $Txt .= "4616b652074686973206164646974696f6e616c20636f757273652e7870";

?>

<html>
        <head>
                <title>Read Hex dump</title>
        </head>
        <body>
                <?echo HexToChar($Txt)?>
        </body>
</html>

Rudolf Visagie
QEDI

-----Original Message-----
From: Nathan Cook [mailto:[EMAIL PROTECTED]]
Sent: 01 May 2001 11:16
To: Rudolf Visagie
Subject: Re: [PHP] String Type Unknown


How were you able to convert that?

Thanks!
Nathan Cook
[EMAIL PROTECTED]
----- Original Message -----
From: "Rudolf Visagie" <[EMAIL PROTECTED]>
To: "Nathan Cook" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, May 01, 2001 2:53 AM
Subject: RE: [PHP] String Type Unknown


Hi Nathan,

It's a hex dump and it reads:

ÿÿúÀÿÿÿí sr java.util.Properties9ÿÿý§càÿÿÿ~ L defaultst
Ljava/util/Properties;xr java.util.Hashtableÿÿû°òR ÿÿÿäÿÿûEUR0 $`
¦ÆöDf7F÷$ -F?&W6?öÆG??@     w      t imaget J<IMG
SRC="http://mediabank.edventures.com/edventures/labs/bricks_web.jpg";>t
texttIt is important to emphasize that a facilitator does not need to be
an expert in the various subject areas, but should become familiar with the
projects and materials that students will be doing, and be aware of how to
get help or look up terms and answers.  In particular, familiarity with the
LEGO<sup>&reg;</sup> elements is highly recommended.  PCS has developed a
separate course focusing on the use of the LEGO<sup>&reg;</sup> materials.
All facilitators should schedule time to take this additional course.xp

Rudolf Visagie
QEDI

-----Original Message-----
From: Nathan Cook [mailto:[EMAIL PROTECTED]]
Sent: 30 April 2001 10:31
To: Php List
Subject: [PHP] String Type Unknown


I have this string:

0ffffffac0ffffffed0005737200146a6176612e7574696c2e50726f7065727469657339120f
ffff
fd07a70363e0ffffff980200014c000864656661756c74737400164c6a6176612f7574696c2f
5072
6f706572746965733b787200136a6176612e7574696c2e486173687461626c65130ffffffbb0
f252
14a0ffffffe40ffffffb803000246000a6c6f6164466163746f724900097468726573686f6c6
4787
03f4000000000000877080000000300000002740005696d61676574004a3c494d47205352433
d226
87474703a2f2f6d6564696162616e6b2e656476656e74757265732e636f6d2f656476656e747
5726
5732f6c6162732f627269636b735f7765622e6a7067223e74000474657874740202497420697
3206
96d706f7274616e7420746f20656d70686173697a652074686174206120666163696c6974617
46f7
220646f6573206e6f74206e65656420746f20626520616e2065787065727420696e207468652
0766
172696f7573207375626a6563742061726561732c206275742073686f756c64206265636f6d6
5206
6616d696c6961722077697468207468652070726f6a6563747320616e64206d6174657269616
c732
0746861742073747564656e74732077696c6c20626520646f696e672c20616e6420626520617
7617
265206f6620686f7720746f206765742068656c70206f72206c6f6f6b207570207465726d732
0616
e6420616e73776572732e2020496e20706172746963756c61722c2066616d696c69617269747
9207
769746820746865204c45474f3c7375703e267265673b3c2f7375703e20656c656d656e74732
0697
320686967686c79207265636f6d6d656e6465642e20205043532068617320646576656c6f706
5642
06120736570617261746520636f7572736520666f637573696e67206f6e20746865207573652
06f6
620746865204c45474f3c7375703e267265673b3c2f7375703e206d6174657269616c732e202
0416
c6c20666163696c697461746f72732073686f756c64207363686564756c652074696d6520746
f207
4616b652074686973206164646974696f6e616c20636f757273652e7870

And I don't know what type it is.  It is it a binary string?  Can I convert
it
to text and if so, how?

Thank You,
Nathan Cook
[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]





On Thursday 26 April 2001 00:37, Michael Conley wrote:
>  I am going to have a page that will be used for visitors to upload a file
> to my web server.  I already use gzcompress to compress some of the pages

Just state that all files should be compressed cause you can't do anything 
with the files before they are on your server and then it's too late :)

----------------------------------------
Content-Type: text/plain; charset="us-ascii"; name="Attachment: 1"
Content-Transfer-Encoding: 7bit
Content-Description: 
----------------------------------------
stop that

-- 
 php developer / CoreTrek AS        | As near as I can tell, you're not any
 Sandnes / Rogaland / Norway        | crazier than the average asshole on the 
 web: http://www.moijk.net/         | street.   -- R.P. McMurphy, "One Flew




I used function dbase_xxx to access foxpro database (.dbf) but it's not work.
Here is my code :
  <?
  if (dbase_open("/home/benny/test/employee.dbf",0)) {
    for ($i=1; $i<=dbase_numrecords($open); $i++) {
      $rec = dbase_get_record($db, $i);
      $nf  = dbase_numfields($db);
      for ($j=0; $j < $nf; $j++) {
        print $rec[$j]."<br>\n";
      }
    }
  }
  ?>
Everytime I call this page there's a message :
        Warning: unable to open  database /home/benny/test/employee.dbf in      
/home/benny/htdocs/foxpro.php on line 2
I used php 4.0.4 and Visual Fox Pro 5.0.
Before that I have mounted my foxpro dbf file to my linux in the /home/benny/test 
directory.
Is there anything wrong?
Anyone could help me?

Regards;

Benny.


Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at 
http://www.eudoramail.com





If you are not careful, anyone will be able to run the script!

Anuradha

On Thu, 19 Apr 2001, Bertjan Schrader wrote:

> I need tot start a PHP script at night with the crontab. I tried to do it
> with lynx (lynx http://www.domain.nl/test.php) as a commandline within the
> crontab. Lynx is starting but the PHP script is not working. Anyone an idea
> how to do it?
> 
> OS:  Redhat Linux 5.2
> Apache
> PHP as a apache module
> 
> thanks!






WML is an easier solution (search freshmeat for wml - website meta
language).

Anuradha

On Sun, 29 Apr 2001, Steven Haryanto wrote:

> Does anyone know a rather advanced template solution in PHP?
> At least one that supports loop and if (like HTML::Template),
> and directives/commands would be nice (like Perl's Template
> Toolkit).
> 
> I am currently rolling my own, but still not happy with the
> result of the design. I'd be happy to use one that is already
> out there.
> 
> Steve
> 
> 
> -- 
> 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]
> 
> 






Most of your guidelines match with our practices. Here are some comments.

On Sat, 28 Apr 2001, Steven Haryanto wrote:

> 0.1 We are writing PHP4 application here, not PHP3, nor Perl, Python, etc.
>      So use PHP idioms.

Same here.

> 0.3 Consistency matters.
> 
> 0.4 Standards is important.
> 
> 0.5 Readability matters. Especially since the code will be touched by
>      several developers.

Agreed.

> 1.0 Enclosing PHP code
> 
>      Always use <?php ?>.

We use <? ?> here. But sticking to a single method is fine.

> 1.4 Whitespaces
> 
>      - No whitespace after function or method name. Example:
> 
>          exit()

We also use this. But I have seen others using spaces. Even there are some
examples in php-manual with spaces (e.g. array_shift).

>      - Whitespace in expressions are usually not necessary. But use them when
>        they enhance readability.
> 
>          $a = $b + $c*(5*time());

We prefer

           $a = $b + $c * (5 * time());

> 1.5 Function names
> 
>      Function names are not case sensitive in PHP. Use the all-lowercase
>      notation.

Since most of us come from good old C regime, this should be the most
readable form.

> 1.6 Quotes
> 
>      Use whichever ones you like. But if you can use '' for simple strings,
>      and "" only if you need interpolation.

This should _very_slightly_ improve performance too.

> 2.2 Debugging comments.
> 
>      # is used to comment out certain parts of a code during debugging.

We always use /* */ because we filter php files through a stripper which
also removes newlines before sent to the real server.

> 2.3 Documentation comments.

We use the style used in the linux kernel.

> 3. Naming

We use all lowercase for variables like "variable", "my_name". Also, in
html forms, analogous variables take the form "variable", "myName".

> 4. File organization

We use WML (website meta language - www.engelschall.com/sw/wml/) with make
to produce single php files and do _not_ use the include feature of php.

Also, we have written scripts that creates diff files between releases.

> 5. Testing

We have few files that are included (WML include and not PHP include) from
every file. The production version and testing versions have different
sets of them, and make rebuilds the site selectively.

> 6. Creating documentation

We use tex, and we are planning to go for texinfo.

> 7. Database programming

We use _only_ postgresql, because of its feature richness and performance.
So no problem of abstraction.

> 8. Error handling
>
> ...
>
> 8.2 Reporting error

We use the guidelines given in "GNU Coding Standards" by Richard Stallman.
 
> 9. Portability

We are expecting portability over POSIX like systems.

Anuradha





At 5/2/2001 12:46 PM, Anuradha Ratnaweera wrote:

>Most of your guidelines match with our practices. Here are some comments.

Thanks for the comments.

> > 1.4 Whitespaces
> >
> >      - No whitespace after function or method name. Example:
> >
> >          exit()
>
>We also use this. But I have seen others using spaces. Even there are some
>examples in php-manual with spaces (e.g. array_shift).

Actually I took most of the points in the 'Whitespaces' section from
Guido's Python Style Guide. Most of the points are not really a big
deal, but I usually suggest at least making a distinction between ()
for functions and () for statements.

  for (;;)
  if (..)

  exit();
  die();

> > 1.6 Quotes
> >
> >      Use whichever ones you like. But if you can use '' for simple strings,
> >      and "" only if you need interpolation.
>
>This should _very_slightly_ improve performance too.

Yup, though I have never thought of benchmarking this :)

> > 4. File organization
>
>We use WML (website meta language - www.engelschall.com/sw/wml/) with make
>to produce single php files and do _not_ use the include feature of php.
>
>Also, we have written scripts that creates diff files between releases.

Interesting. How do you find WML so far? I evaluated WML once in
the past, but it seemed too complex to me then...

> > 6. Creating documentation
>
>We use tex, and we are planning to go for texinfo.

Do you also embed these in the PHP scripts? I prefer this way
(like Perl's POD, Java's Javadoc, Python's docstrings), because
it is much easier to synchronize with the code. Also, since I
often write the documentation first and then write some code,
I prefer putting them together.

Steve





If I want to use ImageCopyResampled(), do I then need Php 4.0.6 ?
http://www.php.net/manual/en/function.imagecopyresampled.php

--
[ www.eksperten.dk ] Scandinavias biggest IT forum.






On Monday 30 April 2001 21:19, Brandon Orther wrote:
>  Is there a way to sort an array alphabetically?

two examples
sort -- Sort an array
natsort --  Sort an array using a "natural order" algorithm 

-- 
 php developer / CoreTrek AS        | Somehow I reached excess without ever
 Sandnes / Rogaland / Norway        | noticing when I was passing through
 web: http://www.moijk.net/         | satisfaction.   -- Ashleigh Brilliant 




Hi,

I've got a select tag with multiple selection enabled. When the user submit
the form, I want to pass all options from the select to another page. For
this I use javascript to select every element in my select tag. My problem,
is that in PHP, to access all selected elements in an array, I need to give
my select tag a name like 'myselect[]'. If I use this naming, I can't use my
Javascript code to select every element before submitting the form.

How can I get both thing to work : my javascript code to select every
element, and my php code to access every element ??

Thanks for any answer.





try this,

<form name="f1">
  <select name="selectall[]">
    <option>line1</option>
    <option selected>line2</option>
    <option>line3</option>
  </select>
  <input type="text" name="txt1">
</form>

<script language="JavaScript">
<!--
  selectobjname = "selectall[]";
  selectobj = null;
  for (i=0; i< f1.elements.length; i++)
  {
    if (f1.elements[i].name == selectobjname)
    {
      alert('found element, and got a pointer of it');
      selectobj = f1.elements[i];
    }
    else
      alert(f1.elements[i].name);
  }
  alert('currently selected item:' +
selectobj.options[selectobj.selectedIndex].text);
//-->
</script>

should help you out!

-elias
http://eassoft.cjb.net

""Nicolas Guilhot"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I've got a select tag with multiple selection enabled. When the user
submit
> the form, I want to pass all options from the select to another page. For
> this I use javascript to select every element in my select tag. My
problem,
> is that in PHP, to access all selected elements in an array, I need to
give
> my select tag a name like 'myselect[]'. If I use this naming, I can't use
my
> Javascript code to select every element before submitting the form.
>
> How can I get both thing to work : my javascript code to select every
> element, and my php code to access every element ??
>
> Thanks for any answer.
>
>
> --
> 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,
A potentially dumb question here.

Is there an easy way to display a random number between 1 and 20?

I have looked on line, but either I am looking inall teh wrong places, or there
isn't this script on-line.

Can anyone point me in the right direction?

Cheers,
Tris...




**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.


**********************************************************************




why not use the rand() ?

manual says:

rand -- Generate a random value
Description

int rand ([int min [, int max]])


If called without the optional min, max arguments rand() returns a
pseudo-random value between 0 and RAND_MAX. If you want a random number
between 5 and 15 (inclusive), for example, use rand (5, 15).

Remember to seed the random number generator before use with srand().

-elias
http://eassoft.cjb.net


<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> Hi there,
> A potentially dumb question here.
>
> Is there an easy way to display a random number between 1 and 20?
>
> I have looked on line, but either I am looking inall teh wrong places, or
there
> isn't this script on-line.
>
> Can anyone point me in the right direction?
>
> Cheers,
> Tris...
>
>
>
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
>
>
> **********************************************************************
>
> --
> 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]
>






Wotcha Tris :-)

Try this:

mt_srand((double)microtime()*1000000);
$my_random_number = mt_rand(1, 20);

HTH
Jon


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: 02 May 2001 12:07
To: [EMAIL PROTECTED]
Subject: [PHP] Random number generation...




Hi there,
A potentially dumb question here.

Is there an easy way to display a random number between 1 and 20?

I have looked on line, but either I am looking inall teh wrong places, or
there
isn't this script on-line.

Can anyone point me in the right direction?

Cheers,
Tris...




**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.


**********************************************************************

-- 
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 information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or
confidentiality'

**********************************************************************




<?php
srand((double)microtime()*1000000);
$number = rand(1,20);
echo $number;
?>

Regards,
Avetis

[EMAIL PROTECTED] wrote:

> Hi there,
> A potentially dumb question here.
>
> Is there an easy way to display a random number between 1 and 20?
>
> I have looked on line, but either I am looking inall teh wrong places, or there
> isn't this script on-line.
>
> Can anyone point me in the right direction?
>
> Cheers,
> Tris...
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
>
> **********************************************************************
>
> --
> 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]

--
[EMAIL PROTECTED]
ICT Specialist
UNDP, Armenia






The manual also says:
  mt_rand -- Generate a better random value

I've been using mt_rand() over rand() every time - is there any reason not
to?

Cheers
Jon


-----Original Message-----
From: elias [mailto:[EMAIL PROTECTED]]
Sent: 03 May 2001 00:05
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Random number generation...


why not use the rand() ?

manual says:

rand -- Generate a random value
Description

int rand ([int min [, int max]])


If called without the optional min, max arguments rand() returns a
pseudo-random value between 0 and RAND_MAX. If you want a random number
between 5 and 15 (inclusive), for example, use rand (5, 15).

Remember to seed the random number generator before use with srand().

-elias
http://eassoft.cjb.net


**********************************************************************
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or confidentiality'

**********************************************************************




Its supposedly faster and generates a "more" random number than rand() so I
don't see why not to use it.
--
phill

"Jon Haworth" <[EMAIL PROTECTED]> wrote in message
67DF9B67CEFAD4119E4200D0B720FA3F13B733@BOOTROS">news:67DF9B67CEFAD4119E4200D0B720FA3F13B733@BOOTROS...
> The manual also says:
>   mt_rand -- Generate a better random value
>
> I've been using mt_rand() over rand() every time - is there any reason not
> to?
>
> Cheers
> Jon
>
>
> -----Original Message-----
> From: elias [mailto:[EMAIL PROTECTED]]
> Sent: 03 May 2001 00:05
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Random number generation...
>
>
> why not use the rand() ?
>
> manual says:
>
> rand -- Generate a random value
> Description
>
> int rand ([int min [, int max]])
>
>
> If called without the optional min, max arguments rand() returns a
> pseudo-random value between 0 and RAND_MAX. If you want a random number
> between 5 and 15 (inclusive), for example, use rand (5, 15).
>
> Remember to seed the random number generator before use with srand().
>
> -elias
> http://eassoft.cjb.net
>
>
> **********************************************************************
> 'The information included in this Email is of a confidential nature and is
> intended only for the addressee. If you are not the intended addressee,
> any disclosure, copying or distribution by you is prohibited and may be
> unlawful. Disclosure to any party other than the addressee, whether
> inadvertent or otherwise is not intended to waive privilege or
confidentiality'
>
> **********************************************************************
>
> --
> 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,

PHP newbie.

Can anyone help me with the following?

Pseudo code:

for(i=1;i<2000;i++)
{
        catch the output of
                http://www.mysite.com/kb.html?kbid= <? echo i ?>
        and put the html code in a text file called
                /www/kb/kbid <? echo i ?> .html
}

So the end result is 2000 html files on disk "extacted" from the http://
address...

Thanks...

Met vriendelijke groet / With kind regards,

Simon de Kraa
ICL Logistic Systems
mailto:[EMAIL PROTECTED]

---

Microsoft Windows 2000 Professional SP 1, Progress 9.1b, Roundtable 9.1b
SCO UnixWare 7.1.1, Progress 9.1a11




Never tried what i'll write you, but it should work though!

for ($i=0;$i<2000;$i++)
{
   $lines = join('', file(http://www.mysite.com/generator.php?id=$i));
  // save $lines to a file.....
}

-elias
http://eassoft.cjb.net

"Kraa de Simon" <[EMAIL PROTECTED]> wrote in message
C1EBEEBBB842D411B4120000949A1F5875867A@wwmessd135">news:C1EBEEBBB842D411B4120000949A1F5875867A@wwmessd135...
> Hi,
>
> PHP newbie.
>
> Can anyone help me with the following?
>
> Pseudo code:
>
> for(i=1;i<2000;i++)
> {
> catch the output of
> http://www.mysite.com/kb.html?kbid= <? echo i ?>
> and put the html code in a text file called
> /www/kb/kbid <? echo i ?> .html
> }
>
> So the end result is 2000 html files on disk "extacted" from the http://
> address...
>
> Thanks...
>
> Met vriendelijke groet / With kind regards,
>
> Simon de Kraa
> ICL Logistic Systems
> mailto:[EMAIL PROTECTED]
>
> ---
>
> Microsoft Windows 2000 Professional SP 1, Progress 9.1b, Roundtable 9.1b
> SCO UnixWare 7.1.1, Progress 9.1a11
>
> --
> 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]
>






Yasuo,

thanks for the reply. Yes I do have zlib support
(shows me in phpinfo()).

Sorry the stupid question but How do I check the size
of the page ?

If I access it and use save as I will have the
uncompressed version right ?

Which .ini directive did you use ?

- thanks

>>If you want to check if it is working.

>>Display phpinfo() and check the size of the file.
>>I get 6 KB compressed, where I get 50KB
uncompressed.

>> You have zlib support, right?

--
Yasuo Ohgaki

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/





Thanks !!! I will try...
--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[EMAIL PROTECTED]


-----Original Message-----
From: Iriton Jonath P. Andrade [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 8:31 AM
To: Hassan Arteaga
Subject: Re: [PHP] COM


Hi Arteaga,

Instead of using that functions, use the new one shown bellow:

For instantiate an COM object in PHP:

$obj = new COM("ApplicationName.ClassApplicationName");

For properties and methods access:

$obj->property_name;
$obj->method_name;

I have used and tested this function and I have obtained success (using PHP
on Windows 2000 Server). It work very fine.

Regards, Iriton Jonath.



----- Original Message -----
From: "Hassan Arteaga" <[EMAIL PROTECTED]>
To: "Php (E-mail)" <[EMAIL PROTECTED]>
Sent: Monday, April 30, 2001 2:57 PM
Subject: [PHP] COM


Hi all !!

I have components i made in Visual Basic 6.0 and I would like to use with
PHP. I need examples how to create intance from VB COM component...
What function I have to use ?

com_load - ???
com_invoke - ???
com_propget - ???
com_get - ???
com_propput - ???
com_propset - ???
com_set - ???

Thanks in advanced !!!

--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[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]






Hi Iriton !!

I tested but with errors..

9   <? php
10 $obj = new COM("Has.HasClass");
11 echo $obj->Hello("Hi Hassan");
12 ?>


This is only VB component ....Hello return the string entered as var...I
receive this error..

Parse error: parse error in C:\Inetpub\wwwroot\myphp\com.php on line 10

Thanks in advanced !!!

--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[EMAIL PROTECTED]


-----Original Message-----
From: Iriton Jonath P. Andrade [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 8:31 AM
To: Hassan Arteaga
Subject: Re: [PHP] COM


Hi Arteaga,

Instead of using that functions, use the new one shown bellow:

For instantiate an COM object in PHP:

$obj = new COM("ApplicationName.ClassApplicationName");

For properties and methods access:

$obj->property_name;
$obj->method_name;

I have used and tested this function and I have obtained success (using PHP
on Windows 2000 Server). It work very fine.

Regards, Iriton Jonath.



----- Original Message -----
From: "Hassan Arteaga" <[EMAIL PROTECTED]>
To: "Php (E-mail)" <[EMAIL PROTECTED]>
Sent: Monday, April 30, 2001 2:57 PM
Subject: [PHP] COM


Hi all !!

I have components i made in Visual Basic 6.0 and I would like to use with
PHP. I need examples how to create intance from VB COM component...
What function I have to use ?

com_load - ???
com_invoke - ???
com_propget - ???
com_get - ???
com_propput - ???
com_propset - ???
com_set - ???

Thanks in advanced !!!

--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[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]






Hi Arteaga,

I have tested COM objects using PHP Version 4.0.4pl1 on Windows 2000 Server.
The COM function mentioned here were implemented recently in PHP engine, so
use this version of PHP or later. Of course, your VB COM component must be
registered, so "Has.HasClass" must be a valid "OLE programmatic identifier".

Regards, Iriton.


----- Original Message -----
From: "Hassan Arteaga" <[EMAIL PROTECTED]>
To: "'Iriton Jonath P. Andrade'" <[EMAIL PROTECTED]>
Sent: Wednesday, May 02, 2001 8:51 AM
Subject: RE: [PHP] COM


Hi Iriton !!

I tested but with errors..

9   <? php
10 $obj = new COM("Has.HasClass");
11 echo $obj->Hello("Hi Hassan");
12 ?>


This is only VB component ....Hello return the string entered as var...I
receive this error..

Parse error: parse error in C:\Inetpub\wwwroot\myphp\com.php on line 10

Thanks in advanced !!!
--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[EMAIL PROTECTED]


-----Original Message-----
From: Iriton Jonath P. Andrade [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 8:31 AM
To: Hassan Arteaga
Subject: Re: [PHP] COM


Hi Arteaga,

Instead of using that functions, use the new one shown bellow:

For instantiate an COM object in PHP:

$obj = new COM("ApplicationName.ClassApplicationName");

For properties and methods access:

$obj->property_name;
$obj->method_name;

I have used and tested this function and I have obtained success (using PHP
on Windows 2000 Server). It work very fine.

Regards, Iriton Jonath.



----- Original Message -----
From: "Hassan Arteaga" <[EMAIL PROTECTED]>
To: "Php (E-mail)" <[EMAIL PROTECTED]>
Sent: Monday, April 30, 2001 2:57 PM
Subject: [PHP] COM


Hi all !!

I have components i made in Visual Basic 6.0 and I would like to use with
PHP. I need examples how to create intance from VB COM component...
What function I have to use ?

com_load - ???
com_invoke - ???
com_propget - ???
com_get - ???
com_propput - ???
com_propset - ???
com_set - ???

Thanks in advanced !!!

--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[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]








Hi Arteaga,

Instead of using that functions, use the new one shown bellow:

For instantiate an COM object in PHP:

$obj = new COM("ApplicationName.ClassApplicationName");

For properties and methods access:

$obj->property_name;
$obj->method_name;

I have used and tested this function and I have obtained success (using PHP
on Windows 2000 Server). It work very fine.

Regards, Iriton Jonath.



----- Original Message -----
From: "Hassan Arteaga" <[EMAIL PROTECTED]>
To: "Php (E-mail)" <[EMAIL PROTECTED]>
Sent: Monday, April 30, 2001 2:57 PM
Subject: [PHP] COM


Hi all !!

I have components i made in Visual Basic 6.0 and I would like to use with
PHP. I need examples how to create intance from VB COM component...
What function I have to use ?

com_load - ???
com_invoke - ???
com_propget - ???
com_get - ???
com_propput - ???
com_propset - ???
com_set - ???

Thanks in advanced !!!

--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[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]








Ohhh!!!I installed the last version..and now ..this simple code

<?php
$cad="Hassan";
echo $cad;
?>

I can't see nothing... 
--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[EMAIL PROTECTED]


-----Original Message-----
From: Iriton Jonath P. Andrade [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 10:50 AM
To: Hassan Arteaga
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] COM


Hi Arteaga,

I have tested COM objects using PHP Version 4.0.4pl1 on Windows 2000 Server.
The COM function mentioned here were implemented recently in PHP engine, so
use this version of PHP or later. Of course, your VB COM component must be
registered, so "Has.HasClass" must be a valid "OLE programmatic identifier".

Regards, Iriton.


----- Original Message -----
From: "Hassan Arteaga" <[EMAIL PROTECTED]>
To: "'Iriton Jonath P. Andrade'" <[EMAIL PROTECTED]>
Sent: Wednesday, May 02, 2001 8:51 AM
Subject: RE: [PHP] COM


Hi Iriton !!

I tested but with errors..

9   <? php
10 $obj = new COM("Has.HasClass");
11 echo $obj->Hello("Hi Hassan");
12 ?>


This is only VB component ....Hello return the string entered as var...I
receive this error..

Parse error: parse error in C:\Inetpub\wwwroot\myphp\com.php on line 10

Thanks in advanced !!!
--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[EMAIL PROTECTED]


-----Original Message-----
From: Iriton Jonath P. Andrade [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 8:31 AM
To: Hassan Arteaga
Subject: Re: [PHP] COM


Hi Arteaga,

Instead of using that functions, use the new one shown bellow:

For instantiate an COM object in PHP:

$obj = new COM("ApplicationName.ClassApplicationName");

For properties and methods access:

$obj->property_name;
$obj->method_name;

I have used and tested this function and I have obtained success (using PHP
on Windows 2000 Server). It work very fine.

Regards, Iriton Jonath.



----- Original Message -----
From: "Hassan Arteaga" <[EMAIL PROTECTED]>
To: "Php (E-mail)" <[EMAIL PROTECTED]>
Sent: Monday, April 30, 2001 2:57 PM
Subject: [PHP] COM


Hi all !!

I have components i made in Visual Basic 6.0 and I would like to use with
PHP. I need examples how to create intance from VB COM component...
What function I have to use ?

com_load - ???
com_invoke - ???
com_propget - ???
com_get - ???
com_propput - ???
com_propset - ???
com_set - ???

Thanks in advanced !!!

--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[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]







Hello all.

Our next PHP user group meeting will be held this coming Thursday, May
3rd
(the first Thursday of the month) at our office in downtown Ypsilanti,
MI.
(125 North Huron, #400, to be exact).

We normally meet around 7ish for drinks/eats beforehand, and get started
at 8.
Keith Elder will be giving an introductory overview of PHP (syntax,
usage,
benefits, examples, etc.)

Please call 734-480-9961 should you have any questions or need
directions.
RSVP is appreciated, but not necessary.

Thanks all.  :)

Michael Kimsal




hello,

i got myfile.txt saying:
  i say: $hello

now i write a script like:
 $hello = "hello world";
 $lines = join("\n", file("myfile.txt"));
method 1:
=======
  echo("\$text = \"\$lines\";");
  var_dump($text);

method 2:
========
  $temp = $var;
  $text   = $temp;


none of the method assigns the value "i say: hello world" to $text
they both still parse $text to "i say: $hello"

How can i solve this, I know it's silly,...but i surrender at the moment...

-elias
http://eassoft.cjb.net








sorry, in method 1 i meant: eval() instead of echo()

""elias"" <[EMAIL PROTECTED]> wrote in message
9cp0io$uuf$[EMAIL PROTECTED]">news:9cp0io$uuf$[EMAIL PROTECTED]...
> hello,
>
> i got myfile.txt saying:
>   i say: $hello
>
> now i write a script like:
>  $hello = "hello world";
>  $lines = join("\n", file("myfile.txt"));
> method 1:
> =======
>   echo("\$text = \"\$lines\";");
>   var_dump($text);
>
> method 2:
> ========
>   $temp = $var;
>   $text   = $temp;
>
>
> none of the method assigns the value "i say: hello world" to $text
> they both still parse $text to "i say: $hello"
>
> How can i solve this, I know it's silly,...but i surrender at the
moment...
>
> -elias
> http://eassoft.cjb.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]
>






Hi all !!

I have PHP 4.0.4 on Win98, PWS PC and I would like to install 4.0.5 but is
only for CGI ? I installed PHP 4.0.4 with an exe file...I didn't
nothing..only double-click.. I need that file again but with PHP 4.0.5
version..Thanks !!!

If not ..then I'll read install file.

Thanks !!!!

--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[EMAIL PROTECTED]




>I have PHP 4.0.4 on Win98, PWS PC and I would like to install 4.0.5 but is
>only for CGI ? I installed PHP 4.0.4 with an exe file...I didn't
>nothing..only double-click.. I need that file again but with PHP 4.0.5
>version..Thanks !!!

The installer version you used when you installed 4.0.4 installed the cgi
version - the 4.0.5 on does exactly the same.

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






Hi,

  What are benefits and losses of having a PHP module for apache instead  of of a C 
module if PHP modules are without xml and mysql support.

Opinions!

- Surinder




Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/




> If I'm doing more than one query on a page what is the best way to check
if
> they all succeeded with out using transactions?

You can check each query as it executes, and (perhaps) have your program
logic do something intelligent in the case of individual failures.

Another possbility is to do all the queries on some temporary table, and
then do one "big" query that inserts/updates from the temp table to the
"real" table...

In general, though, once you get a good connection, and if your SQL is
valid, queries don't fail very often...  Not something you can rely on for
mission-critical usage, but you may be over-worried about an infrequent
event.  Perhaps you could just code it to dump everything to an email to
yourself if it ever pukes, so you can fix it by hand.

(Kinda dangerous since it could flood your email box if the db goes down
completely and you can't get to it to fix it...)

--
WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






Hi Richard,
Thanks for the advise. I was just wondering what other people do.
I don't think I'll worry about it too much ;-)

Cheers,

Jord

On Wednesday 02 May 2001  3:49 am, you wrote:
> > If I'm doing more than one query on a page what is the best way to check
>
> if
>
> > they all succeeded with out using transactions?
>
> You can check each query as it executes, and (perhaps) have your program
> logic do something intelligent in the case of individual failures.
>
> Another possbility is to do all the queries on some temporary table, and
> then do one "big" query that inserts/updates from the temp table to the
> "real" table...
>
> In general, though, once you get a good connection, and if your SQL is
> valid, queries don't fail very often...  Not something you can rely on for
> mission-critical usage, but you may be over-worried about an infrequent
> event.  Perhaps you could just code it to dump everything to an email to
> yourself if it ever pukes, so you can fix it by hand.
>
> (Kinda dangerous since it could flood your email box if the db goes down
> completely and you can't get to it to fix it...)
>
> --
> WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
> Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
> Volunteer a little time: http://chatmusic.com/volunteer.htm




> I am doing a dir list of an ftp and using sort to sort the dir list
> alphabetically.  What I am using now sorts it alphabetically but it sorts
> the capital letters then the lower case so a capital "Z" would come before
a
> lower case "a"
>
> The Code I am using is:
>
> sort($complete_list);
> return $complete_list;
>
> Does someone know how I can sort an array alphabetically with the case
> insensitive sort?

usort($complete_list, 'strcasecmp');

http://php.net/manual/en/function.usort.php
http://php.net/manual/en/function.strcasecmp.php

--
WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> I have the following case. I am working on a PHP script which contains an
> array. Now I want to include a PHP created picture, which is a .php file
> (gd, now further called as the picture.php file). Till so far, everything
is
> ok. The picture is created following as wished.
>
> Now , I want to include values in the picture.php file, which make use of
an
> array which is used in the program above.
> - I am not able to get any array accessed in the picture.php file!
>
> P.S. I am able to access single values in the picture.php. I am also able
to
> list out values of the araay in the script who calls the picture-php file.
>
> Can anybody give me a clue, how I can access the array in the picture.php
?
> Am I doing something wrong, or is this a bug (in that case I prefere a
> workaround).

Not sure I'm following this, but...

The PHP file that creates the GD image is a completely separate HTTP request
(file) from the main page, in the same way that any IMAGE is in a separate
file in a static site.

If both the main program and the image need access to an array of data, you
either need to pass that array to the picture.php file as a GET parameter
(or POST, I guess) or re-generate that array using the same code as in the
main program (possibly a good candidate for an include file).

So, in main.php, you might have some code that ends up generating something
not unlike:
<IMG SRC=picture.php?array[1]=17&array[2]=13&array[3]=32>

--
WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> Happy %2/$d'th birthday %1/$s.
>
> like the docs says your supposed to do it doesn't work and all you see is:
>   Happy $d'th birthday $s.
>
> What is up with this.. if you use %2/%d it sort of works, but it throws
all
> my other variables out of whack.. any help with this would be
appreciative..

I'm guessing you need to escape that $ with a \ using addslashes().

--
WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> What are benefits and losses of having a PHP module for apache instead of
of a C module if PHP modules are without xml and mysql support.

For starters, it's way easier to develop a web application in PHP than in C.

Not even sure I'm understanding the question properly...  There are a *LOT*
more modules you could add to PHP that aren't XML and MySQL -- but I think
you mean to just compare the languages as languages.

--
WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> this is taken straight from phpinfo(), as you can see
> its all there except for type. I was wondering why
> wouldnt my RH7.0, Apache 1.3.12 w/ PHP4.0.4pl1
> know what the file type was...

Because your browser didn't tell it?

I'm pretty sure that info comes *from* the browser...

PHP really has no way, a priori, to determine what might be in an uploaded
file.

--
WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






Hi

I got the same setup as you with safe_mode = On  and I try to use the copy
function between 2 virtual host. When I copy from one virtual host to another,
I got an error message telling me that the copy function is not allowed :

Warning: SAFE MODE Restriction in effect. The script whose uid is 88 is not
allowed to access /home/host/yourdomain owned by uid 98 in
home/www/host/127.0.0.1:8080/html/index.php on line 37

His your virtual host have all the same users?


Regards,

Sebastien Roy


PanDragon wrote:

> Thanks for the suggestion, but I need to be able to use the copy command, I
> just do not want it to be able to read from one virtual host to another. I
> would imagine that lots of web hosters running php with virtual hosts would
> have the same problem.
>
> Sebastien Roy <[EMAIL PROTECTED]> wrote in message
> news:<[EMAIL PROTECTED]>...
> > Hi,
> >
> > There is a section in the php.ini where you can specified the function you
> > don't whant to use  :
> >
> > disable_functions : copy; ...
> >
> > I never used it, but I think it's what you are looking for.
> >
> >
> > Regards,
> >
> > Sebastien Roy
> > [EMAIL PROTECTED]
> >
> >
> > PanDragon wrote:
> >
> > > I am running an apache server with virtual hosts and need to prevent the
> php
> > > Copy command from being able to copy from one virtual host dir to
> another.
> > >
> > > The server is in php safe mode and the doc_root, and basedir are set
> > > correctly, at least they prevent "includes" and "opendir" and such from
> > > working, but "copy" still works.
> > >
> > > I sure would appreciate any suggestions.
> > >
> > > Pan
> > >
> > > --
> > > 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]
> >
> Sebastien Roy <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi,
> >
> > There is a section in the php.ini where you can specified the function you
> > don't whant to use  :
> >
> > disable_functions : copy; ...
> >
> > I never used it, but I think it's what you are looking for.
> >
> >
> > Regards,
> >
> > Sebastien Roy
> > [EMAIL PROTECTED]
> >
> >
> > PanDragon wrote:
> >
> > > I am running an apache server with virtual hosts and need to prevent the
> php
> > > Copy command from being able to copy from one virtual host dir to
> another.
> > >
> > > The server is in php safe mode and the doc_root, and basedir are set
> > > correctly, at least they prevent "includes" and "opendir" and such from
> > > working, but "copy" still works.
> > >
> > > I sure would appreciate any suggestions.
> > >
> > > Pan
> > >
> > > --
> > > 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]
> >
>
> --
> 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 any way to see my errors on he screen. The server has error 
reporting turned off.
Ive tried setting error_reporting()function setting it to E_ALL etc. It still 
does not work.
Does any one know what I can do?

Clint




http://apollo.spaceports.com/~refcentr/index_auth.html

This script work with Unix, not with WinNT.
Is there something to do with cookie on WinNT ?

Help Please







After several tries, I am convinced there is no way to do it. I went around
the problem by using dinamic field names (var1, var2, var3, etc) and then
reading them using $HTTP_POST_VARS["var".$i], where $i would be your former
index to the array. For example:

The form coud have HTML code like this:

    <input type=text name=myvar0>
    <input type=text name=myvar1>
    <input type=text name=myvar2>

Each field can be referenced by JavaScript code like this:

    document.myform.myvar1.value="hello";

Or dynamically like this:

    myfield=new array();
    for(i=0;;i++)


        if(!eval("document.myform.myvar"+i)) break;
        myfield[i]=eval("document.myform.myvar"+i);
    }
    myfield[1].value="hello";

When the form is submitted, asuming, method=POST, then you get the field
values like this:

$myvars=array();
for($i=0;;$i++)
{
    if(empty($HTTP_POST_VARS["myvar".$i]) break;
    $myvars[$i]=$HTTP_POST_VARS["myvar".$i];
}

Hope it helps.
Cheers, Diego.
  -----Original Message-----
  From: Utopia [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, 01 May, 2001 10:32 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] Forms with Field Arrays and JavaScript


  Hello,

  I see you sent this back in January. I'm having the very same problem.

  Could you PLLLLEEEAAASSEEE tell me how to assign a value to the
'myfields[]' text field using JavaScript. I can't make it happen.


  Thanks.

  Tiffany
  ----------------------------
  THIS WAS YOUR MESSAGE ON THE BOARD
  Hi! I was wondering if someone knows, or can think of a way to go around
  this problem i have.


  The thing is i am working with a form with a field array. Each field is
  something like:
  <input name="myfields[]" type="text">


  When i receive the posted data, I can access the "myfields" array. This is
  fine.


  The problem is within my form i have client JavaScript code to validate
the
  form data. But I can't make reference to a form object called myfields[]
or
  myfields[5] or just myfields. The property name of the javascript object
is
  set to "myfields[]", but reference to myfields[][5] or
  document.myform.fields["myfields[]"] doesn't work either.


  Any suggestions will be greatly appreciated.
  Thanks in advance.






Hi all !!!

I execute a page php with a simple code..the page appears in white..and when
I oppress the right click to see the source I obtain this result.  
_____________

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
        <title>Untitled</title>
</head>
<body>
<?php
$cad="Hassan";
echo $cad;
?>
</body>
</html>
  
_______________

Everything was working well until I installed the new version for win32 PHP
4.0.5

Thanks !!!!

--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[EMAIL PROTECTED]




I compiled and installed PHP 4.0.5 onto our development server (Mandrake
Linux 7.1 w/kernel 2.2.17) today and tried to access one of our php
intensive sites on it - most of the pages wouldn't respond.

This is how 4.0.5 was compiled:

./configure \
--with-apxs=/usr/local/apache_1.3.19/bin/apxs \
--with-mysql=/usr/local/mysql \
--enable-ftp \
--with-curl \
--with-zlib \
--with-pspell \
--with-ldap \
--with-pdflib \
--with-imap=/usr/local/src/imap-4.5 \
--with-zlib-dir=/usr/lib \
--with-gd \
--with-ttf \
--with-t1lib \
--with-xml \
--with-swf=/usr/local \
--with-java=/usr/local/jdk \
--with-gettext \
--with-mcrypt \
--with-mhash \
--enable-sockets \
--enable-calendar \
--enable-trans-sid \
--enable-track-vars=yes \
--enable-magic-quotes=yes

Looking at the logs I saw a few of these - this wasn't happening with
4.0.4pl1:

[Tue May  1 20:49:21 2001] [notice] child pid 19423 exit signal Segmentation
fault (11)
[Tue May  1 20:51:17 2001] [notice] caught SIGTERM, shutting down
[Tue May  1 20:51:45 2001] [notice] Apache configured -- resuming normal
operations
[Tue May  1 20:57:41 2001] [warn] child process 19677 still did not exit,
sending a SIGTERM
[Tue May  1 20:57:45 2001] [error] child process 19677 still did not exit,
sending a SIGKILL
[Tue May  1 20:57:46 2001] [notice] caught SIGTERM, shutting down
[Tue May  1 20:58:08 2001] [notice] Apache configured -- resuming normal
operations
[Tue May  1 20:59:11 2001] [notice] child pid 20039 exit signal Segmentation
fault (11)
[Tue May  1 21:00:54 2001] [notice] child pid 20290 exit signal Segmentation
fault (11)

I've downgraded to 4.0.4pl1 and all is well again.

I've tried to generate a core dump file (Apache also has write access to a
folder specified with the CoreDumpDirectory directive.) using the
instructions here but have been unsuccessful:

<http://www.php.net/bugs-generating-backtrace.php>

I can't run httpd -X as suggested on that page because my version of Apache
(1.3.19) doesn't support it.

What can I do to get more debugging information so that this can get looked
at?
-- 
darron froese
new media technologist
sutton javelin corporate communications
t  403.716.0351
f  403.265.7662
e  [EMAIL PROTECTED]







If I were you I would let the PHP guys figure this out.  I am sure they read
messages here so stick with 4.04p11 and live on.  I was just about to
download 4.0.5, but I want your issue to be addressed before I waste my time
with a recompile.

John

> -----Original Message-----
> From: Darron Froese [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 02, 2001 12:04 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP 4.0.5 module causes Apache child processes to
> segfault...
>
>
> I compiled and installed PHP 4.0.5 onto our development server (Mandrake
> Linux 7.1 w/kernel 2.2.17) today and tried to access one of our php
> intensive sites on it - most of the pages wouldn't respond.
>
> This is how 4.0.5 was compiled:
>
> ./configure \
> --with-apxs=/usr/local/apache_1.3.19/bin/apxs \
> --with-mysql=/usr/local/mysql \
> --enable-ftp \
> --with-curl \
> --with-zlib \
> --with-pspell \
> --with-ldap \
> --with-pdflib \
> --with-imap=/usr/local/src/imap-4.5 \
> --with-zlib-dir=/usr/lib \
> --with-gd \
> --with-ttf \
> --with-t1lib \
> --with-xml \
> --with-swf=/usr/local \
> --with-java=/usr/local/jdk \
> --with-gettext \
> --with-mcrypt \
> --with-mhash \
> --enable-sockets \
> --enable-calendar \
> --enable-trans-sid \
> --enable-track-vars=yes \
> --enable-magic-quotes=yes
>
> Looking at the logs I saw a few of these - this wasn't happening with
> 4.0.4pl1:
>
> [Tue May  1 20:49:21 2001] [notice] child pid 19423 exit signal
> Segmentation
> fault (11)
> [Tue May  1 20:51:17 2001] [notice] caught SIGTERM, shutting down
> [Tue May  1 20:51:45 2001] [notice] Apache configured -- resuming normal
> operations
> [Tue May  1 20:57:41 2001] [warn] child process 19677 still did not exit,
> sending a SIGTERM
> [Tue May  1 20:57:45 2001] [error] child process 19677 still did not exit,
> sending a SIGKILL
> [Tue May  1 20:57:46 2001] [notice] caught SIGTERM, shutting down
> [Tue May  1 20:58:08 2001] [notice] Apache configured -- resuming normal
> operations
> [Tue May  1 20:59:11 2001] [notice] child pid 20039 exit signal
> Segmentation
> fault (11)
> [Tue May  1 21:00:54 2001] [notice] child pid 20290 exit signal
> Segmentation
> fault (11)
>
> I've downgraded to 4.0.4pl1 and all is well again.
>
> I've tried to generate a core dump file (Apache also has write access to a
> folder specified with the CoreDumpDirectory directive.) using the
> instructions here but have been unsuccessful:
>
> <http://www.php.net/bugs-generating-backtrace.php>
>
> I can't run httpd -X as suggested on that page because my version
> of Apache
> (1.3.19) doesn't support it.
>
> What can I do to get more debugging information so that this can
> get looked
> at?
> --
> darron froese
> new media technologist
> sutton javelin corporate communications
> t  403.716.0351
> f  403.265.7662
> e  [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]
>





On 5/2/01 10:16 AM, "John Huggins" <[EMAIL PROTECTED]> wrote:

> If I were you I would let the PHP guys figure this out.  I am sure they read
> messages here so stick with 4.04p11 and live on.  I was just about to
> download 4.0.5, but I want your issue to be addressed before I waste my time
> with a recompile.

I'm sure they do too - but if I can get some more information to help to
pinpoint the issue (if there is one with PHP and not with my box) - that
makes it easier on them.
-- 
darron froese
new media technologist
sutton javelin corporate communications
t  403.716.0351
f  403.265.7662
e  [EMAIL PROTECTED]





Hi all,

I'm having a strange problem. I volontary create an infinite loop in one
of my PHP script. I was just wondering how Apache and PHP will react and
if the "max_execution_time" directive would trap the loop. I was
agreably suprised to see that the opera browser give me an error message
"Fatal error: Maximun execution time of 5 seconds exceeded in ....". The
same occured with MS explorer and Mozilla. But, with Netscape, there is
nothing to do. It loops forever and I add to restart my linux box
($%^!$) witch is something I almost never do.  I really hate that
browser, but I must deal with it...

Is there something particular I have to do to avoid this problem with
the Netscape browser?



Regards,

Sebastien Roy
[EMAIL PROTECTED]





¸Û¼°~
ÁܽжQ¤½¥q«e©¹§K¶O¥Zµn¤½¥q¦æ¸¹
Åwªï¼t°Ó«e©¹¬d¸ß¡B¥Zµn§Y®É¶R½æ
´x´¤§ó¦hªº°ê»Ú¶R½æ¥D!
¨È¬wºô http://Asianweb.com.tw 

­B¦¹·q´_ ¨Ã¯¬¡G
¥Í·N¿³¶©!
°]·½¼s¶i!

¨È¬wºô ·s»D¬¡°Ê²Õ ·q±Ò
==================================================
¨È¬wºô http://Asiaweb.com.tw ­^¤åª©
¨È¬wºô http://Asianweb.com.tw ¤¤¤åÁc²ª©
·s¼W¤¤¤åºô§} http://¨È¬wºô.TW
·s¼W¤¤¤åºô§} http://»s³y·~.TW
·s¼W¤¤¤åºô§} http://¨È¤Ó.°Ó·~.TW
·s¼W¤¤¤åºô§} http://¨È¬w¤H.°Ó·~.TW
==================================================





 
2001-05-02 ¥»·s»D¥ÑTopNews ·s»D§Ö»¼µo¦æ
ªñ¤é·s»D¬£³ø¨t²Î­«¾ã ¦p¦³¥´ÂZ¤§³B ·q½Ð¨£½Ì!
¨t²Î¦p¦³­«½Æµo°e ·q½Ð¦^ÂÐ: [EMAIL PROTECTED] 











¢w¢w¢w¢w¢w¡@The message was sent by Super Mass Mail¡@¢w¢w¢w¢w¢w
   Download from The Worldfax Network.¡@http://www.worldfax.net
   Start send worldwide free fax and(or) get free website advertising now!


Reply via email to