OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Subject: php3 Digest 17 May 2000 15:54:32 -0000 Issue 1676
From: php3-digest-helplists.php.net
Date: Wed May 17 2000 - 10:54:32 CDT


php3 Digest 17 May 2000 15:54:32 -0000 Issue 1676

Topics (messages 90684 through 90751):

ttf
        90684 by: Daniel <daniellynx.net>

email software
        90685 by: "Adam Powell" <adampowlex.com>
        90694 by: Nathan Wallace <nathansynop.com>

Escaping PHP when inside PHP code
        90686 by: Antony Stace <antonyclaire.co.jp>
        90687 by: "Jason Brooke" <jasonqgl.org>
        90690 by: "Jason Brooke" <jasonqgl.org>
        90700 by: Chris Fry <chrisquillsoft.com.au>

Regular ****ing expressions
        90688 by: Nathan Wallace <nathansynop.com>

msql password
        90689 by: php3developersdesk.com

URL referrers
        90691 by: Nathan Wallace <nathansynop.com>

BASIC (shopping) cart
        90692 by: Nathan Wallace <nathansynop.com>

virtual()
        90693 by: Nathan Wallace <nathansynop.com>

matrix
        90695 by: delbonodsc.it (Delbono)

using MySQL keys in PHP
        90696 by: Andres Montiel <amontielvasia.com>
        90698 by: Rob Hardowa <hardowask.sympatico.ca>

[FAQTS] PHP Knowledge Base Update -- May 17th, 2000
        90697 by: Nathan Wallace <nathansynop.com>

Cookie-array
        90699 by: Matthias Schonder <matthias.schonderschonder.com>

SQL: count / limited group?
        90701 by: "Meir Kriheli - MKsoft" <mksoftnetvision.net.il>
        90725 by: Samuel Leibowitz <sleibowidilithium.btcwcu.org>

PostgreSQL: getting error number
        90702 by: Guillaume Perréal <perreallyon.cemagref.fr>

Why can't I use "order by .." in select clause? NT + PHP + Mysql
        90703 by: Yong Wei <yweibaan.com>

Removing html special chars
        90704 by: "Jesper Hess Nielsen" <jespergraffen.dk>
        90705 by: Soeren Staun-Pedersen <staunitcampus.dk>

system caLL
        90706 by: Reiner Peterke <aardvarkmpipks-dresden.mpg.de>
        90707 by: Soeren Staun-Pedersen <staunitcampus.dk>
        90708 by: Sven Huster <shupnetzmarkt.de>
        90713 by: Reiner Peterke <aardvarkmpipks-dresden.mpg.de>

Automating reports.
        90709 by: "Mark Nold" <MarkNawi.com.au>

unsupported?
        90710 by: "Harun" <haruncrb.elga.net.id>
        90712 by: Soeren Staun-Pedersen <staunitcampus.dk>

Convert File last modifeid date to mysql datetime ?
        90711 by: "Meir Kriheli - MKsoft" <mksoftnetvision.net.il>
        90714 by: "Meir Kriheli - MKsoft" <mksoftnetvision.net.il>

fax
        90715 by: Alejandro Pérez Nava <alecanaryweb.es>

I can't use Imagepng() in my PHP+Mysql program
        90716 by: liwei <liweisepaeic.gov.cn>

Another Session Topic
        90717 by: Holger Bahr <hbtsi-gmbh.de>
        90745 by: Sascha Schumann <saschaschumann.cx>

HTML email
        90718 by: kev <kevin.porterfast.no>

Stupid Array Question, I'm sure
        90719 by: "Derek" <dbrucebrowsehere.com>
        90721 by: "Rossi Designs" <webmasterrossidesigns.net>
        90723 by: "Browsehere.com" <phpbrowsehere.com>
        90726 by: "Derek" <dbrucebrowsehere.com>
        90732 by: "Rossi Designs" <webmasterrossidesigns.net>

How can draw chinese char into to image
        90720 by: ÌÆÎÄÃñ <tangwenmincitiz.net>

logout info
        90722 by: Samuel Leibowitz <sleibowidilithium.btcwcu.org>
        90751 by: "Paul Burney" <burneygseis.ucla.edu>

odbc query
        90724 by: "Andrew Hill" <ahillopenlinksw.com>

cookie bug of IE4 - would you like to read somoenelse amazon's cookie?
        90727 by: delbonodsc.it (Delbono)

what's wrong with my class
        90728 by: Samuel Leibowitz <sleibowidilithium.btcwcu.org>

RAD PHP DB Tools?
        90729 by: Jeffrey Thompson <jeffreythompsonic.com>

another bug posted - not properly OT
        90730 by: delbonodsc.it (Delbono)

Openlink ODBC Alternatives
        90731 by: "alex" <alexquad.com.ar>
        90734 by: Maarten Stolte <M.StolteSamhoud.nl>
        90736 by: "Rossi Designs" <webmasterrossidesigns.net>
        90738 by: Maarten Stolte <M.StolteSamhoud.nl>
        90740 by: "alex" <alexquad.com.ar>
        90741 by: "alex" <alexquad.com.ar>

mt_rand() problem? -> (MySQL crashes)
        90733 by: Gianluca Baldo <gianlucabbcninedita.com>
        90739 by: Gianluca Baldo <gianlucabbcninedita.com>

Escapeshellcmd
        90735 by: "Charles" <charlesstarbox.com.br>

More stupid questions
        90737 by: "matrix" <neutrinoquadrent.net>

basename() not working
        90742 by: "Doug Poland" <dpolandexecpc.com>
        90750 by: "Richard Lynch" <richardzend.com>

RC2 Compiles on PPC (Yellow Dog Linux)
        90743 by: "Waldo L. Jaquith" <waldowaldo.net>
        90747 by: Sascha Schumann <saschaschumann.cx>

Last Dabase Update
        90744 by: "Giulio Borrini" <gborrinimarketingmedia.it>

Mysql \n
        90746 by: "Jean de Lavarene" <jdelavareneonline.fr>

sort on several fields
        90748 by: Meynet Christophe <jo_surfyahoo.com>
        90749 by: Meynet Christophe <jo_surfyahoo.com>

Administrivia:

To subscribe to the digest, e-mail:
        php3-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php3-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php3lists.php.net

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

attached mail follows:


Hi there,

I have compiled mysql-3.22.22 and php4.0b2 and gettext and freetype and
configure with "--with-ttf" option. It compiles fine and install okay.
However, when I want to use "imagettfbbox" and the related functions, it
said it did not recognise the function. Seems like the ttf is not
installed. BTW, I install all these on BSDI4.1 box.

Any suggestions why?

Daniel

attached mail follows:


Hi there. I represent an online community that is thinking of adding free
email to its list of services. We basically want to provide a hotmail-like
service to all our users, so basically a free email account accessible via a
web page with features such as spam blocking, folders, message rules, and
auto forwarding.

We have seen a number of commercial solutions that are very expensive, but I
have also heard of open source solutions that we could be able to use and
develop. The main problem is that we expect over 1 million accounts to be
created within 3 months, possibly around 10,000 accounts a day... so this
rules out a lot of possible software solutions.

Does anybody have any ideas on how we can approach this? Are there any
software programs out there that we can use, or would anybody be willing to
write/develop one for us? We would prefer to do one in-house, but we dont
have any programmers!

Thanks,
Adam

attached mail follows:


> Does anybody have any ideas on how we can approach this? Are there any
> software programs out there that we can use, or would anybody be willing to
> write/develop one for us? We would prefer to do one in-house, but we dont
> have any programmers!

http://www.faqts.com/knowledge-base/view.phtml/aid/166/fid/20

-Nathan

attached mail follows:


Hi Folks

Whats the best way to write out HTML code when inside PHP code. Here is
an example of what I want to do

[snip]
<?php

<php code in here>
//now want to write a few lines of html
echo "<FORM ACTION=\"test.php3\" METHOD=POST>";]
etc
<php code>

?>

[snip]

I have quite a few lines of HTML code I want to place in the script and
I find it clumsy at having to escape the " characters. What is a better
way to place HTML code in a portion of PHP code?

Cheers

Tony

attached mail follows:


http://www.php.net/manual/language.basic-syntax.php

jason

> Hi Folks
>
> Whats the best way to write out HTML code when inside PHP code. Here is
> an example of what I want to do
>
> [snip]
> <?php
>
> <php code in here>
> file://now want to write a few lines of html
> echo "<FORM ACTION=\"test.php3\" METHOD=POST>";]
> etc
> <php code>
>
>
> ?>
>
> [snip]
>
> I have quite a few lines of HTML code I want to place in the script and
> I find it clumsy at having to escape the " characters. What is a better
> way to place HTML code in a portion of PHP code?
>
> Cheers
>
> Tony

attached mail follows:


My apologies, I thought that page contained what you were asking.

The situation in your question is pretty much answered that that page in the
manual - but maybe you mean inside functions or control structures:

<?
function mysq_func() {
    lines of php code
?>
regular html
<?
    back into php again
}
?>

or inside if/else blocks:

<?
if (...) {
    lines of php code
?>

regular html

<?
else {
    more php code
?>

alternate html for else section

<? } /* end if and close php */ ?>

or inside a loop:

<?
for(...) {
    lines of php
?>
regular html to print in each loop
<? } /* end loop and exit php */ ?>

jason

> Hi Folks
>
> Whats the best way to write out HTML code when inside PHP code. Here is
> an example of what I want to do
>
> [snip]
> <?php
>
> <php code in here>
> file://now want to write a few lines of html
> echo "<FORM ACTION=\"test.php3\" METHOD=POST>";]
> etc
> <php code>
>
>
> ?>
>
> [snip]
>
> I have quite a few lines of HTML code I want to place in the script and
> I find it clumsy at having to escape the " characters. What is a better
> way to place HTML code in a portion of PHP code?
>
> Cheers
>
> Tony
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribelists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net
> To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-adminlists.php.net
>
>

attached mail follows:


Simply drop out of php - do the html stuff - then back into php. You ca do this
even in the middle of a while or for loop

<?php

<php code in here>
//now want to write a few lines of html
?>
^^^
echo "<FORM ACTION=\"test.php3\" METHOD=POST>";]
etc
<?php
^^^^^
<php code>

?>

Antony Stace wrote:

> Hi Folks
>
> Whats the best way to write out HTML code when inside PHP code. Here is
> an example of what I want to do
>
> [snip]
> <?php
>
> <php code in here>
> //now want to write a few lines of html
> echo "<FORM ACTION=\"test.php3\" METHOD=POST>";]
> etc
> <php code>
>
> ?>
>
> [snip]
>
> I have quite a few lines of HTML code I want to place in the script and
> I find it clumsy at having to escape the " characters. What is a better
> way to place HTML code in a portion of PHP code?
>
> Cheers
>
> Tony
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribelists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net
> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-adminlists.php.net

--
Chris Fry
Quillsoft Pty Ltd
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691 Fax: +61 2 9553 1692 Mobile: 0419 414 323 eMail: chrisquillsoft.com.au http://www.quillsoft.com.au

attached mail follows:


> This seems to be messed up from the get go. > One way it kinda worked was with: > > $result = split('<:\$[a-zA-Z0-9_]+:>', $str); > > (Couldn't get the double escape to work. Maybe > a magic quote thing?)

I think you'll find that this has to do with double vs single quotes. In double quotes PHP interprets the \ slashes. In single quotes it leaves them alone.

Frankly it all gets pretty confusing in the end... <grin>

-Nathan

attached mail follows:


Addressed to: richardzend.com (Richard Lynch) php3lists.php.net

** Reply to note from richardzend.com (Richard Lynch) Tue, 16 May 2000 15:50:55 -0500 > > You could also put the FORM on an SSL server, the database on a > separate machine which is connected to the SSL server *ONLY* by a > single, separate network card to/from the SSL server. All other ports > on the database server would be locked down, turned off, and disabled. > Only that one network card in each machine will handle all SSL <-> > database interaction. > > Disclaimer: I don't even understand how to do that second one, it just > sounded real neato when somebody recommended it the last time this > came up :-)

You establish a second, separate network between the web servers and the database server. As long as the web servers don't forward packets the two networks can never communicate, yet the web servers can access both the Internet and the database server.

The key to security is not so much locking down the ports on the database server as making sure the web servers do not forward packets to/from the Internet. I'm not saying don't lock down unneeded ports, that is common sense, just pointing out the key is not forwarding packets thru the web servers.

How to set it up...

Database Server:

This machine is fairly normal and has only one network card. Shut off everything but the database server. No sendmail, httpd, etc. Disable anything you don't _need_ in inetd.conf. If you don't need any inetd services don't start the daemon.

Pick an IP address from RFC1918 address space. (10.x.x.x, 192.168.x.x and one other block I don't remember.) Add this address to your /etc/hosts files or DNS so web server(s) can find the database server.

The Database Network:

Connect the database machine to a new hub or switch that is NOT connected to the Internet. If there is only one web server you can use a crossover cable. Connect the second network card in each web server to the database network hub. Make SURE it connects to nothing but web servers that need access to the hidden database server. One possible exception would be a backup server. (As in a box with a tape drive.) It would be able to see the web servers and the database, but not the Internet, or your news and mail servers.

Web server(s):

Add a second network card. Pick an RFC1918 address in the same subnet as the database server. Connect it to the database network.

Make sure IP forwarding is OFF, so the machine will not route packets from one interface to the other. THIS IS VERY IMPORTANT!!! I compile static kernels with IP Forwarding disabled for my servers.

Make sure the database server is referenced in /etc/hosts or DNS so you can list it by name in the hostname parameter of all your scripts.

Start pointing your scripts at the hidden database server.

Rick Widmer Internet Marketing Specialists www.developersdesk.com

attached mail follows:


> Any pointers?

http://www.faqts.com/knowledge-base/view.phtml/aid/248/fid/385

-Nathan

attached mail follows:


shopping carts:

http://www.faqts.com/knowledge-base/view.phtml/aid/88/fid/29

sessions:

http://phplib.netuse.de

-Nathan

attached mail follows:


> echo="$hello";

this is wrong...

try:

echo $hello;

or:

echo "$hello";

Here is more info on the echo and print statements:

http://www.faqts.com/knowledge-base/view.phtml/aid/1/fid/41

-Nathan

attached mail follows:


Thanks, I used to go to Session Four, Chapter four... in the manual

----- Original Message ----- From: "Sam Masiello" <smasiellochekinc.com> To: "Delbono" <delbonodsc.it>; "php3" <php3lists.php.net> Sent: Tuesday, May 16, 2000 9:37 PM Subject: RE: [PHP3] matrix

> > See the following URL: > > http://php3.org/manual/html/language.types.array.html > > Sam Masiello > System Analyst > Chek.Com > (716) 853-1362 x289 > smasiellochekinc.com > > -----Original Message----- > From: Delbono [mailto:delbonodsc.it] > Sent: Tuesday, May 16, 2000 3:33 PM > To: php3 > Subject: [PHP3] matrix > > Are there multidimensional arrays in php (or sometyhing like a matrix)? > If not, willsomething be developed? > Thanks > Nicola > > > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribelists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > To search the mailing list archive, go to: > http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribelists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-adminlists.php.net > > >

attached mail follows:


How do I use MySQL keys with PHP? What are MySQL keys anyway? I just heard someone say that MySQL keys can be used to order searches. Is this true? How do I implement this?

attached mail follows:


hiya,

Not really. A key is just another word for 'index'. You can index a column of your table.....and they just changed what the column definition for key columns is in version 3.23 I believe, with the addition of the MyISAM table type.

Anyway, if you define an index on a column, it just changes the way that mysql searches for info in that column when using a 'where' clause. Check out the mysql manuals at their website http://www.mysql.org There are some great chapters on optimizations, using 'EXPLAIN' to figure out how MySQL is performing a particular search, how to specify what indexes it should use, etc.

You can 'access' a key column the same way you would a normal column...cause that's all it is. The key is actually stored in a separate file and only contains information pertaining as to how mysql should obtain a particular row, etc. You don't need to know anything special to access it, although if you need to determine if a column is a key or what type of key it is you can use mysql_fetch_field. Indexing is all done within MySQL itself and the only thing you need to know is which columns to put indexes on.

Rob

On Wed, 17 May 2000, you wrote: > How do I use MySQL keys with PHP? What are MySQL keys anyway? I just heard > someone say that MySQL keys can be used to order searches. Is this true? > How do I implement this?

-- 
I have learned silence from the talkative,
toleration from the intolerant, and kindness from the unkind.
		-- Kahlil Gibran

-------------------------------------------------------- This mail proudly composed and transmitted without the interference of any Micro$oft products or protocols. --------------------------------------------------------

attached mail follows:


More updates from:

http://php.faqts.com

cheers,

Nathan

## Unanswered Questions ########################################

------------------------------------------------------------- How to make MySQL support into an installed PHP without reinstalling other modules?(On apache, LINUX) http://www.faqts.com/knowledge-base/view.phtml/aid/2900 ------------------------------------------------------------- William Holt

------------------------------------------------------------- how to setup Apache to use PHP CGI with VirtualHosting and suEXEC? http://www.faqts.com/knowledge-base/view.phtml/aid/2897 ------------------------------------------------------------- Amen Mok

------------------------------------------------------------- How do I compile a dynamic loadable XML parser module for use under Unix? http://www.faqts.com/knowledge-base/view.phtml/aid/1488 ------------------------------------------------------------- Philipp Reif, Fiona Czuczman, Matt Gregory

## New Entries #################################################

------------------------------------------------------------- How do I format a MySQL timestamp into a readable date? http://www.faqts.com/knowledge-base/view.phtml/aid/2926 ------------------------------------------------------------- Kay Crowley

I spent a couple of hours figuring this out even -with- plenty of available resources. Maybe this will help someone...

Change MySQL Timestamp (8char) into readable date

First, a UNIX_TIMESTAMP is not the same as a MySQL Timestamp. If you are using a MySQL Timestamp, you can use MySQL's DATE_FORMAT() Function to properly format it when you query your database.

As an example, DATE_FORMAT will render 'May 16, 2000' From a timestamp of '20000516'(and more per your own timestamp specs).

*YOUR QUERY: $query = "SELECT Field1,Field2,date_format(Timestamp_Field_Name, '%M % d, %Y') AS Readable_Date,Field4 from Table_Name"; [Note: "date_format(Timestamp_Field_Name, '%M %D, %Y') AS Readable_Date" is the critical piece here. Replace Timestamp_Field_Name with your own timestamp field name.] *YOUR IDENTIFICATION AS VARIABLE [Massage to match your own coding/variables] $Field2 = mysql_result($result,$counter,"Field2"); $Timestamp_Field_Name = mysql_result($result,$counter,"Readable_Date"); $Field4 = mysql_result($result,$counter,"Field4"); *DISPLAY IN HTML PAGE PRINT "$Timestamp_Field_Name";

For more information, refer to the MYSQL Docs: http://web.mysql.com/Manual_chapter/manual_Reference.html Do a find for DATE_FORMAT

------------------------------------------------------------- How can I create a script that allows people to comment on products? http://www.faqts.com/knowledge-base/view.phtml/aid/2950 ------------------------------------------------------------- Nathan Wallace Richard Lynch

Untested code off the top of my head:

CREATE table comments( productid int4, comment text );

product.php3 <?php $productid = 42; $product_name = 'widget'; echo "<A HREF=comment.php3?productid=$productid>Comments</A> about $product_name<BR>\n"; $comments = mysql_query("select comment from comments where productid = $productid") or die(mysql_error()); while (list($comment) = mysql_fetch_row($comments)){ echo $comments, "<HR>"; } ?>

comment.php3 <?php if (isset($submit)){ mysql_query("INSERT into comments(productid, comment) values($productid, '$comments')") or die(mysql_error()); echo "Thank you for your comment.<BR>\n"; } ?> <FORM ACTION=comment.php3 METHOD=POST> <TEXTAREA NAME=comments WRAP=VIRTUAL></TEXTAREA><BR> <INPUT TYPE=SUBMIT NAME=submit> </FORM>

------------------------------------------------------------- How do I use the gettext function? http://www.faqts.com/knowledge-base/view.phtml/aid/2953 ------------------------------------------------------------- Nathan Wallace chuck, Markus Harma

Here's a quick summary that assumes you already have the .mo files made:

1. if (!(isset($language))) { $language = select_lang(); } 2. putenv("LANG=$language"); 3. bindtextdomain('imp', './locale'); 4. textdomain('imp');

Line by line: 1). select_lang() is a horde function that uses HTTP_ACCEPT_LANGUAGE and a preference cookie that we set to negotiate what the language should be. Substitute something like: $language = 'fr' to just test french, for example.

2). Set the LANG env variable. setlocale($language, LC_ALL) seems like it ought to work, but it doesn't.

3). Tell gettext that we're looking for imp.mo files, and to search the "locale" directory that's on the same level as this script. Note that .mo files really need to be in ./locale/$language/LC_MESSAGES/imp.mo.

4). This seems to be somewhat redundant with the last call, but both are needed. Someone who's used gettext in other environments care to explain it to me? =)

Now, just use echo _("string") instead of echo "string" (or the long form, gettext("string")), and you should be all set.

I hope this helps you out. Btw, you compile --with-gettext to get the support - I don't know if it was in 3.0.7, but if not, I'm sure you can find many other reasons to upgrade. :)

------------------------------------------------------------- How do I create a dynamic hyperlink in PHP? http://www.faqts.com/knowledge-base/view.phtml/aid/2898 ------------------------------------------------------------- Nasser Ghoorun, Matt Gregory, Nathan Wallace

Standard hyperlink echoed in PHP echo "<a src=\"http://www.mysite.com/index.html\">mysite</a>";

Dynamic hyperlink echoed in PHP where $urlvar is the variable URL. echo "<a src=\"$urlvar\">$urlname</a>";

------------------------------------------------------------- How can I control error handling in PHP? Can I log all PHP errors to a file? http://www.faqts.com/knowledge-base/view.phtml/aid/2961 ------------------------------------------------------------- Nathan Wallace Paul Fotheringham

You can control how errors get written out with the php3.ini (or equivalent) configuration file. Look for a section named something like "Error Handling and Logging". On my set-up I have:

display_errors = Off log_errors = On error_log = whatever/file/you/want/to/use

------------------------------------------------------------- How can I use a global variable inside a class? http://www.faqts.com/knowledge-base/view.phtml/aid/2962 ------------------------------------------------------------- Nathan Wallace Wico de Leeuw

It's exactly the same as accessing global variables in functions:

class Globals { function show_self() { global $PHP_SELF; print $PHP_SELF; }

}

should do the trick.

------------------------------------------------------------- How can I set the language and char sets in the HTTP headers? Where can I get more information about building international web sites? http://www.faqts.com/knowledge-base/view.phtml/aid/2965 ------------------------------------------------------------- Nathan Wallace Rob Hardowa

I haven't looked into this too much yet, but here's a good site about it:

http://www.isoc.org:8080/

I'm doing a multi-lingual site at the moment that doesn't require any special character set so I just send these out in the <HEAD>:

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> <META HTTP-EQUIV="Content-Language" CONTENT="{LANGUAGE}">

According to the site I just gave you they recommend sending out the CONTENT="text/html; charset={yourcharset_UTF-8_orwhatever}" part of it in the header.

------------------------------------------------------------- How can I do simple natural language processing with PHP? How can I parse queries to remove natural language? http://www.faqts.com/knowledge-base/view.phtml/aid/2966 ------------------------------------------------------------- Nathan Wallace Michael Dearman, Steve Edberg

Take a look at the perl regular expression support. The preg's. 'THE' ref on regular expressions (IMHO) is Jeff Friedl's "Matering Regular Expressions", O'Reilly. A most 'unnatural' language. But, that'd be one possibility.

And, to add my .02 intergalactic creds:

I second the recommendation for Freidl's 'Mastering Regular Expressions', avaliable from O'Reilly. While it focuses mostly on Perl-style regexes (implemented in PHP's preg_...() functions; see http://www.php.net/manual/ref.pcre.php), it also briefly covers the POSIX-style expressions used in PHP's ereg_...() functions (http://www.php.net/manual/ref.regex.php).

For other natural-language processing tools, check out the list

http://www-a2k.is.tokushima-u.ac.jp/member/kita/NLP/nlp_tools.html

or the 'Unix for Linguists' page at

http://www-personal.umich.edu/~jlawler/routledge/regex.html

For more links, just run the AltaVista query

http://www.altavista.com/cgi-bin/query?sc=on&hl=on&kl=XX&pg=q&text=yes&q=%2B%22regular+expressions%22+%2Blinguistic*

------------------------------------------------------------- How can I build WAP services with PHP? http://www.faqts.com/knowledge-base/view.phtml/aid/2967 ------------------------------------------------------------- Nathan Wallace Matt Wiseman

There was an interesting article in Web Techniques regarding WAP and ASP that i highly recommend.. Mind you its not PHP, but as both platforms are so similar functionality-wise, you should be able to more than gleam something from that

http://www.webtechniques.com/archives/2000/03/passani/

------------------------------------------------------------- How can I produce WML from PHP? http://www.faqts.com/knowledge-base/view.phtml/aid/2968 ------------------------------------------------------------- Nathan Wallace SANIsoft

Here is a simple example of how I spew out WML using PHP3. As an added factor - I am using PHPlib for authentication. Check out the WML FAQ for more on using PHPlib authtentication with WML- search the list archive for the URL

===================================================== <?php header("Content-type: text/vnd.wap.wml"); // Tell browser that I am sending wml header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); //We dont want the protected pages to be cached header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); page_open(array("sess" => "redwap_Session", "auth" => "redwap_Auth")); // This is the call to PHPlib for starting session and Authentication code echo("<?xml version=\"1.0\"?>\n"); // This could have been below hard coded :-) echo("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n"); ?> <wml> <card id="edit" title="redDiary"> <p><anchor>Search <go href="search.php3" /> </anchor> </p> <p><anchor>Add Contact <go href="addcontact.php3"/> </anchor></p> <p><anchor>Send Email <go href="sendmail.php3" /> </anchor> </p> <p><anchor>Log Out <go href="logout.php3" /> </anchor> </p> <p><img src="msi.wbmp" alt="MSI Logo" />Menu<img src="ss.wbmp" alt="SS Logo" /> </p> </card> </wml> <? page_close() ?> // Do not forget to close all your pages =============================================

## Edited Entries ##############################################

------------------------------------------------------------- how can I proceed to implement chat using PHP3.0?Any related link for my query? http://www.faqts.com/knowledge-base/view.phtml/aid/1518 ------------------------------------------------------------- Shachi, Matt Gregory

Your best bet for implementing chat with PHP is to set up a relational databse for users, messages, and threads.

I would design this application with these interfaces: - Read message module - Post message module - Browse all messages - Browse thread - Mail management modules - User management modules - Help modules

This is an extensive project. Expect it to take you a week or more to write. Then, open source it so I can use it too. :)

------------------------------------------------------------- where can i find information for creating web based unix administration pages through php? http://www.faqts.com/knowledge-base/view.phtml/aid/1874 ------------------------------------------------------------- Dave Garth, Matt Gregory

PHP is not commonly used to administrate servers. The reason for this is because most servers do not put administrative scripts on an internet/intranet because of security related issues. There are, however, many script resources available on the web ( http://www.listproc.net/scripts/ , http://wundt.kfunigraz.ac.at/rath/documentation/node44.html )

PHP specifically is not used often for system administration because that was not what it was designed for. PHP is intended to quickly parse and return web pages. It does not have the fastest file i/o and system communication routines in the scripting language category.

With that said, now that you are in the areana do you mind starting a site and posting any scripts you create? :)

PS: members of www.phpwebhosting.com (like myself) have access to many php administrative scripts, but they are proprietary. You might want to look at currently available pearl, c++ cgi, and other web admin tools to get ideas before pounding something out in php.

------------------------------------------------------------- how do i compare and check the user input password from form with encrypted one in the Apache htaccess password file http://www.faqts.com/knowledge-base/view.phtml/aid/2141 ------------------------------------------------------------- Nikhil Mehta, Matt Gregory

The .htpasswd file containes users in a linear list as shown below

<username>:<encrypted-password><cr> where <cr> is carriage return.

In order to compare the encrypted-password to your user-entered information you must first encrypt the password using the mcrypt function.

Remember that you cannot decrypt the encrypted information in the .htpassword file. (at least not easily :) )

------------------------------------------------------------- I have made a web page generator, I'm having trouble trapping the parsed php3 file and saving it as a normal html file on the server..any ideas??? http://www.faqts.com/knowledge-base/view.phtml/aid/2271 ------------------------------------------------------------- Dave Murad, Matt Gregory

Well, not that this is a normal thing to do with PHP, but your best bet is to print all the text you return to the browser out to an open file stream as well (open with fopen, write with fwrite).

Some hosts will not allow you to do this since it is a security issue.

Your second option is to do what all the Search engines do. Hit the url of the html generation script and then, once you do your get command, save the returned information to blah.html. (where blah is the name you want to call the html file.)

I would not name PHP as the best tool for getting and writing the html file. This is something better suited for perl or python.

------------------------------------------------------------- When I try to run a script I've got a message box saying "couldn't find MSVCRTD.dll library in specified path <win path env>". What's going here? http://www.faqts.com/knowledge-base/view.phtml/aid/2555 ------------------------------------------------------------- Valmir Cinquini, Matt Gregory

MSVCRTD.dll is a microsoft runtime library containing much of the microsoft foundation classes implementation code. It is usually distributed with any application which use it.

Do a search on your HD for the file, if you find it, you need to move it into your path. This can be done by moving the file to your $:\windows\system or $:\winnt\system32 folder.

If you do not have the file then go to microsoft's webiste and download it or extract it off your installation cd. (msvcrtd.d_)

------------------------------------------------------------- how can I split year digits into 4 variables http://www.faqts.com/knowledge-base/view.phtml/aid/2843 ------------------------------------------------------------- Peter Morrissette, Henrik Jönsson, Richard Heyes http://www.php.net/manual/function.substr.php

$var_year = date("Y");

$var_digit1 = substring($var_year,0,1); $var_digit2 = substring($var_year,1,1); $var_digit3 = substring($var_year,2,1); $var_digit4 = substring($var_year,3,1);

Or

$var_year = date("Y");

$var_digit1 = $var_year[0]; $var_digit2 = $var_year[1]; $var_digit3 = $var_year[2]; $var_digit4 = $var_year[3];

------------------------------------------------------------- How can I send an email in both txt and HTML format and have only 1 be display in the users email program? http://www.faqts.com/knowledge-base/view.phtml/aid/2775 ------------------------------------------------------------- Michael Bell, Matt Gregory, Richard Heyes

You need to choose which one the user is going to see first, and make the second an attachment to the first.

Or send a multipart email using mime. Here's a class that will help:

http://phpclasses.upperdesign.com/browse.html/package/32

------------------------------------------------------------- How could I echo a variable which include "<? XXX ?>" http://www.faqts.com/knowledge-base/view.phtml/aid/1876 ------------------------------------------------------------- Matthew Ma, Matt Gregory, Nathan Wallace

I can see where this one would cause you trouble.

You have to avoid two parsing conflicts when you echo this return variable. First, php sees <? as the beginning of a script, and it sees ?> as the end of a script. To avoid this problem make sure that the return variable is inside of quotes like a string "<?".

Your second problem is the browser itself, which sees < as the beginning of an HTML tag. You need to change any "<" returned to the browser to "&lt;" and any ">" to "&gt;".

------------------------------------------------------------- Is it possible to PUSH content through PHP3 like the server time every second? http://www.faqts.com/knowledge-base/view.phtml/aid/1935 ------------------------------------------------------------- Chris Schmidt, Matt Gregory, Nathan Wallace

Yes and No. Using PHP alone, this is not possible. PHP is run when a file with an associated extention is called. For this reason it is impossible to have Server events triger PHP. You could do one of two things to make this happen however:

1.) Create a server-side module (Apache & IIS) or a Service (NT) to call your script on a timed basis or... 2.) Have a webpage refresh every X seconds thereby calling the generating script.

------------------------------------------------------------- How to pass login and password from first level script to third level script (that means one script is included in another,like that 3 levels)? http://www.faqts.com/knowledge-base/view.phtml/aid/1961 ------------------------------------------------------------- Samatha Kottha, Matt Gregory, Nathan Wallace

This is one of the most difficult problems for new users of PHP to understand. PHP is called when the page is called, and then closes once the page has been returned to the client. There are three possible ways to handle the problem of passing information between script files.

1.) return the variables to the browser as a hidden field in a form. You can decide whether or not to encrypt this information before plopping it into the HTML.

2.) return the variables in temporary cookies (make sure it is temporary.) and then delete the cookies when the user leaves the site.

3.) store the variables, encrypted or not as you prefer, in a database table of logged-in users or sessions.

There are other ways of doing this, but they are much harder and in my opinion not worth the trouble.

------------------------------------------------------------- How can I add/write to an existing file? http://www.faqts.com/knowledge-base/view.phtml/aid/2650 ------------------------------------------------------------- Peter Morrissette, Henrik Jönsson, Nathan Wallace

I generally do this (perhaps not the best way of doing it, but it works!):

Read the file you want to change into an array (or string).

Then add the changes to it accordingly (ofcourse this means you have to know where to add it) then write the file again.

Ex. (to add at the end of the file);

// set where the file is located $file_path = "filepath & filename";

// start reading in the file into the array $fileopen = fopen($file_path, "r");

if (!$fileopen) { echo "Can't open file"; }

for ($i=0; $buffer = fgets($fileopen, 16192); $i++) { $arr_file[$i] = $buffer; }

fclose($fileopen);

// this is what you want to add $str_toadd = "This i want to add";

// write the file $fileopen = fopen($file_path, "w"); for ($i=0; $i < sizeof($arr_file); $i++) { fwrite($fileopen, $arr_file[$i], 16192); } fwrite($fileopen, $str_toadd, 16192); fclose($fileopen);

As said earlier, probably a bit messy, but I've had no worries using it.

attached mail follows:


Hi,

where can I find a good online documentation about cookie-arrays? I have to books here, but both are not providing good information :( Thanx :)

-- 
BeHappy :)

Matthias "LoCal" Schonder ------------------------- BeDev #:E-18032 ------------------------- BeHot. BeCool. JustBe. Use BeOS. FreeBeOS: http://free.be.com -------------------------

By trying, we can easily learn to endure adversity -- another man's, I mean. -- Mark Twain

attached mail follows:


How about

Select ... from table ..... order by id desc LIMIT 100

Meir Kriheli MKsoft computer systems ----- Original Message ----- From: "Dieter Kneffel" <datawap4.com> To: "Doug Semig" <dougslistc3net.net> Cc: <php3lists.php.net> Sent: Tuesday, May 16, 2000 2:39 PM Subject: Re: [PHP3] SQL: count / limited group?

> Hi Doug & Co., > > Doug Semig schrieb: > > > At first I thought you only wanted the last 100 in the query that you were > > already doing, but upon re-reading your question I now feel you're asking > > how to limit a query so it will only operate on the last 100 rows in a table. > > > Is this the situation? You have a table into which rows keep getting > > inserted. You want to run this SQL that you're showing us on _only_ the > > last 100 rows that have been inserted into the table. > > This is correct! > > The query was just an example. My table has an id (auto_increment). > > How would such a subselect look like? > > When using temporary tables, what is the general way? Do I have to > get my last 100 rows with a while() loop in PHP, then write these back > using PHP in my temp. table, or can I manage it somehow with an SQL > query?! Basically: can I generate and fill such a temp table using an SQL > statement? > > As I intend to use this for online statistics, I don't want to waste too much > resources by always generating a temp. table upon a visitor enters the page. > On the other hand, I dont want to use a cronjob or similar as I always need > the actuall past 100 words... > > Any suggestions? > > > > > > If this is the case, you'll need something in the table to use to order the > > rows in reverse-inserted order. For example, a timestamp of when the row > > was added to the table or even a sequential key value would work. If you > > have either of those, the way to do it without subselects is this: > > > > 1. Select the fields you want from the table into a temporary table, > > putting them in descending order by the timestamp field or the sequential > > key value and limiting the output to 100 records > > > > 2. Run the SQL you've shown us on the temporary table and display the > > results on your web page > > > > 3. Drop the temporary table (if it's not done automatically) > > > > But even if you had the use of subselects, you would need some way to grab > > only the last 100 rows of a table. Since SQL does not guarantee the order > > in which rows will be returned for a query without an ORDER BY clause, you > > **must** have something to order your rows in descending order of which > > they were inserted so you can get only the 100 records you're interested > > in. That's why a timestamp value or a sequentially incremented counter > > would be good. Once you've gotten the exact 100 rows you're interested in, > > you can run the query you've shown us. > > > > Note that a timestamp value may be better because if a sequentially > > incremented counter may limit the number of rows in your table to the > > maximum number in the series. The maximum is usually over 2 billion, > > though, so at least it's not that bad. Also, if you can set your > > sequentially incremented counter to roll over back to the first number in > > the series, and it ever reached the maximum number in the series, it would > > break any get-the-last-100-inserted-rows processing based upon it. But use > > whichever makes sense to your app. > > > > Good luck, > > Doug > > > > Dieter Kneffel was heard at 03:14 AM 5/16/00 +0200 to say: > > >currently, I am using this query to get the most used names in a > > >complete (MySQL) database. > > > > > >$select = "select COUNT(name) as top ,name from table group by name > > >order by top desc"; > > > > > >-- > > > > > >here's the task: I only want to get the most used names from e.g. the > > >last 100 rows. > > >(and just ignore the other, older entries in the db) > > > > > >how do I have to modify the above select? Is it possible in one query, > > >do I have > > >to use sub-selects (could be a problem with mysql?!), or what other > > >options do I have? > > > > > >tnx, > > > > > >dieter > > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribelists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

attached mail follows:


Here's a thought - add a TIMESTAMP column to the table, then grab the records by timestamp:

SELECT * from myTable ORDER BY timestampField DESC LIMIT 100;

Sam Leibowitz (sleibowitzbtcwcu.org) Webmaster, Sysadmin Business Technology Center

On Tue, 16 May 2000, Doug Semig wrote:

> That is not a very robust solution. It breaks whenever a row is deleted > that happens to fall in the last 100 inserted rows. > > But if it makes you happy...go for it. > > Doug > > Dieter Kneffel was heard at 10:29 PM 5/16/00 +0200 to say: > >Yep, that's it! Just as simple as I thought of it! > > > >tnx, > > > >Dieter > > > >Cynic schrieb: > > > >> what about using select max(id) and then select * where id > $maxid - 100 ? > >> > ... snip ... >

attached mail follows:


Hello.

Does anybody know how to get the error number of the last postgresql operation? I'm using PHP 3.0.15 and PostgreSQL 7.0RC1.

Thanks.

Guillaume Perréal - Stagiaire MIAG Cemagref (URH), Lyon, France Tél: (+33) 4.72.20.87.64

attached mail follows:


Upgrade to 3.22.34

-----Original Message----- From: AiIfÊ [mailto:liweisepaeic.gov.cn] Sent: Wednesday, April 26, 2000 6:29 PM To: php3 Subject: [PHP3] Why can't I use "order by .." in select clause? NT + PHP + Mysql

php3?? Why can't I use "order by .." in select clause? NT + PHP + Mysql

??? liweisepaeic.gov.cn

-- 
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-unsubscribelists.php.net
To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net
To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-adminlists.php.net

attached mail follows:


Hi all

I have a problem generating inline gifs. I have a button which is supposed to contain the text "Accept Changes", but the text comes out as "Accept%20Changes". Is there a way I can resolve this? My button function is as follows :

<? Header("Content-type: image/gif"); $string=implode($argv, " "); $im = imagecreatefromgif("../icons/button_1.gif"); $red = ImageColorAllocate($im, 200, 1, 4); $px = (imagesx($im)-7.5*strlen($string))/2; ImageString($im,3,$px,9,$string,$red); ImageGif($im); ImageDestroy($im); ?>

and the strings are collected from a seperate strings file, which is included (to allow easy translation of the application). For example, the code to create my accept changes button is as follows :

<INPUT TYPE="image" SRC="addons/button.php?$str_accept_changes">

Any help is really greatly appreciated.

/Jesper

attached mail follows:


> I have a problem generating inline gifs. I have a button which is supposed > to contain the text "Accept Changes", but the text comes out as > "Accept%20Changes". Is there a way I can resolve this? My button function is > as follows :

Try the urldecode() function.

Cheers,

Soeren Staun-Pedersen - StaunSunSITE.auc.dk ------ "The internet is full, beat it" - Me.

attached mail follows:


i'm trying to run a command from within my php code i tried running with the system function but get no results.

i.e. system("mysql -uname -ppassword database < update.sql");

if i run it from a command prompt it works just fine. i put the command in a script and tried it that way. the echo command in the script shows up, but the mysql command has no effect. i get the feeling i'm just missing somethin, but can't put my finger on it.

anyhelp would be greatly appreciated.

r

attached mail follows:


> i.e. > system("mysql -uname -ppassword database < update.sql"); > > if i run it from a command prompt it works just fine. i put the command in a > script and tried it that way. the echo command in the script shows up, but the > mysql command has no effect. i get the feeling i'm just missing somethin, but > can't put my finger on it.

Do you have a safe_exec dir? Can you run the mysql executable at all? if you have set such a dir only the commands in there can be run, and not the rest.

Try with passthru(); which outputs right back to you. or $output=array(); exec($cmd,$output);

(php4) foreach ($output as $line) echo $line."<br>";

Cheers,

Soeren Staun-Pedersen - StaunSunSITE.auc.dk ------ "The internet is full, beat it" - Me.

attached mail follows:


On Wed, May 17, 2000 at 11:55:11AM +0200, Reiner Peterke wrote: > i'm trying to run a command from within my php code i tried running with the > system function but get no results. > > i.e. > system("mysql -uname -ppassword database < update.sql");

what does it return?

print system("mysql -uname -ppassword database < update.sql");

--
sven

attached mail follows:


i tried the passthru and i get no output. i can run mysql from a terminal. if i have the shell script pumpkin with #!/bin/ksh

echo PRINTME mysql -uname -ppassword mpipks < /home/aardvark/www/php/1/update.sql

then do system(pumpkin); i get PRINTME.

that's it. running from a terminal work just fine

no , i have not setup a safe_exec dir.n Wed, 17 May 2000, Soeren Staun-Pedersen wrote: > > i.e. > > system("mysql -uname -ppassword database < update.sql"); > > > > if i run it from a command prompt it works just fine. i put the command in a > > script and tried it that way. the echo command in the script shows up, but the > > mysql command has no effect. i get the feeling i'm just missing somethin, but > > can't put my finger on it. > > Do you have a safe_exec dir? Can you run the mysql executable at all? > if you have set such a dir only the commands in there can be run, and not > the rest. > > Try with passthru(); which outputs right back to you. > or > $output=array(); > exec($cmd,$output); > > (php4) > foreach ($output as $line) > echo $line."<br>"; > > Cheers, > > Soeren Staun-Pedersen - StaunSunSITE.auc.dk > ------ > "The internet is full, beat it" > - Me. > > > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribelists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-adminlists.php.net

attached mail follows:


Mike,

I would go ahead and build your user form to post the file to your web server then once that works write a costum web client to upload it from the datasource. I tend to do this in Perl (which will work on most platforms) with libwww. This is handy as you dont have to set up services like ftp or samba on your web server and you only need one data processor for the manual or automated process.

Mike, if you like i could mail a perl example.

mn

Mark Nold marknalverstone.com.au Systems Consultant

Change is inevitable, except from vending machines.

>>> Richard Lynch <richardzend.com> 05/17 5:11 am >>> In article <2063DE4A632FD3118A620020AFD2077E307A0CKatolight.com>, MikeHKATOLIGHT.COM (Mike Hatcher) wrote:

> Hello, > How do I go about automating .csv report to automatically upload to a web > server. I have a PHP script that reads the .csv report to the browser but > the problem is getting it to the web server automatically. Would I have to > ODBC it, or is there some script you could write to do this.

Depends on where the CSV comes from originally, but you may need to script it on the client side, or build an HTML form that lets the user "upload" their CSV.

Most people can handle a CSV-export followed by an "upload" form process, after you've trained them a few times to do it.

-- 
Richard Lynch                | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA        | http://www.L-I-E.com/artists.htm 
http://www.zend.com          | (this has nothing to do with Zend, duh!)

attached mail follows:


"Fatal error: Call to unsupported or undefined function in_array() in.........."

my script :

$thearray = array(bla, bla, bla) ; $query_result = mysql_db_query( $mydb, $query, $mysqlId ); $arr_row = mysql_fetch_row( $query_result ) ; while ($arr_row) { if ( ! in_array($arr_row[0], $thearray) ) { contitune ; } ............ }

in_array() not supported anymore, or ........ ?

thanks in adv. harun

attached mail follows:


> $thearray = array(bla, bla, bla) ; > $query_result = mysql_db_query( $mydb, $query, $mysqlId ); > $arr_row = mysql_fetch_row( $query_result ) ; > while ($arr_row) { > if ( ! in_array($arr_row[0], $thearray) ) { contitune ; } > ............ > } > > in_array() not supported anymore, or ........ ?

It is in my PHP4.... what are you using? :-)

Cheers,

Soeren Staun-Pedersen - StaunSunSITE.auc.dk ------ "The internet is full, beat it" - Me.

attached mail follows:


I'm trying to store the value returned from

filemtime(<file_name>)

in mysql column type of DATETIME.

If I store the value returned from filemtime(), I get strange result when I view the coulmn.

Any ideas ?

Meir Kriheli MKsoft computer systems

attached mail follows:


Sorry to bother you, figured it out:

date('Y-m-d H:i:s',filemtime(<filename>)

Meir Kriheli MKsoft computer systems

----- Original Message ----- From: "Meir Kriheli - MKsoft" <mksoftnetvision.net.il> To: <php3lists.php.net> Sent: Wednesday, May 17, 2000 1:50 PM Subject: [PHP3] Convert File last modifeid date to mysql datetime ?

> I'm trying to store the value returned from > > filemtime(<file_name>) > > in mysql column type of DATETIME. > > If I store the value returned from filemtime(), I get > strange result when I view the coulmn. > > Any ideas ? > > Meir Kriheli > MKsoft computer systems > > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribelists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

attached mail follows:


alguien sabe como es posible enviar un fax a traves de web

attached mail follows:


Hi, Why I can't use Imagepng() in my PHP+Mysql program in Redhat linux? I download gd1.8 and also zlib and pnglib. And when I install the last two library, they are OK, but it's not so lucky installing gd1.8, there are a little errors I'm not understand. Who can help me? I only want to display some curve or pie which data come from Mysql in my website.

Thanks so much for your reply.

liwei liweisepaeic.gov.cn

attached mail follows:


Hello,

i have a case here wich makes serious Trouble. Let´s say you are building an Online Shop. Let´s say the Customer has to log in (Session start) and then she/he can put Software/mp3´s/TIFFs/or big ZIP Files into an shopping cart.

Okay - it´s all nice and works fine. The Customer collected 7 nice and big Files.

But, what if the User starts to download a HUGE file from her/his cart (after payment), where the download process takes longer than her/his Session does exist. If the Customer waits until the download is finished and does not click any blinking Link on the Page to save Bandwidth for the download process, her/his Session maybe already is expired and when she/he wants to start her/his next download a Message like "You are not authorized - click here to log in" or similar pops up.

On the other Side, when you use really long expire times and the Customer does not log out from the Application ... the Session stays open until the expire time is reached.

attached mail follows:


> On the other Side, when you use really long expire times and the Customer > does not log out from the Application ... the Session stays open until the > expire time is reached.

When the user starts to download a file, set the timestamp to now + x * s where x is the size of the file currently downloaded and s is the estimated transfer rate (i.e. assume that your customer uses a slow modem). That will prevent the session from being deleted too early.

- Sascha

attached mail follows:


Hi,

I can send HTML emails easily enough using the mail() function and adding the "Content-Type: text/html" header. However, I need to know now if it is possible to send the email with the images inline, rather than being <IMG> tags. The only reason we would want to do this is so that people will still be able to see the page properly even if they read their email offline. Sending out a "Content-Disposition: inline" header made no difference.

Does anyone know if it is possible to do this?

thanks,

- Kev

attached mail follows:


I've searched, but can't seem to find the solution.

Any way to take this: $active = urldecode($active); $qcname = urldecode($qcname); $qst = urldecode($qst); $qzip = urldecode($qzip); $qcontactf = urldecode($qcontactf); $qcontactl = urldecode($qcontactl); $qrequested = urldecode($qrequested); $active = stripslashes($active); $qcname = stripslashes($qcname); $qst = stripslashes($qst); $qzip = stripslashes($qzip); $qcontactf = stripslashes($qcontactf); $qcontactl = stripslashes($qcontactl); $qrequested = stripslashes($qrequested);

And put it into an array? Like this?: $array = "active,qcname,qst,qzip,qcontactf,qcontactl,qrequested" ; $da = explode("," , $array) ; // Or should I use count($array[]) below? for ($c=0; $c < count($da) ; $c++ ) { $da[$c] = urldecode($da[$c]); $da[$c] = stripslashes($da[$c]); }

It just returns the names active, qcname, etc., not the values.

Thank you, Derek

attached mail follows:


How about

while(list($key,$value) = each($HTTP_GET_VARS)) { $$key = urldecode($value); $$key = stripslashes($value); }

I'm assuming this was a get request and those are all your form values.

Rossi Designs PO Box 1084 Holly Hill, FL 32125-1084 Phone : (904) 226-8979 URL : http://rossidesigns.net ----- Original Message ----- From: Derek <dbrucebrowsehere.com> To: <php3lists.php.net> Sent: Wednesday, May 17, 2000 8:53 AM Subject: [PHP3] Stupid Array Question, I'm sure

| I've searched, but can't seem to find the solution. | | Any way to take this: | $active = urldecode($active); | $qcname = urldecode($qcname); | $qst = urldecode($qst); | $qzip = urldecode($qzip); | $qcontactf = urldecode($qcontactf); | $qcontactl = urldecode($qcontactl); | $qrequested = urldecode($qrequested); | $active = stripslashes($active); | $qcname = stripslashes($qcname); | $qst = stripslashes($qst); | $qzip = stripslashes($qzip); | $qcontactf = stripslashes($qcontactf); | $qcontactl = stripslashes($qcontactl); | $qrequested = stripslashes($qrequested); | | And put it into an array? | Like this?: | $array = "active,qcname,qst,qzip,qcontactf,qcontactl,qrequested" ; | $da = explode("," , $array) ; // Or should I use count($array[]) below? | for ($c=0; $c < count($da) ; $c++ ) | { | $da[$c] = urldecode($da[$c]); | $da[$c] = stripslashes($da[$c]); | } | | It just returns the names active, qcname, etc., not the values. | | Thank you, | Derek | | | -- | PHP 3 Mailing List <http://www.php.net/> | To unsubscribe, send an empty message to php3-unsubscribelists.php.net | To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net | To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 | To contact the list administrators, e-mail: php-list-adminlists.php.net | | |

attached mail follows:


Actually no, it's a link based on the previous results of a form. First, you select multiple selects to narrow down the database results, then if you want to sort it, just click the link above that field and it does an "Order by" ($orderby).

I have to pass the previous query string values so that the $qry_str will be SELECT * FROM blah WHERE $active etc ORDER BY $orderby

Perhaps I am blind and am going about this the wrong way?

> How about > > while(list($key,$value) = each($HTTP_GET_VARS)) { > $$key = urldecode($value); > $$key = stripslashes($value); > } > > I'm assuming this was a get request and those are all your form values. > > Rossi Designs > PO Box 1084 > Holly Hill, FL 32125-1084 > Phone : (904) 226-8979 > URL : http://rossidesigns.net > ----- Original Message ----- > From: Derek <dbrucebrowsehere.com> > To: <php3lists.php.net> > Sent: Wednesday, May 17, 2000 8:53 AM > Subject: [PHP3] Stupid Array Question, I'm sure > > > | I've searched, but can't seem to find the solution. > | > | Any way to take this: > | $active = urldecode($active); > | $qcname = urldecode($qcname); > | $qst = urldecode($qst); > | $qzip = urldecode($qzip); > | $qcontactf = urldecode($qcontactf); > | $qcontactl = urldecode($qcontactl); > | $qrequested = urldecode($qrequested); > | $active = stripslashes($active); > | $qcname = stripslashes($qcname); > | $qst = stripslashes($qst); > | $qzip = stripslashes($qzip); > | $qcontactf = stripslashes($qcontactf); > | $qcontactl = stripslashes($qcontactl); > | $qrequested = stripslashes($qrequested); > | > | And put it into an array? > | Like this?: > | $array = "active,qcname,qst,qzip,qcontactf,qcontactl,qrequested" ; > | $da = explode("," , $array) ; // Or should I use count($array[]) below? > | for ($c=0; $c < count($da) ; $c++ ) > | { > | $da[$c] = urldecode($da[$c]); > | $da[$c] = stripslashes($da[$c]); > | } > | > | It just returns the names active, qcname, etc., not the values. > | > | Thank you, > | Derek > | > | > | -- > | PHP 3 Mailing List <http://www.php.net/> > | To unsubscribe, send an empty message to php3-unsubscribelists.php.net > | To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > | To search the mailing list archive, go to: > http://www.php.net/mailsearch.php3 > | To contact the list administrators, e-mail: php-list-adminlists.php.net > | > | > | > > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribelists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

attached mail follows:


I'm sorry, yes, that does work. Now another question:

After using that, I want to again urlencode them so the links will again be able to pass everything.

Using ?: while(list($key,$value) = each($HTTP_GET_VARS)) { $$key = urlencode($value); }

After using the one below to urldecode and stripslashes, it doesn't seem to work to urlencode. Is that because you can only use them once with $HTTP_GET_VARS ?

Derek.

----- Original Message ----- From: Rossi Designs <webmasterrossidesigns.net> To: Derek <dbrucebrowsehere.com>; <php3lists.php.net> Sent: Wednesday, May 17, 2000 8:54 AM Subject: Re: [PHP3] Stupid Array Question, I'm sure

> How about > > while(list($key,$value) = each($HTTP_GET_VARS)) { > $$key = urldecode($value); > $$key = stripslashes($value); > } > > I'm assuming this was a get request and those are all your form values. > > Rossi Designs > PO Box 1084 > Holly Hill, FL 32125-1084 > Phone : (904) 226-8979 > URL : http://rossidesigns.net > ----- Original Message ----- > From: Derek <dbrucebrowsehere.com> > To: <php3lists.php.net> > Sent: Wednesday, May 17, 2000 8:53 AM > Subject: [PHP3] Stupid Array Question, I'm sure > > > | I've searched, but can't seem to find the solution. > | > | Any way to take this: > | $active = urldecode($active); > | $qcname = urldecode($qcname); > | $qst = urldecode($qst); > | $qzip = urldecode($qzip); > | $qcontactf = urldecode($qcontactf); > | $qcontactl = urldecode($qcontactl); > | $qrequested = urldecode($qrequested); > | $active = stripslashes($active); > | $qcname = stripslashes($qcname); > | $qst = stripslashes($qst); > | $qzip = stripslashes($qzip); > | $qcontactf = stripslashes($qcontactf); > | $qcontactl = stripslashes($qcontactl); > | $qrequested = stripslashes($qrequested); > | > | And put it into an array? > | Like this?: > | $array = "active,qcname,qst,qzip,qcontactf,qcontactl,qrequested" ; > | $da = explode("," , $array) ; // Or should I use count($array[]) below? > | for ($c=0; $c < count($da) ; $c++ ) > | { > | $da[$c] = urldecode($da[$c]); > | $da[$c] = stripslashes($da[$c]); > | } > | > | It just returns the names active, qcname, etc., not the values. > | > | Thank you, > | Derek > | > | > | -- > | PHP 3 Mailing List <http://www.php.net/> > | To unsubscribe, send an empty message to php3-unsubscribelists.php.net > | To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > | To search the mailing list archive, go to: > http://www.php.net/mailsearch.php3 > | To contact the list administrators, e-mail: php-list-adminlists.php.net > | > | > | > > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribelists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

attached mail follows:


reset($HTTP_GET_VARS);

will set the array pointer back at the beginning of your $HTTP_GET_VARS array, but you should be able to access all the variables by name after the loop.

Rossi Designs PO Box 1084 Holly Hill, FL 32125-1084 Phone : (904) 226-8979 URL : http://rossidesigns.net ----- Original Message ----- From: Derek <dbrucebrowsehere.com> To: Rossi Designs <webmasterrossidesigns.net> Cc: <php3lists.php.net> Sent: Wednesday, May 17, 2000 9:30 AM Subject: Re: [PHP3] Stupid Array Question, I'm sure

| I'm sorry, yes, that does work. Now another question: | | After using that, I want to again urlencode them so the links will again be | able to pass everything. | | Using ?: | while(list($key,$value) = each($HTTP_GET_VARS)) { | $$key = urlencode($value); | } | | After using the one below to urldecode and stripslashes, it doesn't seem to | work to urlencode. Is that because you can only use them once with | $HTTP_GET_VARS ? | | Derek. | | ----- Original Message ----- | From: Rossi Designs <webmasterrossidesigns.net> | To: Derek <dbrucebrowsehere.com>; <php3lists.php.net> | Sent: Wednesday, May 17, 2000 8:54 AM | Subject: Re: [PHP3] Stupid Array Question, I'm sure | | | > How about | > | > while(list($key,$value) = each($HTTP_GET_VARS)) { | > $$key = urldecode($value); | > $$key = stripslashes($value); | > } | > | > I'm assuming this was a get request and those are all your form values. | > | > Rossi Designs | > PO Box 1084 | > Holly Hill, FL 32125-1084 | > Phone : (904) 226-8979 | > URL : http://rossidesigns.net | > ----- Original Message ----- | > From: Derek <dbrucebrowsehere.com> | > To: <php3lists.php.net> | > Sent: Wednesday, May 17, 2000 8:53 AM | > Subject: [PHP3] Stupid Array Question, I'm sure | > | > | > | I've searched, but can't seem to find the solution. | > | | > | Any way to take this: | > | $active = urldecode($active); | > | $qcname = urldecode($qcname); | > | $qst = urldecode($qst); | > | $qzip = urldecode($qzip); | > | $qcontactf = urldecode($qcontactf); | > | $qcontactl = urldecode($qcontactl); | > | $qrequested = urldecode($qrequested); | > | $active = stripslashes($active); | > | $qcname = stripslashes($qcname); | > | $qst = stripslashes($qst); | > | $qzip = stripslashes($qzip); | > | $qcontactf = stripslashes($qcontactf); | > | $qcontactl = stripslashes($qcontactl); | > | $qrequested = stripslashes($qrequested); | > | | > | And put it into an array? | > | Like this?: | > | $array = "active,qcname,qst,qzip,qcontactf,qcontactl,qrequested" ; | > | $da = explode("," , $array) ; // Or should I use count($array[]) below? | > | for ($c=0; $c < count($da) ; $c++ ) | > | { | > | $da[$c] = urldecode($da[$c]); | > | $da[$c] = stripslashes($da[$c]); | > | } | > | | > | It just returns the names active, qcname, etc., not the values. | > | | > | Thank you, | > | Derek | > | | > | | > | -- | > | PHP 3 Mailing List <http://www.php.net/> | > | To unsubscribe, send an empty message to php3-unsubscribelists.php.net | > | To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net | > | To search the mailing list archive, go to: | > http://www.php.net/mailsearch.php3 | > | To contact the list administrators, e-mail: php-list-adminlists.php.net | > | | > | | > | | > | > | > -- | > PHP 3 Mailing List <http://www.php.net/> | > To unsubscribe, send an empty message to php3-unsubscribelists.php.net | > To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net | > To search the mailing list archive, go to: | http://www.php.net/mailsearch.php3 | > To contact the list administrators, e-mail: php-list-adminlists.php.net | > | > | |

attached mail follows:


php3Hi, How can draw chinese char into to image with imagesting or imagettftext envirnment is win98 chinese version + pws + php3 Dan Tang tangwenmincitiz.net

attached mail follows:


Also, you could set the value attribute by hand.

<input type="password" name="pass" size="10" maxlength="20" value="">

Sam Leibowitz (sleibowitzbtcwcu.org) Webmaster, Sysadmin Business Technology Center

On Wed, 17 May 2000, Shriram Chaubal wrote:

> Bernie, > > If you're trying to do this in a form, you could use javascript to clear the > form field. > > Shri > > ----- Original Message ----- > From: "Bernie Huang" <bernie.huangec.gc.ca> > To: "PHP list" <php3lists.php.net> > Sent: Wednesday, May 17, 2000 1:28 AM > Subject: [PHP3] logout info > > > Ho can I clear login password on logout so that when user clicks on > 'back' button in browser, the password will not exist? Thanks. > > - Bernie > > > > ---------------------------------------------------------------------------- > ---- > > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribelists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net > To search the mailing list archive, go to: > http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

attached mail follows:


>> Ho can I clear login password on logout so that when user clicks on >> 'back' button in browser, the password will not exist? Thanks.

Another option would be to send a no-cache or expires header or meta tags with the original form so that none of the data in it would be cached.

Paul

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Paul Burney Webmaster and Internet Developer Educational Technology Unit Graduate School of Education and Information Studies University of California, Los Angeles (310) 825-8365 <webmastergseis.ucla.edu> <http://www.gseis.ucla.edu/> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

attached mail follows:


Benjohn,

Check the HOWTO at www.iodbc.org.

An updated one should be posted in the next day or so - I just submitted it.

The only real difference is an overview of why/how to use ODBC, and a note to tell you to use iODBC OR openlink, not both :)

Best regards, Andrew ---------------------------------------------------- Andrew Hill Technical Support Consultant OpenLink Software http://www.openlinksw.com Universal Database Connectivity Technology Providers

-----Original Message----- From: benjohn p villedo [mailto:bvilledoidsfinance.com] Sent: Tuesday, May 16, 2000 9:54 PM To: php3lists.php.net Subject: [PHP3] odbc query

hi all,

Good Day!!!

query regarding installation of the odbc support of php .. hmm done some tweaks unfortunately it seems that the odbc support couldn't be compiled with the distribution... err am not really sure bout that but whatever help i could get would be most appreciated.... :-)

objective: to get the odbc feature of php compiled and used

setup: Linux Slackware 7.0 Kernel 2.2.13 /usr/local/iodbc - for database manager (http://www.iodbc.org) /usr/local/openlink - for driver (http://www.openlinksw.com) [both are working basing on their own odbctest apps] Apache 1.3.12 with DSO support enabled PHP 4.0RC1

installation of php: $ ./configure --with-openlink=/usr/local/openlink --with- iodbc=/usr/local/iodbc -with-mysql -with-xml -disable-short-tags --with- apxs=/usr/local/apache/bin/apxs -enable-track-vars $ make $ make install

script on test php page: test.php <?php $handle = odbc_pconnect("SQL DB on NT","sa",""); ?>

error on the browser: Fatal error: Call to undefined function: odbc_pconnect() in /usr/local/apache/htdocs/test.php

where could i have gone wrong?! any tips / tricks / workarounds? it seems in the installation of php... F1 pls...

thanks and more power to all!!!

pal, benjohn

--
PHP 3 Mailing List
To unsubscribe, send an empty message to php3-unsubscribelists.php.net
To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net
To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-adminlists.php.net

attached mail follows:


Sorry for this OT - i thought it maybe interest some of you all.

How it works Using a specially constructed URL, a Web site can read Internet Explorer cookies set from any domain. For example, to read a user's Amazon.com cookie, a site could direct the user's browser to: http://www.peacefire.org%2fsecurity%2fiecookies%2fshowcookie.html%3F.amazon.com If you replace the "%2f"'s with "/" characters, and the "%3F" with "?", this URL is actually: http://www.peacefire.org/security/iecookies/showcookie.html?.amazon.com But IE gets confused and thinks the page is located in the Amazon.com domain, so it allows the page to read the user's Amazon.com cookie.

################################ If you click on the first of the two links you'll get your amazon's cookie displayed on the screen (obviously if you ever visited amazon.)

By changing the domain at the end of the url you get can get the cookie of any site you'v been.

I tried by changing amazon.com with bn.com/ and it worked.

Wjat does it mean? It means that if tricky person could redirect visitor of his/her site to a page like that one and suck the visitor's cookies of any other site.

I mean: wityh "one click buy" of amazon I can buy the entire store of amazon's paying with credit card of other people. (But I can't get the books be sent to my home since i should be able to change shipping adress...)

attached mail follows:


On Tue, 16 May 2000, Michael Dearman wrote:

> Well, hmmm. In the 'Pro PHP Programming' book, they have an example > in thier OO chap with a constructor function having $this->var form > of > params. Is this wrong, or is the constructor function an exception. > (Haven't checked if thier prog actually works) > > M. Dearman / semi-OO-clueless >

That makes sense for a function call, but not for the first line of a function definintion. For example...

class MyClass { var $biff;

function MyClass($boff) { $this->biff = $boff; } }

(later)

$foo = new MyClass(12); $bar = new MyClass($foo->biff);

HTH,

Sam Leibowitz (sleibowitzbtcwcu.org) Webmaster, Sysadmin Business Technology Center

attached mail follows:


Does anyone know of any Rapid Application Development (RAD) tools for PHP DB (MySQL and Oracle) to integrate them with HTML FORMS ? I'd prefer an open source project but would consider anything at this point.

Jeffrey Thompson President Thompson Internet Communications, Inc. http://www.thompsonic.com/

attached mail follows:


Hello, maybe you all already know of apache.org hacked by white hats last week.

Since the tools used to hack were PHP and MySql, and since I think maybe a good half of you use php+mysql+apache, i decided to post this message in order for you to take care of apache settings, MySql security settings and php execution permission.

Attached is the step-by-step hacking process that have been taken in action to attack www.apache.org.

please pay attention of root user of MySql

with Mysql select INTO OUTFILE you can write scripts almost everywhere on the server...

Hope not bothering you all. Nicola


attached mail follows:


Hi guys,

I'm actually using openlink software on my linux box to connect from php to a ms access database, it works!. But now I'm wondering, are there any other alternatives to openlink for a direct connection between php and ms access ? (being php at a linux box, access at an nt box and NOT using an intermediate database at all).

by the way, why doesn't odbc_num_rows($result) work ? is it a ms access issue.. or openlink's problem ?

Thanks in advance! Alex

attached mail follows:


Hi,

Numrows is a ODBC failure, not openlinks fault. Another solution besides openlink is www.easysoft.com 's ODBC ODBC bridge, which works nice too.

Maarten

> -----Original Message----- > From: alex [mailto:alexquad.com.ar] > Sent: Wednesday, May 17, 2000 3:55 PM > To: php3 > Subject: [PHP3] Openlink ODBC Alternatives > > > Hi guys, > > I'm actually using openlink software on my linux box to > connect from php to > a ms access database, it works!. But now I'm wondering, are > there any other > alternatives to openlink for a direct connection between php > and ms access ? > (being php at a linux box, access at an nt box and NOT using > an intermediate > database at all). > > by the way, why doesn't odbc_num_rows($result) work ? is it a > ms access > issue.. or openlink's problem ? > > Thanks in advance! > Alex > > > > > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to > php3-unsubscribelists.php.net > To subscribe to the digest, e-mail: > php3-digest-subscribelists.php.net > To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-adminlists.php.net

attached mail follows:


This is how I get numrows

$count=0; while (odbc_fetch_row($result)) $count++;

$count will contain the number of rows.

Rossi Designs PO Box 1084 Holly Hill, FL 32125-1084 Phone : (904) 226-8979 URL : http://rossidesigns.net ----- Original Message ----- From: Maarten Stolte <M.StolteSamhoud.nl> To: <php3lists.php.net> Sent: Wednesday, May 17, 2000 9:50 AM Subject: RE: [PHP3] Openlink ODBC Alternatives

| Hi, | | | Numrows is a ODBC failure, not openlinks fault. | Another solution besides openlink is www.easysoft.com 's ODBC ODBC bridge, | which works nice too. | | Maarten | | > -----Original Message----- | > From: alex [mailto:alexquad.com.ar] | > Sent: Wednesday, May 17, 2000 3:55 PM | > To: php3 | > Subject: [PHP3] Openlink ODBC Alternatives | > | > | > Hi guys, | > | > I'm actually using openlink software on my linux box to | > connect from php to | > a ms access database, it works!. But now I'm wondering, are | > there any other | > alternatives to openlink for a direct connection between php | > and ms access ? | > (being php at a linux box, access at an nt box and NOT using | > an intermediate | > database at all). | > | > by the way, why doesn't odbc_num_rows($result) work ? is it a | > ms access | > issue.. or openlink's problem ? | > | > Thanks in advance! | > Alex | > | > | > | > | > | > -- | > PHP 3 Mailing List <http://www.php.net/> | > To unsubscribe, send an empty message to | > php3-unsubscribelists.php.net | > To subscribe to the digest, e-mail: | > php3-digest-subscribelists.php.net | > To search the mailing list archive, go to: | http://www.php.net/mailsearch.php3 | To contact the list administrators, e-mail: php-list-adminlists.php.net | | -- | PHP 3 Mailing List <http://www.php.net/> | To unsubscribe, send an empty message to php3-unsubscribelists.php.net | To subscribe to the digest, e-mail: php3-digest-subscribelists.php.net | To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 | To contact the list administrators, e-mail: php-list-adminlists.php.net | |

attached mail follows:


Hi,

> probably running a REAL SQL server such as MySQL. Why not > move the data out >

Use postgresql then.. www.postgresql.org

No offense, but MySQL is not that much better then Access, where postgresql is a true RDBMS

Maarten Stolte

attached mail follows:


We would love to have a real SQL backend for this. but it's actually a bit hard to migrate from access to mysql/postgresql I've even tried ms access macros that export mysql valid statements in a text file.. but with a compex 400 Mb size mdb.. it's a hell of a work :/ I'll probably keep trying in near future :)

> Hi, > > > probably running a REAL SQL server such as MySQL. Why not > > move the data out > > > > Use postgresql then.. > www.postgresql.org > > No offense, but MySQL is not that much better then Access, where > postgresql is a true RDBMS > > Maarten Stolte

attached mail follows:


Thank you so much ! I'll give it a try

----- Original Message ----- From: Maarten Stolte <M.StolteSamhoud.nl> To: <php3lists.php.net> Sent: Wednesday, May 17, 2000 10:50 AM Subject: RE: [PHP3] Openlink ODBC Alternatives

> Hi, > > > Numrows is a ODBC failure, not openlinks fault. > Another solution besides openlink is www.easysoft.com 's ODBC ODBC bridge, > which works nice too. > > Maarten >

attached mail follows:


Hi all, the loop below (working fine with previous versions of PHP) seems to have problems with version 3.0.16. It generates a uniqID and checks the USERS table (looping) until the ID is not found in the table. Then it performs a simpe INSERT.

The code: <? mt_srand((double)microtime()*1000000); do { mysql_free_result ($res); $id= intval(uniqid(mt_rand()+$TPL_nick+$TPL_password)); $sql="SELECT id FROM users WHERE id = $id"; $res=mysql_query ($sql); } while (mysql_num_rows($res)>0); ?>

This code loops forever and mysql (after writing 140Mbyte in the log file) crashes. As I told before this was working fine with the previous versions of PHP. Any idea? Thanks in advance Gianluca

--
BCNINÉDITA
Aribau 70 3º 2ª
08011 BARCELONA
Tel.934540099 - Fax. 934541979
 ICQ 47323154 
gianlucabbcninedita.com
http://www.bcninedita.com

attached mail follows:


I am sorry, I forgot to say the problem is caused by the fact that the at every loop the generated ID **is always the same**

Regards, Gianluca

GB> Hi all, GB> the loop below (working fine with previous versions of PHP) seems to GB> have problems with version 3.0.16. GB> It generates a uniqID and checks the USERS table (looping) until the ID GB> is not found in the table. Then it performs a simpe INSERT.

GB> The code: GB> <? GB> mt_srand((double)microtime()*1000000); GB> do GB> { GB> mysql_free_result ($res); GB> $id= intval(uniqid(mt_rand()+$TPL_nick+$TPL_password)); GB> $sql="SELECT id FROM users WHERE id = $id"; GB> $res=mysql_query ($sql); GB> } while (mysql_num_rows($res)>0); ?>>

GB> This code loops forever and mysql (after writing 140Mbyte in the log GB> file) crashes. GB> As I told before this was working fine with the previous versions of GB> PHP. GB> Any idea? GB> Thanks in advance GB> Gianluca

GB> -- GB> BCNINÉDITA GB> Aribau 70 3º 2ª GB> 08011 BARCELONA GB> Tel.934540099 - Fax. 934541979 GB> ICQ 47323154 GB> gianlucabbcninedita.com GB> http://www.bcninedita.com

--
BCNINÉDITA
Aribau 70 3º 2ª
08011 BARCELONA
Tel.934540099 - Fax. 934541979
 ICQ 47323154 
gianlucabbcninedita.com
http://www.bcninedita.com

attached mail follows:


Anyone know how to pass values to this function ?

to use with finger command in the linux ?

how the will be the syntax ?

Thx

--
Charles

attached mail follows:


curently a script I'm working on does a check on username and subdomains. So far I can check usernames by using the /etc/passwd no problem, but the problem I've been having is the subs. One idea was to grep the httpd.conf for the servernames, but it was then sugested to use a db to search and check against existing db's. The db idea seams to be the best choce though I'm not too sure how to start the script as I'm still just learning php.

Mike

attached mail follows:


From: "Doug Poland" <dpolandexecpc.com> To: "Richard Lynch" <richardzend.com> Cc: <php3lists.php.net> Date: Wed, 17 May 2000 09:29:03 -0500 Message-ID: <NDBBKMNOJKJGAEKJNLIAIEFLDLAA.dpolandexecpc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Subject: RE: [PHP3] basename() not working

Doug said: > > > > I'm a newbie and must be missing something obvious. I've searched > > the archives and read the manual but cannot figure out why basename() > > is not working. Here's my deal... > > > > > > $img = basename($imgfilename); //imagefilename comes from a form > > printf("image: %s<br>", $img); //stripped file name > >

> Richard said: > > You'll need to call addSlashes($imgfilename) before inserting into > the database. > > Or, turn on MagicQuotes in php3.ini to have the addSlashes() automatically > called for all incoming data from forms. > The addSlashes function works fine, but the basename function does not strip any of the path information from the string.

I noticed when I used UNIX forward slashes, then basename works. i.e.,

$test = "/home/djp/public_html/index.php3"; $basenm = basename($test); $dirnm = dirname($test); printf("dir: %sfile: %s", $dirnm, $basenm);

dir: /home/djp/public_html file: index.php3

but when I use DOS backslashes, basename ignores me...

$test = "c:\home\djp\public_html\index.php3"; $basenm = basename($test); $dirnm = dirname($test); printf("dir: %sfile: %s", $dirnm, $basenm);

dir: c:\home\djp\public_html\index.php3 file: c:\home\djp\public_html\index.php3

Is this a bug, or a feature? Does the behavior of basename change depending on the host OS?

--
Doug 

attached mail follows:


> $test = "c:\home\djp\public_html\index.php3"; > $basenm = basename($test);

basename() may or may not be broken, but the string above is an invalid test: You need \\ for each \ in there.

If basename() still doesn't work after that, you'll have to add:

$test = str_replace("\\", "/", $test); between the two lines >quoted above.

This *would* break any filenames containing \ on Un*x, but that seems far less odious than having Windows pathnames not work, at least in the short term.

Your other option would be to pitch in and fix basename() function in PHP source.

attached mail follows:


Folks,

FYI, PHP4.0 RC2 compiles on Yellow Dog Linux's Champion Server v1.2. I could not get IMAP support (the configure complained about finding imap libraries, even though I told it right where to find c-client.a and the other few) or, oddly, MySQL support.

I'm going to try again for the MySQL -- I believe that was operator error. I don't know what to do about the IMAP. But that's not the point: It compiles!

Best, Waldo

+-------------------------------+ | cphack: you know you want it. | | http://www.waldo.net | +-------------------------------+

attached mail follows:


On Wed, 17 May 2000, Waldo L. Jaquith wrote:

> Folks, > > FYI, PHP4.0 RC2 compiles on Yellow Dog Linux's Champion Server v1.2. I > could not get IMAP support (the configure complained about finding imap > libraries, even though I told it right where to find c-client.a and the > other few) or, oddly, MySQL support.

Try symlinking c-client.a to libc-client.a. If that does not work, post the error message(s) and the output of this command:

$ find / -name rfc822.h -o -name \*c-client\*

> I'm going to try again for the MySQL -- I believe that was operator error. > I don't know what to do about the IMAP. But that's not the point: It > compiles!

It should work..

- Sascha

attached mail follows:


How can i get the last time and date that a Mysql Database was updated/changed?

Thanks

Regards Giulio Borrini

attached mail follows:


How is coded '\n' is a mysql table?

Jean

attached mail follows:


Sorry Richard but your function don't work correctly.

My file : #idcat|idrub|idsrub|Page.... 1|0|0|Cat1... 1|1|0|Rub1... 2|0|0|Cat2... 1|1|2|sRub2... 1|1|1|sRub1...

and I want :

#idcat|idrub|idsrub|Page.... 1|0|0|Cat1... 1|1|0|Rub1... 1|1|1|sRub1... 1|1|2|sRub2... 2|0|0|Cat2...

doing an : usort($tab, "compare");

with a the compare function that I'm looking for

this one:

function compare($left, $right){ return ( strcmp($left["idcat"], $right["idcat"]) or strcmp($left["idsubj"], $right["idsubj"]) or strcmp($left["title"], $right["title"]) or strcmp($left["url"], $right["url"]) ); }

get an error message like : Document contains no data..

Any ideas??

--- Richard Lynch <richardzend.com> a écrit : > In article > <20000516074625.12894.qmailweb1203.mail.yahoo.com>, > jo_surfyahoo.com > (=?iso-8859-1?q?Meynet=20Christophe?=) wrote: > > > function compare($left, $right) > > { > > if ($left["idcat"] == $right["idcat"]) return 0; > > return ($left["idcat"] < $right["idcat"]) ? -1 : > 1; > > } > > I would do it something like this: > > function compare($left, $right){ > return ( > strcmp($left["idcat"], $right["idcat"]) or > strcmp($left["idsubj"], $right["idsubj"]) or > strcmp($left["title"], $right["title"]) or > strcmp($left["url"], $right["url"]) > ); > } > > So what happens is this: > > First the idcat's are compared. If they are > different, 1 or -1 is > returned, and everything after the first "or" is > ignored. If they are the > same, strcmp returns 0, so we fall past the "or" > into the next thing to > compare. > > Then idsubj's are compared that same way: Either > they distinguish as less > than or greater, or they are equal and we fall > through again to the next > line. > > .. > .. > .. > > All this comparison is inside the parentheses, and > the result is simply > returned. > > > Note that each of the strcmp's is equivalent to the > two lines you wrote: > strcmp does what you did, only faster/shorter. > > > usort($tab, "compare"); > > > > my file looks like: > > > > > 1|0|0|Categorie1|Cat|framebas|../page.html|images|cat|0|1| > > > 1|1|0|Rubrique1|Rub1|framebas|../page.html|m10_10_10_on.gif|rub|0|1| > > > 1|2|0|Rubrique2|Rub2|framebas|../page.html|m10_10_10_on.gif|rub|0|1| > > > 1|2|2|SRubrique2|SRub2|framebas|../page.html|m10_10_10_on.gif|srub|0|1| > > > 1|2|1|SRubrique1|SRub2|framebas|../page.html|m10_10_10_on.gif|srub|0|1| > -- > Richard Lynch | If this was worth $$$ > to you, buy a CD > US Customer Support Director | from one of the > artists listed here: > Zend Technologies USA | > http://www.L-I-E.com/artists.htm > http://www.zend.com | (this has nothing to > do with Zend, duh!) > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to > php3-unsubscribelists.php.net > To subscribe to the digest, e-mail: > php3-digest-subscribelists.php.net > To search the mailing list archive, go to: > http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: > php-list-adminlists.php.net >

__________________________________________________ Do You Yahoo!? Send instant messages & get email alerts with Yahoo! Messenger. http://im.yahoo.com/

attached mail follows:


Sorry Richard but your function don't work correctly.

My file : #idcat|idrub|idsrub|Page.... 1|0|0|Cat1... 1|1|0|Rub1... 2|0|0|Cat2... 1|1|2|sRub2... 1|1|1|sRub1...

and I want :

#idcat|idrub|idsrub|Page.... 1|0|0|Cat1... 1|1|0|Rub1... 1|1|1|sRub1... 1|1|2|sRub2... 2|0|0|Cat2...

doing an : usort($tab, "compare");

with a the compare function that I'm looking for

this one:

function compare($left, $right){ return ( strcmp($left["idcat"], $right["idcat"]) or strcmp($left["idrub"], $right["idrub"]) or strcmp($left["idsrub"], $right["idsrub"]) ); }

get an error message like : Document contains no data..

Any ideas??

--- Richard Lynch <richardzend.com> a écrit : > In article > <20000516074625.12894.qmailweb1203.mail.yahoo.com>, > jo_surfyahoo.com > (=?iso-8859-1?q?Meynet=20Christophe?=) wrote: > > > function compare($left, $right) > > { > > if ($left["idcat"] == $right["idcat"]) return 0; > > return ($left["idcat"] < $right["idcat"]) ? -1 : > 1; > > } > > I would do it something like this: > > function compare($left, $right){ > return ( > strcmp($left["idcat"], $right["idcat"]) or > strcmp($left["idsubj"], $right["idsubj"]) or > strcmp($left["title"], $right["title"]) or > strcmp($left["url"], $right["url"]) > ); > } > > So what happens is this: > > First the idcat's are compared. If they are > different, 1 or -1 is > returned, and everything after the first "or" is