php-general Digest 18 Apr 2001 06:46:13 -0000 Issue 634

Topics (messages 49021 through 49132):

SOMEONE SHOOT ME!!!
        49021 by: Rick Kukiela
        49032 by: Martín Marqués
        49054 by: Godd
        49084 by: Phillip Bow

`AM_PROG_LIBTOOL' not found in library
        49022 by: Pablo Sabatino

Re: Is there such an array like $array[][]?
        49023 by: CC Zona
        49072 by: Plutarck

freetype
        49024 by: Kurth Bemis

Re: Dynamic Pages and Google ???
        49025 by: CC Zona
        49029 by: Mark Maggelet
        49067 by: Steve Werby

Re: Speed of MySQL connections - Socket vs. Non-Socket
        49026 by: Don Read
        49043 by: Alexander Skwar
        49059 by: Alexander Skwar
        49074 by: Alexander Skwar
        49075 by: Don Read
        49080 by: Alexander Skwar

Re: Finding Duplicate Numbers?
        49027 by: Mark Maggelet
        49031 by: Colin Putney
        49034 by: Mark Maggelet
        49039 by: Colin Putney

temp file help
        49028 by: Randy Johnson
        49030 by: Joe Stump
        49036 by: Phil Driscoll
        49052 by: Randy Johnson

Re: Site Sessions: Online/Offline - help?
        49033 by: Richard
        49070 by: Plutarck

Program to edit HTML file via the web??
        49035 by: Blake S.

Sending Email via PHP on Win2K
        49037 by: Boaz Yahav
        49062 by: Chris Anderson

ttf?
        49038 by: Kurth Bemis

multidimensional arrays
        49040 by: Michael Kimsal
        49103 by: Joe Stump

Re: fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14
        49041 by: Chris Anderson

PHP/OCI8 design for persistent connection tuning
        49042 by: Dave Thomas
        49097 by: Kent Sandvik
        49117 by: Dave Thomas

Why is this happening
        49044 by: Boget, Chris
        49048 by: Boget, Chris
        49053 by: Mark Maggelet
        49056 by: Boget, Chris
        49064 by: Mark Maggelet
        49066 by: Justin Farnsworth

SQL - Select rand() ?
        49045 by: James, Yz
        49078 by: Steve Lawson

TTF + GD
        49046 by: Kurth Bemis

PHP/M3U Questions!!!
        49047 by: Chris Cocuzzo
        49049 by: Kurth Bemis
        49061 by: Chris Cocuzzo
        49063 by: Kurth Bemis
        49069 by: Chris Cocuzzo

SSL SSL SSL SSL -- READ THIS!!!!!!
        49050 by: phpman
        49055 by: Martín Marqués

Re: Dynamic built web pages administration
        49051 by: Godd
        49111 by: Manisha

Screen Resolutions
        49057 by: Stuart Rees
        49058 by: Michael Geier
        49060 by: Martín Marqués
        49076 by: phpman

Re: Running php as a CGI
        49065 by: Steve Werby

Compiling Truetype fonts
        49068 by: barce
        49104 by: Tom Rogers

Stored Procedured
        49071 by: Juan Andres
        49077 by: phpman

Tip for cookies
        49073 by: Pat Hanna
        49079 by: Don Read
        49086 by: Beth J.
        49105 by: Joe Stump

Re: array_push but with key, value pairs
        49081 by: Joseph Blythe

Re: True Appreciation
        49082 by: Phillip Bow

select question
        49083 by: Matt \"TrollBoy\" Wiseman
        49087 by: Steve Werby
        49091 by: Don Read
        49106 by: Joe Stump

Re: PHP4.0.4pl1+PdfLib3.03+SCO
        49085 by: Chris Fry

Re: 'Embedding' a PDF file
        49088 by: Chris Fry

MySQL data
        49089 by: Augusto Cesar Castoldi
        49095 by: Seung-woo Nam
        49099 by: Grant Walters
        49107 by: Joe Stump
        49108 by: Maxim Maletsky

Re: [phplib] Sessions in windows
        49090 by: Matt Friedman

Re: HTML and slashes.
        49092 by: Dddogbruce \(.home.com\)

Re: [PUP] temp file help
        49093 by: Randy Johnson

CGI PHP Scripts: Error "Premature end of script headers"
        49094 by: Alexander Skwar

Form Processing problem....
        49096 by: Jack Lauman
        49098 by: Jack Dempsey

HTTP_POST_VARS not and array when used in a function?
        49100 by: Joseph Blythe
        49101 by: Rasmus Lerdorf
        49102 by: Joseph Blythe

mysql error code - how to debug
        49109 by: pyz.panix.com

Re: How do i include ASP script into PHP...??!
        49110 by: Dennis Gearon

HELP!! "print" problem
        49112 by: Martin Skjöldebrand
        49113 by: php.swifte.net
        49118 by: Martin Skjöldebrand

Last 10 rows
        49114 by: Randy Johnson
        49115 by: CC Zona
        49116 by: Rasmus Lerdorf
        49119 by: Joe Stump

Importing Data from Text File
        49120 by: Chris Aitken
        49122 by: Chris Fry

Is it possible to parse a variable by character?
        49121 by: Sean Coyle
        49126 by: Maxim Maletsky
        49130 by: Yasuo Ohgaki

mySQL Question....
        49123 by: Jason Caldwell
        49124 by: Opec Kemp \( Ozemail \)
        49125 by: Jason Caldwell
        49127 by: Don Read

Files without type???
        49128 by: Morten Winkler Jørgensen
        49132 by: David Robley

need help
        49129 by: chris herring

suEXEC CGI how-to
        49131 by: Cameron

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]


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


Ok,

I cant comprehend why php/apache is so freakin impossible to compile with
IMAP support?!? what is going on?

Ok, I am running OpenBSD 2.7, I downloaded the c-client stuff and complied
it and put the includes in the appropriate places, then i followed the php
installation instructions so i go into my apache src directory and do a

./configure

then I go into my php src directory and do a
./configure --with-mysql --with-imap --with-apache=../apache_1.3.19 --enable
-track-vars

this works fine.

I do the make; make install

works fine,

cd ../apache_1.3.19
./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/li
bphp4.a

This is what happens. Can some one please tell me why this is happening and
what I can do to work arround it?

Configuring for Apache, Version 1.3.19
 + using installation path layout: Apache (config.layout)
 + activated php4 module (modules/php4/libphp4.a)
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
 + configured for OpenBSD platform
 + setting C compiler to gcc
 + setting C pre-processor to gcc -E
 + checking for system header files
 + adding selected modules
    o php4_module uses ConfigStart/End
 + checking sizeof various data types
 + doing sanity check on compiler and options
** A test compilation with your Makefile configuration
** failed.  The below error output from the compilation
** test will give you an idea what is failing. Note that
** Apache requires an ANSI C Compiler, such as gcc.

cd ..;
gcc  -I/usr/local/src/php-4.0.3pl1 -I/usr/local/src/php-4.0.3pl1/main -I/usr
/local/src/php-4.0.3pl1/main -I/usr/local/src/php-4.0.3pl1/Zend -I/usr/local
/src/php-4.0.3pl1/Zend -I/usr/local/src/php-4.0.3pl1/TSRM -I/usr/local/src/p
hp-4.0.3pl1/TSRM -I/usr/local/src/php-4.0.3pl1 -DUSE_EXPAT -I./lib/expat-lit
e -DNO_DL_NEEDED `./apaci`     -o helpers/dummy
helpers/dummy.c   -rdynamic -Lmodules/php4 -L../modules/php4 -L../../modules
/php4 -lmodphp4  -lc-client  -lresolv -lm  -lresolv
ftl_unix.c:29: Undefined symbol `_mm_fatal' referenced from text segment
auth_md5.c:101: Undefined symbol `_mm_login' referenced from text segment
auth_pla.c:59: Undefined symbol `_mm_log' referenced from text segment
auth_pla.c:69: Undefined symbol `_mm_login' referenced from text segment
auth_log.c:63: Undefined symbol `_mm_login' referenced from text segment
env_unix.c:976: Undefined symbol `_mm_log' referenced from text segment
env_unix.c:993: Undefined symbol `_mm_log' referenced from text segment
env_unix.c:999: Undefined symbol `_mm_log' referenced from text segment
env_unix.c:1048: Undefined symbol `_mm_log' referenced from text segment
env_unix.c:1054: Undefined symbol `_mm_log' referenced from text segment
env_unix.c:1149: Undefined symbol `_mm_log' referenced from text segment
env_unix.c:1161: Undefined symbol `_mm_log' referenced from text segment
env_unix.c:1206: Undefined symbol `_mm_log' referenced from text segment
env_unix.c:0: More undefined symbol _mm_log refs follow
unix.c:306: Undefined symbol `_mm_critical' referenced from text segment
unix.c:328: Undefined symbol `_mm_nocritical' referenced from text segment
unix.c:346: Undefined symbol `_mm_nocritical' referenced from text segment
unix.c:433: Undefined symbol `_mm_nocritical' referenced from text segment
unix.c:574: Undefined symbol `_mm_flags' referenced from text segment
unix.c:690: Undefined symbol `_mm_nocritical' referenced from text segment
unix.c:715: Undefined symbol `_mm_nocritical' referenced from text segment
unix.c:747: Undefined symbol `_mm_nocritical' referenced from text segment
unix.c:791: Undefined symbol `_mm_notify' referenced from text segment
unix.c:807: Undefined symbol `_mm_critical' referenced from text segment
unix.c:810: Undefined symbol `_mm_nocritical' referenced from text segment
unix.c:847: Undefined symbol `_mm_nocritical' referenced from text segment
unix.c:896: Undefined symbol `_mm_notify' referenced from text segment
unix.c:953: Undefined symbol `_mm_critical' referenced from text segment
unix.c:957: Undefined symbol `_mm_nocritical' referenced from text segment
unix.c:0: More undefined symbol _mm_nocritical refs follow
unix.c:1165: Undefined symbol `_mm_critical' referenced from text segment
unix.c:1930: Undefined symbol `_mm_diskerror' referenced from text segment
unix.c:2050: Undefined symbol `_mm_diskerror' referenced from text segment
mail.c:980: Undefined symbol `_mm_status' referenced from text segment
mail.c:1357: Undefined symbol `_mm_flags' referenced from text segment
mail.c:2066: Undefined symbol `_mm_flags' referenced from text segment
mail.c:2130: Undefined symbol `_mm_searched' referenced from text segment
mail.c:2133: Undefined symbol `_mm_searched' referenced from text segment
mail.c:2293: Undefined symbol `_mm_notify' referenced from text segment
mail.c:2783: Undefined symbol `_mm_exists' referenced from text segment
mail.c:2811: Undefined symbol `_mm_expunged' referenced from text segment
mail.o: Undefined symbol `_mm_dlog' referenced from data segment
dummy.c:200: Undefined symbol `_mm_lsub' referenced from text segment
dummy.c:201: Undefined symbol `_mm_lsub' referenced from text segment
dummy.c:204: Undefined symbol `_mm_lsub' referenced from text segment
dummy.c:357: Undefined symbol `_mm_list' referenced from text segment
dummy.c:637: Undefined symbol `_mm_notify' referenced from text segment
smtp.c:506: Undefined symbol `_mm_dlog' referenced from text segment
smtp.c:559: Undefined symbol `_mm_dlog' referenced from text segment
smtp.c:585: Undefined symbol `_mm_dlog' referenced from text segment
collect2: ld returned 1 exit status
*** Error code 1

Stop in /usr/local/src/apache_1.3.19/src/helpers (line 39 of Makefile).
======== Error Output for sanity check ========
============= End of Error Report =============

 Aborting!


I am losing my mind... please help :)

Thanks,
Rick





On Mar 17 Abr 2001 21:51, Rick Kukiela wrote:
> Ok,
>
> I cant comprehend why php/apache is so freakin impossible to compile with
> IMAP support?!? what is going on?
>
> Ok, I am running OpenBSD 2.7, I downloaded the c-client stuff and complied
> it and put the includes in the appropriate places, then i followed the php
> installation instructions so i go into my apache src directory and do a

Try to compile apache with dinamic loader. Read the Apache readme. And after 
that fight with PHP.

Saludos... :-)

-- 
El mejor sistema operativo es aquel que te da de comer.
Cuida tu dieta.
-----------------------------------------------------------------
Martin Marques                  |        [EMAIL PROTECTED]
Programador, Administrador      |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------




Be very careful what you ask for






Godd has spoken :)  Sorry couldn't resist.
--
phill
""Godd"" <[EMAIL PROTECTED]> wrote in message
9biala$c59$[EMAIL PROTECTED]">news:9biala$c59$[EMAIL PROTECTED]...
> Be very careful what you ask for
>
>
>
> --
> 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!!
  I am using php4-cvs on Linux Suse 6.4.
  I issued the command ./buildconf and got a message:

  pablo@pablito:~/php4 > ./buildconf 
  buildconf: checking installation...
  buildconf: autoconf version 2.13 (ok)
  buildconf: automake version 1.4 (ok)
  buildconf: libtool version 1.3.5 (ok)
   

  WARNING: automake and libtool are installed in different
           directories.  This may cause aclocal to fail.
           continuing anyway
  aclocal: configure.in: 810: macro `AM_PROG_LIBTOOL' not found in library
  make[1]: *** [aclocal.m4] Error 1
  make: *** [all] Error 2
  pablo@pablito:~/php4 > 

  pablo@pablito:~/php4 > whereis libtool
  libtool: /usr/bin/libtool /usr/local/bin/libtool /usr/share/libtool
  pablo@pablito:~/php4 > whereis automake
  automake: /usr/bin/automake /usr/share/automake
  pablo@pablito:~/php4 > whereis automake
  automake: /usr/bin/automake /usr/share/automake
  pablo@pablito:~/php4 > 


  I installed libtool-1.3.5.
  Help me, please!!
  Pablo Sabatino..






In article <9bhrri$sn9$[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("Plutarck") wrote:

> Just another option, but feel free to use multi-dimensional arrays. Just be
> aware that PHP supports only two dimensions (so $array[][][] will not work),
> and if you try and get fancy with sort() and count() you are going to give
> yourself a migraine.

Odd.  3+ dimensions works fine for me.  I pass two dimensional arrays in 
forms all the time, then reference them from $HTTP_*_VARS which adds 
another dimension.  No problem there.  It's true sort() and count() are 
sorting or counting the elements of the first dimension, but PHP does 
provide other functions which allow for effective handling of more 
dimensions (ex. array_multisort()).

-- 
CC




Woh, I had no idea PHP supported more than 2 dimensions...lol, was that a
recent addition?

I could _sware_ I originally read it on either zend.com or in the manual
that 2 dimensional arrays are all that are supported...then again, this is
why I don't gamble :)


Live and learn, lol. Guess I should of actually _tried_ it and not have just
taken their word for it.


--
Plutarck
Should be working on something...
...but forgot what it was.


"CC Zona" <[EMAIL PROTECTED]> wrote in message
9bi3ac$9n9$[EMAIL PROTECTED]">news:9bi3ac$9n9$[EMAIL PROTECTED]...
> In article <9bhrri$sn9$[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED] ("Plutarck") wrote:
>
> > Just another option, but feel free to use multi-dimensional arrays. Just
be
> > aware that PHP supports only two dimensions (so $array[][][] will not
work),
> > and if you try and get fancy with sort() and count() you are going to
give
> > yourself a migraine.
>
> Odd.  3+ dimensions works fine for me.  I pass two dimensional arrays in
> forms all the time, then reference them from $HTTP_*_VARS which adds
> another dimension.  No problem there.  It's true sort() and count() are
> sorting or counting the elements of the first dimension, but PHP does
> provide other functions which allow for effective handling of more
> dimensions (ex. array_multisort()).
>
> --
> CC
>
> --
> 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 attempting to comiple in freetype2 into php4.0.4pl1.  this is my 
configure line

trinity:~/php-4.0.4pl1# ./configure --with-mysql=/usr/local/mysql/ 
--with-apache=../apache_1.3.19/ --enable-freetype-4bit-antialias-hack 
--with-ttf=/usr/local/lib/ --with-gd

and this is what configure spits back at me..

checking whether to add fribidi support... no
checking whether to enable FTP support... no
checking whether to enable truetype string function in gd... no
checking for libjpeg (needed by gd-1.8+)... no
configure: warning: If configure fails try --with-jpeg-dir=<DIR>
checking for libXpm (needed by gd-1.8+)... no
configure: warning: If configure fails try --with-xpm-dir=<DIR>
checking whether to include GD support... yes (static)
checking for gdImageString16 in -lgd... (cached) yes
checking for gdImagePaletteCopy in -lgd... (cached) yes
checking for gdImageColorClosestHWB in -lgd... (cached) yes
checking for compress in -lz... (cached) yes
checking for png_info_init in -lpng... (cached) yes
checking for gdImageColorResolve in -lgd... (cached) yes
checking for gdImageCreateFromPng in -lgd... (cached) yes
checking for gdImageCreateFromGif in -lgd... (cached) no
checking for gdImageWBMP in -lgd... (cached) yes
checking for gdImageCreateFromJpeg in -lgd... (cached) no
checking for gdImageCreateFromXpm in -lgd... (cached) yes
checking whether to include FreeType 1.x support... yes
checking for T1lib support... no
checking whether to include GNU gettext support... no


yes gd and freetype2 are installed....both in /usr/local/lib

~kurth





In article <9bho4e$r7p$[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("Plutarck") wrote:

> Also be extremely careful about the use of <noframes> and browser sniffing.
> So many sites do something classically stupid so that when someone sees
> their site in a search engine, the description is "Your browser does not
> support frames. Your browser must support frames to view this site."...I
> just want to slap the webmaster every time I see that.

I've been working on a mini-spider project that's been quite an eye-opener 
about another slap-worthy practice: an appalling number of splash pages 
consisting of nothing but a graphic (no alt tags, no title tag, no metas) 
and an "enter" link that must fetch its href from a javascript function.  
And these are sites that do want to be indexed!

-- 
CC




Google doesn't choke at all on dynamic pages. pages get ranked by
keywords appearing on the page and even more importantly, the link
text of links on other pages pointing to the page that's being
indexed.

in other words, if a lot of sites link to your page like so:
<a href="yourpage.com">google choke</a>

then a search for 'google choke' will put you at the top. save your
time trying to get rid of ?'s and &'s and concentrate on promoting
your site the normal way.

On Tue, 17 Apr 2001 17:47:43 +0000 (GMT), Philip Olson
([EMAIL PROTECTED]) wrote:
>Check out this article :
>
>  Building Dynamic Pages With Search Engines in Mind :
>  ----------------------------------------------------
>  http://phpbuilder.com/columns/tim20000526.php3
>
>Also, mod_rewrite related "stuff" has been discussed :
>
>  http://marc.theaimsgroup.com/?l=php-general&s=mod_rewrite
>
>regards,
>philip
>
>On Mon, 16 Apr 2001, Jon Shoberg wrote:
>
>>
>> So I was having a conversation with a manager/educator in the IT
>>Industry :)
>>
>> In a discussion concerning search engines he stated how he
>>dislikes dynamic
>> web pages (PHP/ASP/JSP/CFM) because search engine spiders 'choke'
>>on dynamic
>> content or gives those pages a lower ranking.  I can't see this as
>>being
>> true. I epically can't see the search spider "choking" on dynamic
>>pages
>> returning well-formed/valid HTML.
>>
>> Any thoughts?
>>
>>
>> --
>> 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: php-list-
>>[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: php-list-
>[EMAIL PROTECTED]






"Jon Shoberg" <[EMAIL PROTECTED]> wrote:
> So I was having a conversation with a manager/educator in the IT Industry
:)
>
> In a discussion concerning search engines he stated how he dislikes
dynamic
> web pages (PHP/ASP/JSP/CFM) because search engine spiders 'choke' on
dynamic
> content or gives those pages a lower ranking.

Some do, some don't.

> I can't see this as being true. I epically can't see the search spider
"choking" on dynamic pages
> returning well-formed/valid HTML.

Well, some search engines see URLs with query strings at the end and assume
the content is dynamic.  And because a lot of dynamic content changes,
indexing dynamic webpages can lead to search results listing webpages that
no longer have the content that they did when they were indexed.  As a
result, searches on the search engine will be less effective and users may
choose to use a different search engine.  Anyone with dynamically generated
content that remains pretty static that wants these pages to be indexed by
search engines should make the webpages appear to be static.  I wrote about
this in another thread a couple of weeks ago.  Here's the message:
http://marc.theaimsgroup.com/?l=php-general&m=98618455619989&w=2.  The sex
offender registries, news, books, sites, polls, etc. at one of the sites I
developed and administer are all dynamically generated using PHP and MySQL
and the site makes use of Apache's AliasMatch directive which allows me to
redirect most of the pages on the site to a single PHP file (I call it
template_1.php) which uses regular expressions to parse a page's URL and
include the proper content.  If you want to see it in action take a look at
http://www.sexcriminals.com/.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/







On 16-Apr-01 Alexander Skwar wrote:
> Hello!
> 
> In a mysql_connect() it is possible to specify a path to the socket which
> should be used for communicating with MySQL.
> 
> Now, when I connect thru a socket, is the datatransfer between PHP and MySQL
> faster than when I connect via a (loop-)network?  I would assume so, because
> with a socket, there's not the network layer in the way which has to be
> taken care of.
> 
> Is this correct?
> 

Yes, from my memory of the mysql list; AF_INET is 7% slower then AF_UNIX in
data thru-put. Plus you have to add in the connection build & tear-down time. 

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.




So sprach Don Read am Tue, Apr 17, 2001 at 02:14:41PM -0500:
> Yes, from my memory of the mysql list; AF_INET is 7% slower then AF_UNIX in
> data thru-put. Plus you have to add in the connection build & tear-down time. 

That's exactly what I'd expect.  Hmm, so I take it, I should also ask on the
MySQL list?

And, do you have any suggestions about how to benchmark this?

Thanks a lot,
Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 22 hours 21 minutes




So sprach Christian Reiniger am Tue, Apr 17, 2001 at 02:01:48PM +0200:
> run "ab" (comes with apache) on two scripts, one using method A 
> repeatedly, the other using method B repeatedly

Thanks, will do.

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 23 hours 6 minutes




So sprach Don Read am Tue, Apr 17, 2001 at 05:13:14PM -0500:
> define('DBHOST', 'localhost');
> // define('DBHOST', 'myhost.domain.com');
> 
> define('QRY', 'select * from foo');           
> 
>   $db=mysql_connect(DBHOST, DBUSER, DBPASS);
>   if ( $db ) 
>      testquery(QRY);
>   
> 
> ?>
> 
> set the define(s) to something sensible for your setup.
> 
> 'myhost.domain.com' would be your network hostname for the box, either in
> /etc/hosts or from your DNS server.
> 
> test the numbers using the 'localhost' (the AF_UNIX socket).
> comment/uncoment the 'myhost' line & re-test (AF_INET connect).

the first define, defines a connect using a AF_UNIX socket?  Are you sure? 
According to the manual, I'd have thought, that I'd need to do:

define('DBHOST', 'localhost:/tmp/mysql.sock' );

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 1 day 0 hours 33 minutes





On 17-Apr-01 Alexander Skwar wrote:
> So sprach Don Read am Tue, Apr 17, 2001 at 05:13:14PM -0500:
>> define('DBHOST', 'localhost');
>> // define('DBHOST', 'myhost.domain.com');
>> 

<snip>

>> 'myhost.domain.com' would be your network hostname for the box, either in
>> /etc/hosts or from your DNS server.
>> 
>> test the numbers using the 'localhost' (the AF_UNIX socket).
>> comment/uncoment the 'myhost' line & re-test (AF_INET connect).
> 
> the first define, defines a connect using a AF_UNIX socket?  Are you sure? 

I have with 3.0.18 installed (to match customers), 'localhost' will use the
/tmp/mysql.sock. This may have changed under 4.x.

> According to the manual, I'd have thought, that I'd need to do:
> 
> define('DBHOST', 'localhost:/tmp/mysql.sock' );
> 

try it, YMMV.

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.




So sprach Don Read am Tue, Apr 17, 2001 at 06:06:53PM -0500:
> I have with 3.0.18 installed (to match customers), 'localhost' will use the
> /tmp/mysql.sock. This may have changed under 4.x.

Oh, yes, you are right!  Thanks a lot - would have thought that I'd need to
say 'localhost:/tmp/mysql.sock', but, guess I'm wrong :)

Thanks,
Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 1 day 1 hour 25 minutes




On Tue, 17 Apr 2001 11:30:07 -0700, Colin Putney
([EMAIL PROTECTED]) wrote:
>On Tuesday, April 17, 2001, at 11:00  AM, Devin Atencio wrote:
>
>> I have a SQL Table that has over 1,000 records and I was wanting
>> to write a script that would find duplicate phone numbers and
>> then list the duplicate phone numbers. I have been trying to
>> think on how to do this but I can't think of a way. Can someone
>> please help me on some code I could write to do this?
>
>I think you want something like this (MySQL syntax, YMMV):
>
>SELECT phone_number, count(*) AS instances
>FROM my_table
>GROUP by phone_number
>HAVING instances >= 2
>ORDER BY instances DESC
>
>
>This give you a list of all duplicated phone numbers, the number of
>times they appear in the table, and sorts them with the most-
>duplicated
>numbers first.
>
>To list them, you just need to loop through the result set echoing
>the
>phone number.

That works for mysql. He probably just wants to kill the duplicates,
so there's an easier way: add a unique index to the phone_number
field.

alter ignore table $table add unique (phone_number);

- Mark






On Tuesday, April 17, 2001, at 12:19  PM, Mark Maggelet wrote:

> That works for mysql. He probably just wants to kill the duplicates,
> so there's an easier way: add a unique index to the phone_number
> field.
>
> alter ignore table $table add unique (phone_number);

Yep, that will prevent duplicate phone numbers from being inserted into 
the table.

Note that if there is existing data in the table, he'll have to remove 
the duplicates before making the phone_number field unique.

Cheers,

colin
-----------------------------------------------------------------
Colin Putney                    Whistler.com




On Tue, 17 Apr 2001 12:34:27 -0700, Colin Putney
([EMAIL PROTECTED]) wrote:
>On Tuesday, April 17, 2001, at 12:19  PM, Mark Maggelet wrote:
>
>> That works for mysql. He probably just wants to kill the
>>duplicates,
>> so there's an easier way: add a unique index to the phone_number
>> field.
>>
>> alter ignore table $table add unique (phone_number);
>
>Yep, that will prevent duplicate phone numbers from being inserted
>into
>the table.
>
>Note that if there is existing data in the table, he'll have to
>remove
>the duplicates before making the phone_number field unique.

That would be true if I left out the 'ignore'. The way it is here it
will automatically toss the duplicates.

- Mark






On Tuesday, April 17, 2001, at 12:41  PM, Mark Maggelet wrote:

> That would be true if I left out the 'ignore'. The way it is here it
> will automatically toss the duplicates.

Whoops, missed that. I stand corrected.

Colin
-----------------------------------------------------------------
Colin Putney                    Whistler.com




The following code downloads information on the fly and saves it as a file
on the user's hard drive.  It works great in Netscape downloads data
properly but in Internet explorer it doesn't work.

Here is the error I get any ideas?

IE was not able to open this site the site is either unavailable or cannot
be found.

BUT

if I right click and says "The file cannot be written to cache".   I even
commented out the following:

header("Pragma: no-cache");

But it still did not work.  Please help !!!

Thanks

Randy


include "db.inc";
header("Content-disposition: filename=backup.csv");
header("Content-type: application/octetstream");
header("Pragma: no-cache");
header("Expires: 0");


// doing some DOS-CRLF magic...
$client=getenv("HTTP_USER_AGENT");
if (ereg('[^(]*\((.*)\)[^)]*',$client,$regs)):
    $os = $regs[1];
    // this looks better under WinX
    if (eregi("Win",$os)):
      $crlf="\r\n";
    else:
      $crlf="\n";
    endif;                      /* OS = WIN */
endif;                  /* ereg $client */
####################
# DB STATEMENT HERE
#####################
   $link_id = db_connect($default_dbname);
   if(!$link_id) error_message(sql_error());

   $result = mysql_query($query)or print "error".mysql_error();
   if(!$result) error_message(sql_error());
 while($query_data = mysql_fetch_array($result)) {
     Variable definition/and assignment here

echo "var1,var2,var3,var4,var5,var6";
 echo $crlf;
  }





This is a wonderful IE "feature" - it just tries to open everything regardless
of the browser type. I'd be interested in any working workarounds for this.
I've even sent my own type headers ... all to no avail.

--Joe

On Mon, Apr 16, 2001 at 03:30:30PM -0700, Randy Johnson wrote:
> The following code downloads information on the fly and saves it as a file
> on the user's hard drive.  It works great in Netscape downloads data
> properly but in Internet explorer it doesn't work.
> 
> Here is the error I get any ideas?
> 
> IE was not able to open this site the site is either unavailable or cannot
> be found.
> 
> BUT
> 
> if I right click and says "The file cannot be written to cache".   I even
> commented out the following:
> 
> header("Pragma: no-cache");
> 
> But it still did not work.  Please help !!!
> 
> Thanks
> 
> Randy
> 
> 
> include "db.inc";
> header("Content-disposition: filename=backup.csv");
> header("Content-type: application/octetstream");
> header("Pragma: no-cache");
> header("Expires: 0");
> 
> 
> // doing some DOS-CRLF magic...
> $client=getenv("HTTP_USER_AGENT");
> if (ereg('[^(]*\((.*)\)[^)]*',$client,$regs)):
>     $os = $regs[1];
>     // this looks better under WinX
>     if (eregi("Win",$os)):
>       $crlf="\r\n";
>     else:
>       $crlf="\n";
>     endif;                    /* OS = WIN */
> endif;                        /* ereg $client */
> ####################
> # DB STATEMENT HERE
> #####################
>    $link_id = db_connect($default_dbname);
>    if(!$link_id) error_message(sql_error());
> 
>    $result = mysql_query($query)or print "error".mysql_error();
>    if(!$result) error_message(sql_error());
>  while($query_data = mysql_fetch_array($result)) {
>      Variable definition/and assignment here
> 
> echo "var1,var2,var3,var4,var5,var6";
>  echo $crlf;
>   }
> 
> 
> -- 
> 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]


/* Joe Stump
 * Sr. PHP Developer 
 * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net
 */





Instead of:
header("Content-disposition: filename=backup.csv");
try
header('Content-Disposition: attachment; filename=backup.csv');

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






Nope This doesn't work either.   I am going to find header documentation and
see if I can find a work around

-----Original Message-----
From: Phil Driscoll [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 12:48 PM
To: Randy Johnson; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] temp file help


Instead of:
header("Content-disposition: filename=backup.csv");
try
header('Content-Disposition: attachment; filename=backup.csv');

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



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






Greetings.

Thanks for your help! That about people not using logout buttons is really
true! But what can one expect? However, how can I create a unique session
ID? I don't use Databases, at least not MYSQL.

- Richard

""Plutarck"" <[EMAIL PROTECTED]> wrote in message
9bhsa8$vq8$[EMAIL PROTECTED]">news:9bhsa8$vq8$[EMAIL PROTECTED]...
> Simplest way to do it IMHO.
>
> When a user logs in (starts their session) register their username into
the
> session (that session is "bound" to them now).
>
> On every page when a user does anything, update your database with the
> current time as a "last_activity" entry for that user.
>
> When showing who is currently logged in, get all the entries out and check
> their dates. If the last activity is older than a certain amount of
> acceptable time (how long it takes them to be considered "logged out".
note:
> people rarely use a logout button), then consider that user as not being
> logged in.
>
> Delete the entry so your "who's online" function doesn't hugely slow down
> the page, and you should be good to go.
>
>
> The only problem is that you have to do an update every time someone
visits
> a page, which increases your server load. But to avoid any noticable slow
> down you could just use a register_shutdown_function.
>
> I think that should handle your problem...
>
>
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
>
>
> ""Richard"" <[EMAIL PROTECTED]> wrote in message
> 9bfv6n$pds$[EMAIL PROTECTED]">news:9bfv6n$pds$[EMAIL PROTECTED]...
> > Greetings.
> >
> >     Some of you are familiar with my latest project, a smaller
community.
> I
> > have implemented almost everything I need, and I wish to thank those of
> you
> > who helped me with "which mail is new" and so forth. However, this
problem
> > is quite worse I suppose, but I hope some of you has done something like
> > this before:
> >
> >     Sessions.
> >
> > I wish to keep track of every visitor. Not a counter or anything, but
more
> > of when a person signs in, the users nickname will be bound to this
> session
> > ID which will keep track of the person is online or offline. I have
solved
> > it like so:
> >
> >     Whenever a person loggs in, I add it's name to a online.dat file.
When
> > the user signs of, I remove the nickname thus the login time from the
> file.
> >
> > PROBLEMS?? First one: User must click on "logout" to remove itself.
> Second:
> > It does not always remove itself.
> >
> > Therefore, I ask: How can I create a new session for every visitor (so I
> > know how many are online at the time), bind this ID to its nickname (so
> one
> > row in a file would be: NICKNAME|SESSION_ID|DATE), and how can I make
sure
> > that whenever the browser is closed or whatever, or after a certain time
> of
> > inactivity (3 minutes), the user is removed from the file.
> >
> > All help is greatly appriciated and your name will be on the credits
list
> > too.
> >
> > - Richard
> >
> >
> >
> > --
> > 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]
>






The best way I know of is to use mt_rand. Check the manual for examples, but
this is usually a good way to seed it:

mt_srand ((double) microtime() * 1000000);


If you look at the size of a normal session ID, it's pretty easy to make a
unique sessid.

There are 32 chars in a typical sessid. The chances of someone getting the
same ID as someone else, all things being equal and even though it's
case-insensitive, is approximately 1 in
6.3340286662973277706162286946812e+49...actually, my windows calculator
doesn't go that high.

It's 32 to the 36th power, anyway. That's insanely huge.

But in reality, you don't really need to worry about getting two 32
character long IDs that are the same.


Note: one way to auto-logout someone is to use something like a on_unload
javascript procedure, but don't bother. Not worth the hassle and it's isn't
fool-proof.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Richard"" <[EMAIL PROTECTED]> wrote in message
9bi64f$goj$[EMAIL PROTECTED]">news:9bi64f$goj$[EMAIL PROTECTED]...
> Greetings.
>
> Thanks for your help! That about people not using logout buttons is really
> true! But what can one expect? However, how can I create a unique session
> ID? I don't use Databases, at least not MYSQL.
>
> - Richard
>
> ""Plutarck"" <[EMAIL PROTECTED]> wrote in message
> 9bhsa8$vq8$[EMAIL PROTECTED]">news:9bhsa8$vq8$[EMAIL PROTECTED]...
> > Simplest way to do it IMHO.
> >
> > When a user logs in (starts their session) register their username into
> the
> > session (that session is "bound" to them now).
> >
> > On every page when a user does anything, update your database with the
> > current time as a "last_activity" entry for that user.
> >
> > When showing who is currently logged in, get all the entries out and
check
> > their dates. If the last activity is older than a certain amount of
> > acceptable time (how long it takes them to be considered "logged out".
> note:
> > people rarely use a logout button), then consider that user as not being
> > logged in.
> >
> > Delete the entry so your "who's online" function doesn't hugely slow
down
> > the page, and you should be good to go.
> >
> >
> > The only problem is that you have to do an update every time someone
> visits
> > a page, which increases your server load. But to avoid any noticable
slow
> > down you could just use a register_shutdown_function.
> >
> > I think that should handle your problem...
> >
> >
> > --
> > Plutarck
> > Should be working on something...
> > ...but forgot what it was.
> >
> >
> > ""Richard"" <[EMAIL PROTECTED]> wrote in message
> > 9bfv6n$pds$[EMAIL PROTECTED]">news:9bfv6n$pds$[EMAIL PROTECTED]...
> > > Greetings.
> > >
> > >     Some of you are familiar with my latest project, a smaller
> community.
> > I
> > > have implemented almost everything I need, and I wish to thank those
of
> > you
> > > who helped me with "which mail is new" and so forth. However, this
> problem
> > > is quite worse I suppose, but I hope some of you has done something
like
> > > this before:
> > >
> > >     Sessions.
> > >
> > > I wish to keep track of every visitor. Not a counter or anything, but
> more
> > > of when a person signs in, the users nickname will be bound to this
> > session
> > > ID which will keep track of the person is online or offline. I have
> solved
> > > it like so:
> > >
> > >     Whenever a person loggs in, I add it's name to a online.dat file.
> When
> > > the user signs of, I remove the nickname thus the login time from the
> > file.
> > >
> > > PROBLEMS?? First one: User must click on "logout" to remove itself.
> > Second:
> > > It does not always remove itself.
> > >
> > > Therefore, I ask: How can I create a new session for every visitor (so
I
> > > know how many are online at the time), bind this ID to its nickname
(so
> > one
> > > row in a file would be: NICKNAME|SESSION_ID|DATE), and how can I make
> sure
> > > that whenever the browser is closed or whatever, or after a certain
time
> > of
> > > inactivity (3 minutes), the user is removed from the file.
> > >
> > > All help is greatly appriciated and your name will be on the credits
> list
> > > too.
> > >
> > > - Richard
> > >
> > >
> > >
> > > --
> > > 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]
>






Does anyone have or have some code available that allows a user to edit an
HTML web page file over the Internet. I know it would be simple to build a
textarea form and read the file into this and edit as necessary them update
the file. But I am looking for something with some controls on it, like only
reading the HTML between two font tags lets say. This way a user editing the
file would not get themselves into trouble by accidentally deleting a table
tags for instance.

Thanks Everyone
Blake S.






Hi

Has anyone done this?
Does PHP interact with the SMTP service on the machine?
Does anyone have a script that does this?

thanks

Sincerely

      berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.
 




Check out the mail() function in the php manual. There is literally tons of
info on this function.
----- Original Message -----
From: "Boaz Yahav" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 17, 2001 4:54 PM
Subject: [PHP] Sending Email via PHP on Win2K


> Hi
>
> Has anyone done this?
> Does PHP interact with the SMTP service on the machine?
> Does anyone have a script that does this?
>
> thanks
>
> Sincerely
>
>       berber
>
> Visit http://www.weberdev.com Today!!!
> To see where PHP might take you tomorrow.
>
>
> --
> 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]
>
>





does anyone have any tutorials on installing gd with freetype 2 support?

~kurth







Plutarck wrote:

> PHP can be a tad screwy with how it handles multi-dimensional arrays, but
> yes PHP handles them. No real speed problems with them either.
>
> But you may just want to use an associative array like:
>
> $loc = array("y" => $y, "x" => $x);
>
> Then just use $loc["y"] and $loc["x"].
>
> Just another option, but feel free to use multi-dimensional arrays. Just be
> aware that PHP supports only two dimensions (so $array[][][] will not work),
> and if you try and get fancy with sort() and count() you are going to give
> yourself a migraine.

$a[1][2][3][4][5] = "6";
echo $a[1][2][3][4][5];

$b[][][][]= "7";
echo $b[0][0][0][0];

I get '6' and '7'.  Am I doing something wrong?  This seems like PHP supports
arrays with
dimensions greater than 2.





> $a[1][2][3][4][5] = "6";
> echo $a[1][2][3][4][5];
> 
> $b[][][][]= "7";
> echo $b[0][0][0][0];
> 
> I get '6' and '7'.  Am I doing something wrong?  This seems like PHP supports
> arrays with
> dimensions greater than 2.

You just need to look at PHP's structure. It makes total sense when you think
about it. You can through arrays into cells in an array without any troubles.
I've had arrays go 4 and 5 deep before just because there was an array I needed
to put in a cell that related to that set of data.

It's not wrong and I regard it as a feature.

--Joe


/* Joe Stump
 * Sr. PHP Developer 
 * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net
 */





I am using the latest version of Apache and PHP. Sorry I couldn't be of more
help.
----- Original Message -----
From: "CC Zona" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 17, 2001 3:01 AM
Subject: Re: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1,
Apache/1.3.14


> In article <012101c0c69b$b01b8d00$8b1412d1@null>,
>  [EMAIL PROTECTED] ("Chris Anderson") wrote:
>
> > I tried it, even with the byte length identifer it worked perfectly for
me.
> > As a last ditch effort try changing the w to w+. If not then it sounds
like
> > a configuration issue for the webserver or php. Dunno what settings
though,
> > sorry couldn't be of more help.
>
> Thanks for testing.  Was that with v4.0.4pl?  I'd sure like to know
whether
> there's any possbility it's bug.  Seems unlikely, but then again so does
> the stubborness of frwite() in choosing its own content to write in place
> of mine.  I've pored over phpinfo and php.ini trying to find a config
> setting that might be causing this weirdness, but so far nothing seems
> obvious.
>
> --
> CC
>
> --
> 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,

Thanks to all who helped me getting OCI compiled.

I've started doing some stress testing and overall, I'm pleased with the results.  I 
suppose that it would be nice to have connection pooling ala-ProC, but I hear that's 
on it's way.

So I'm starting up apache with like 120 servers.  I hit them with 120 simultaneous 
requests to a simple PHP script that opens up a persistent connection and runs a token 
query.  netstat -n shows that the connections are indeed persistent.  Next time I hit 
them with the requests, they come back FAST -- I mean like 25+ pages per second (and 
lemme tell you -- the hardware is OLD).  But the database is hammerred with 99% usage 
while PHP/apache is sleeping with 15% usage, tops.  On the other hand, apache doesn't 
have to be serving up images like it normally would.  There is a memory limitation on 
the DB so I can't open too many persistent connections, particularly if I'm not even 
using them.

Here's what I was wondering:  As we all know, on your averge HTML page, you might have 
10-15 images that gotta get served up with the HTML.  It seems to me that my 
persistent connections are worth their weight in gold while the images on the page are 
cheap.  It's occurred to me that I probably don't want to use the same instance of 
httpd for the two:  when apache gets hit, it'll only use the persistent connection 
once and 15 other apache processes that are holding those connections are wasted since 
they're not using those connections.

How would you approach that problem?

My first instinct is to run a second apache process on a separate port or on another 
IP, that would be tuned for flatfiles.  It'd mean that I'd have to code all my scripts 
to tell it to look for www.somewhere.com:88/banner.gif, which is fine since this is a 
new architecture. 

There are other OS approaches, like Linux khttpd (i dunno - is it ready for 
production?) and Squid.

Any thoughts?

Dave Thomas
Chief Software Architect
BCD Enterprises, Inc.





> My first instinct is to run a second apache process on a separate port or
on another IP, that would be tuned for flatfiles.  It'd mean that I'd have
to code all my scripts to tell it to look for
www.somewhere.com:88/banner.gif, which is fine since this is a new
architecture.

Yes, if you have images, put them on a separate image server with a tuned
http server that is just optimized for returning material quickly  -- you
could experiment around with various web server solutions to find the
fastest server out there. Or then put the image server on the same HW and a
separate port, as you mentioned, that way you get threading
happening. --Kent







Yeah, that's what I'm thinking.  I could tune the images server way down for flat 
content and massive bandwith.  

The only problem I can see is that webmasters hate having to code that extra info.  

Dave





I've got the following code:

-----------

        while( list( $timeStamp, $elementArray ) = each(
$this->ErrorMessages )) {
          $tmpArray = $elementArray;

          if( $tmpArray[errorNumber] & $typesToDisplay ) {  // line to
comment out

            while( list( $elementKey, $elementValue ) = each( $elementArray
)) {
              if(( $elementKey == "contextvars" ) && ( $includeContextVars
)) {
                $retval .= "$elementKey: $elementValue\n";
                
              } elseif( $elementKey != "contextvars" ) {
                $retval .= "$elementKey: $elementValue\n";
                
              }
            }

          }  // Line to comment out

        }

----------

If I comment out the specified lines, the loops work perfectly
as they should.  It iterates only as many times are there are
elements in each of the associative arrays.  However, when
I uncomment out the specified lines, it creates an infinite loop.
Why?

Chris




Ok, I found out what the problem was.  I'm still curious
why the problem is occuring.

> if( $tmpArray[errorNumber] & $typesToDisplay ) {  // line to comment out

I almost always access associative arrays like the above -
almost never without the quotes.  IE

$there = 5;

echo "$this[that]<br>\n";
echo "$joe[bob]<br>\n";
echo "$here[$there]<br>\n";

etc.

And so when I tried to access that element in $tmpArray, I
did so w/o using the double quotes.  As soon as I added the
double quotes, however ($tmpArray["errorNumber"]) the
problem corrected itself.  The arrays iterated through as they
should have (and did when the line was commented out).

Why would using the double quotes in this situation have
fixed the problem with the infinite loop?

Chris




On Tue, 17 Apr 2001 15:55:38 -0500, Boget, Chris
([EMAIL PROTECTED]) wrote:
>Ok, I found out what the problem was.  I'm still curious
>why the problem is occuring.
>
>> if( $tmpArray[errorNumber] & $typesToDisplay ) {  // line to
>>comment out

you're using the bitwise & when you want the logical &&





> >Ok, I found out what the problem was.  I'm still curious
> >why the problem is occuring.
> >> if( $tmpArray[errorNumber] & $typesToDisplay ) {  
> you're using the bitwise & when you want the logical &&

No, I actually wanted to use the bitwise &.  I wanted to see
if the "errorNumber" was in $typesToDisplay.

Chris




On Tue, 17 Apr 2001 16:06:47 -0500, Boget, Chris
([EMAIL PROTECTED]) wrote:
>> >Ok, I found out what the problem was.  I'm still curious
>> >why the problem is occuring.
>> >> if( $tmpArray[errorNumber] & $typesToDisplay ) {
>> you're using the bitwise & when you want the logical &&
>
>No, I actually wanted to use the bitwise &.  I wanted to see
>if the "errorNumber" was in $typesToDisplay.

without seeing the code I would guess you should be using in_array().





Some time ago, if I remember correctly, this question
was asked.  Rasmus replied that the interpreter, due to
its mechanization, would interpret "raw" strings as
strings in associative arrays but that THIS BEHAVIOUR
WAS NOT GUARANTEED IN THE FUTURE.  It had something
to do with the symbol table mechanization.

One has to admit that "raw" strings are, per se,
illegal in the PHP language definition.

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

"Boget, Chris" wrote:
> 
> Ok, I found out what the problem was.  I'm still curious
> why the problem is occuring.
> 
> > if( $tmpArray[errorNumber] & $typesToDisplay ) {  // line to comment out
> 
> I almost always access associative arrays like the above -
> almost never without the quotes.  IE
> 
> $there = 5;
> 
> echo "$this[that]<br>\n";
> echo "$joe[bob]<br>\n";
> echo "$here[$there]<br>\n";
> 
> etc.
> 
> And so when I tried to access that element in $tmpArray, I
> did so w/o using the double quotes.  As soon as I added the
> double quotes, however ($tmpArray["errorNumber"]) the
> problem corrected itself.  The arrays iterated through as they
> should have (and did when the line was commented out).
> 
> Why would using the double quotes in this situation have
> fixed the problem with the infinite loop?
> 
> Chris

-- 
Justin Farnsworth
Eye Integrated Communications
321 South Evans - Suite 203
Greenville, NC 27858 | Tel: (252) 353-0722




Hi Guys,

If I wanted to retrieve just one field randomly from a MySQL table, would I
just use something like:

"SELECT RAND(id) FROM table .... LIMIT 0,1" ?

I suppose the best thing for me to do would be to try it, but I am fast
losing the will to stay awake ;)

Thanks, as always,

James.






Sup,
    In the newer versions of mySQL, you can get random results like

SELECT id FROM table ORDER BY rand() LIMIT 0,1

SL.



----- Original Message -----
From: "James, Yz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 17, 2001 2:55 PM
Subject: [PHP] SQL - Select rand() ?


> Hi Guys,
>
> If I wanted to retrieve just one field randomly from a MySQL table, would
I
> just use something like:
>
> "SELECT RAND(id) FROM table .... LIMIT 0,1" ?
>
> I suppose the best thing for me to do would be to try it, but I am fast
> losing the will to stay awake ;)
>
> Thanks, as always,
>
> 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]
>





I have compiled and installed freetype 2.0.1 and gd 1.8.1......the php 
configure script finds the libs ok....however gd still isn't compiled with 
true type font support....someone MUST have a solution for what i'm dealing 
with here....look :

checking whether to enable FTP support... yes
checking whether to enable truetype string function in gd... no
checking for libjpeg (needed by gd-1.8+)... yes
checking for jpeg_read_header in -ljpeg... yes
checking for libXpm (needed by gd-1.8+)... no
configure: warning: If configure fails try --with-xpm-dir=<DIR>
checking whether to include GD support... yes (static)
checking for gdImageString16 in -lgd... (cached) yes
checking for gdImagePaletteCopy in -lgd... (cached) yes
checking for gdImageColorClosestHWB in -lgd... (cached) yes
checking for compress in -lz... (cached) yes
checking for png_info_init in -lpng... (cached) yes
checking for gdImageColorResolve in -lgd... (cached) yes
checking for gdImageCreateFromPng in -lgd... (cached) yes
checking for gdImageCreateFromGif in -lgd... (cached) no
checking for gdImageWBMP in -lgd... (cached) yes
checking for gdImageCreateFromJpeg in -lgd... (cached) no
checking for gdImageCreateFromXpm in -lgd... (cached) yes
checking whether to include FreeType 1.x support... no
checking for T1lib support... no





Hey,

First I'll ask my OT question. I've been thinking lately of implementing a
system on my band's website where people can log in, and maintain a playlist
of all the mp3's I have on the site. Obviously when they want to play it, or
a single file, they can hit play and the m3u file will automatically
download to whatever mp3 player their using. If you used winamp, you
probably know the idea I'm getting at. Anyways...I'm confused on one part.

this is what the m3u file looks like:
#EXTM3U
#EXTINF:183,Greyboy Allstars - Jack Rabbit
\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Jack Rabbit.mp3
#EXTINF:96,Greyboy Allstars - Let the music take your mind
\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Let the music take your
mind.mp3
#EXTINF:184,Greyboy Allstars - Soul Dream
\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Soul Dream.mp3
#EXTINF:105,Greyboy Allstars - Fried grease
\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Fried grease.mp3
#EXTINF:119,Greyboy Allstars Who's Gonna Be The Junkie
\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars Who's Gonna Be The Junkie.mp3
#EXTINF:117,Greyboy Allstars - Gravee
\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Gravee.mp3

I understand all of this except for those numbers after the #EXTINF. Does
anyone know what they mean?

my php question is, what functions might I use to do something like this.
I've been checking out some code, and I've seen things like people using
buffers and http functions to get the whole thing working. Any ideas?

--Chris





At 04:43 PM 4/17/2001, Chris Cocuzzo wrote:

as far as I know the EXTINF is just data that win amp puts in play 
lists.  its just the number of frames i believe then teh song title.  this 
allows winamps play list editor to read the data for the files in the play 
list without opening them all...on a large (450) or so that can take a long 
time....

hope this helps..

~kurth

>Hey,
>
>First I'll ask my OT question. I've been thinking lately of implementing a
>system on my band's website where people can log in, and maintain a playlist
>of all the mp3's I have on the site. Obviously when they want to play it, or
>a single file, they can hit play and the m3u file will automatically
>download to whatever mp3 player their using. If you used winamp, you
>probably know the idea I'm getting at. Anyways...I'm confused on one part.
>
>this is what the m3u file looks like:
>#EXTM3U
>#EXTINF:183,Greyboy Allstars - Jack Rabbit
>\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Jack Rabbit.mp3
>#EXTINF:96,Greyboy Allstars - Let the music take your mind
>\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Let the music take your
>mind.mp3
>#EXTINF:184,Greyboy Allstars - Soul Dream
>\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Soul Dream.mp3
>#EXTINF:105,Greyboy Allstars - Fried grease
>\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Fried grease.mp3
>#EXTINF:119,Greyboy Allstars Who's Gonna Be The Junkie
>\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars Who's Gonna Be The Junkie.mp3
>#EXTINF:117,Greyboy Allstars - Gravee
>\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Gravee.mp3
>
>I understand all of this except for those numbers after the #EXTINF. Does
>anyone know what they mean?
>
>my php question is, what functions might I use to do something like this.
>I've been checking out some code, and I've seen things like people using
>buffers and http functions to get the whole thing working. Any ideas?
>
>--Chris
>
>
>--
>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]





Ok that makes sense definitely. I guess I wonder. How would I code something
so I could find out the number of frames in a particular mp3 so I could
generate the m3u file? I've seen a lot of this stuff implemented in PERL,
however I'm not familiar with PERL that much, so it wouldn't matter.
PHP-wise, any ideas on how to find that number of frames?

--chris


-----Original Message-----
From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 4:54 PM
To: [EMAIL PROTECTED]; PHP General List (E-mail)
Subject: Re: [PHP] PHP/M3U Questions!!!


At 04:43 PM 4/17/2001, Chris Cocuzzo wrote:

as far as I know the EXTINF is just data that win amp puts in play
lists.  its just the number of frames i believe then teh song title.  this
allows winamps play list editor to read the data for the files in the play
list without opening them all...on a large (450) or so that can take a long
time....

hope this helps..

~kurth

>Hey,
>
>First I'll ask my OT question. I've been thinking lately of implementing a
>system on my band's website where people can log in, and maintain a
playlist
>of all the mp3's I have on the site. Obviously when they want to play it,
or
>a single file, they can hit play and the m3u file will automatically
>download to whatever mp3 player their using. If you used winamp, you
>probably know the idea I'm getting at. Anyways...I'm confused on one part.
>
>this is what the m3u file looks like:
>#EXTM3U
>#EXTINF:183,Greyboy Allstars - Jack Rabbit
>\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Jack Rabbit.mp3
>#EXTINF:96,Greyboy Allstars - Let the music take your mind
>\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Let the music take your
>mind.mp3
>#EXTINF:184,Greyboy Allstars - Soul Dream
>\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Soul Dream.mp3
>#EXTINF:105,Greyboy Allstars - Fried grease
>\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Fried grease.mp3
>#EXTINF:119,Greyboy Allstars Who's Gonna Be The Junkie
>\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars Who's Gonna Be The Junkie.mp3
>#EXTINF:117,Greyboy Allstars - Gravee
>\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Gravee.mp3
>
>I understand all of this except for those numbers after the #EXTINF. Does
>anyone know what they mean?
>
>my php question is, what functions might I use to do something like this.
>I've been checking out some code, and I've seen things like people using
>buffers and http functions to get the whole thing working. Any ideas?
>
>--Chris
>
>
>--
>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]





At 05:12 PM 4/17/2001, Chris Cocuzzo wrote:

theres a formula for figuring out how many frames based on file size and 
time....however if your making a playlist with 20 or so entries the 
EXTINF's aren't really nessary

~kurth

>Ok that makes sense definitely. I guess I wonder. How would I code something
>so I could find out the number of frames in a particular mp3 so I could
>generate the m3u file? I've seen a lot of this stuff implemented in PERL,
>however I'm not familiar with PERL that much, so it wouldn't matter.
>PHP-wise, any ideas on how to find that number of frames?
>
>--chris
>
>
>-----Original Message-----
>From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, April 17, 2001 4:54 PM
>To: [EMAIL PROTECTED]; PHP General List (E-mail)
>Subject: Re: [PHP] PHP/M3U Questions!!!
>
>
>At 04:43 PM 4/17/2001, Chris Cocuzzo wrote:
>
>as far as I know the EXTINF is just data that win amp puts in play
>lists.  its just the number of frames i believe then teh song title.  this
>allows winamps play list editor to read the data for the files in the play
>list without opening them all...on a large (450) or so that can take a long
>time....
>
>hope this helps..
>
>~kurth
>
> >Hey,
> >
> >First I'll ask my OT question. I've been thinking lately of implementing a
> >system on my band's website where people can log in, and maintain a
>playlist
> >of all the mp3's I have on the site. Obviously when they want to play it,
>or
> >a single file, they can hit play and the m3u file will automatically
> >download to whatever mp3 player their using. If you used winamp, you
> >probably know the idea I'm getting at. Anyways...I'm confused on one part.
> >
> >this is what the m3u file looks like:
> >#EXTM3U
> >#EXTINF:183,Greyboy Allstars - Jack Rabbit
> >\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Jack Rabbit.mp3
> >#EXTINF:96,Greyboy Allstars - Let the music take your mind
> >\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Let the music take your
> >mind.mp3
> >#EXTINF:184,Greyboy Allstars - Soul Dream
> >\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Soul Dream.mp3
> >#EXTINF:105,Greyboy Allstars - Fried grease
> >\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Fried grease.mp3
> >#EXTINF:119,Greyboy Allstars Who's Gonna Be The Junkie
> >\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars Who's Gonna Be The Junkie.mp3
> >#EXTINF:117,Greyboy Allstars - Gravee
> >\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Gravee.mp3
> >
> >I understand all of this except for those numbers after the #EXTINF. Does
> >anyone know what they mean?
> >
> >my php question is, what functions might I use to do something like this.
> >I've been checking out some code, and I've seen things like people using
> >buffers and http functions to get the whole thing working. Any ideas?
> >
> >--Chris
> >
> >
> >--
> >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]





nevermind!

I'm all set I believe. I took a look at an m3u file in notepad that had
stream files(as in I told it to play a URL). Apparently the number after the
#EXTINF is always -1 for a streamed file. So thanks for all the help.

--Chris


-----Original Message-----
From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 5:21 PM
To: [EMAIL PROTECTED]; PHP General List (E-mail)
Subject: RE: [PHP] PHP/M3U Questions!!!


At 05:12 PM 4/17/2001, Chris Cocuzzo wrote:

theres a formula for figuring out how many frames based on file size and
time....however if your making a playlist with 20 or so entries the
EXTINF's aren't really nessary

~kurth

>Ok that makes sense definitely. I guess I wonder. How would I code
something
>so I could find out the number of frames in a particular mp3 so I could
>generate the m3u file? I've seen a lot of this stuff implemented in PERL,
>however I'm not familiar with PERL that much, so it wouldn't matter.
>PHP-wise, any ideas on how to find that number of frames?
>
>--chris
>
>
>-----Original Message-----
>From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, April 17, 2001 4:54 PM
>To: [EMAIL PROTECTED]; PHP General List (E-mail)
>Subject: Re: [PHP] PHP/M3U Questions!!!
>
>
>At 04:43 PM 4/17/2001, Chris Cocuzzo wrote:
>
>as far as I know the EXTINF is just data that win amp puts in play
>lists.  its just the number of frames i believe then teh song title.  this
>allows winamps play list editor to read the data for the files in the play
>list without opening them all...on a large (450) or so that can take a long
>time....
>
>hope this helps..
>
>~kurth
>
> >Hey,
> >
> >First I'll ask my OT question. I've been thinking lately of implementing
a
> >system on my band's website where people can log in, and maintain a
>playlist
> >of all the mp3's I have on the site. Obviously when they want to play it,
>or
> >a single file, they can hit play and the m3u file will automatically
> >download to whatever mp3 player their using. If you used winamp, you
> >probably know the idea I'm getting at. Anyways...I'm confused on one
part.
> >
> >this is what the m3u file looks like:
> >#EXTM3U
> >#EXTINF:183,Greyboy Allstars - Jack Rabbit
> >\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Jack Rabbit.mp3
> >#EXTINF:96,Greyboy Allstars - Let the music take your mind
> >\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Let the music take your
> >mind.mp3
> >#EXTINF:184,Greyboy Allstars - Soul Dream
> >\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Soul Dream.mp3
> >#EXTINF:105,Greyboy Allstars - Fried grease
> >\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Fried grease.mp3
> >#EXTINF:119,Greyboy Allstars Who's Gonna Be The Junkie
> >\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars Who's Gonna Be The
Junkie.mp3
> >#EXTINF:117,Greyboy Allstars - Gravee
> >\\Cocuzzo2\cocuzzo dr d\nap\Greyboy Allstars - Gravee.mp3
> >
> >I understand all of this except for those numbers after the #EXTINF. Does
> >anyone know what they mean?
> >
> >my php question is, what functions might I use to do something like this.
> >I've been checking out some code, and I've seen things like people using
> >buffers and http functions to get the whole thing working. Any ideas?
> >
> >--Chris
> >
> >
> >--
> >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]





How do I establish an SSL socket connection with PHP?
I have PHP compiled in an Apache Mod_SSL server. Do I need to compile PHP
with
some sort of open_ssl option? I have --enable-sockets in the command line.
Please help!!!

-dave












On Mar 17 Abr 2001 23:55, phpman wrote:
> How do I establish an SSL socket connection with PHP?
> I have PHP compiled in an Apache Mod_SSL server. Do I need to compile PHP
> with
> some sort of open_ssl option? I have --enable-sockets in the command line.
> Please help!!!

No, No, No!!!!!

Saludos... :-)

-- 
El mejor sistema operativo es aquel que te da de comer.
Cuida tu dieta.
-----------------------------------------------------------------
Martin Marques                  |        [EMAIL PROTECTED]
Programador, Administrador      |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------




This is not hard just long. I am working on just that now. I am building a
site that allows my users to edit their  site via the web and not requiring
them to know HTML. What I am doing is using a template page and I am asking
them for specific data for the various sections of the page, I then have
options like inserting a pic and stuff like that. Mind you it is not all
that hard but it is dam long to as I requires me to take just about any and
all possible situations into consideration so I have to be very careful when
building my php pages to handle that. Pluse taking into account almost every
tag and its attributes is hard but I am doing it via a database so once in I
don't have to worry about referencing it again.

Good luck thought with yours.

What I think you have to keep in mind is what you want them to be able to
do, I mean if they are going to develop a good html page from your site then
hey, given them a link to macromedia dreamweaver and let them do that there
and let them upload the page to the directory. You will not be able to do on
the web what these professional web design tools allow you to at your
computer (at least not a easily ). If you can think of the options that you
would like them to be able to do and then develop solutions for that then
you will find that you are in a much better position to deliver what you
want. and then you can always add to that cause you will have the database
there with all the building blocks ( build now so that you can add easily
later)

Good luck








Hi,

I am also working on a project similar like this. I am creating a News 
Module which will allow user to create their own pages and post it on web 
with images chosen. Edit option also will be given to edit the content.

I thought of following options. Please note that I am not always sticking 
to database option.

1. Display templates (may be according to Theme / Layout) to select and 
display the form to fill up the content (database option can be 
implemented). For non IT user this will be the simplest form and some sort 
of customization  is also possible by giving options like to choose color, 
bold, style etc.

2.Give option something similar to  Yahoo's Geocities. (please go to 
http://geocities.yahoo.com - you may need to register). They have developed 
something like PageBuilder, which is nothing but the applet I believe. 
Where complete customize page can be created and loaded on the web. 
Database option will be tedious.

3. OR as you said user can have his own page but then he has to mark it for 
' edit content' purpose. If the user is using Dreamweaver then you do not 
worry, it has a option like ' Create template' option and user can mark the 
area as 'Editable'.


I am also interested in exploring more about it specially option 2, How to 
do it and whether it will be very complicated ?

If you know any good portal which has something like Yahoo! Page Builder, 
please let me know.

manisha





At 11:44 AM 4/17/01 -0400, Romulo Roberto Pereira wrote:
>dear Plutark,
>
>Thank you for your input.
>
>But, let's say that I have the following:
>
><span class="textdisplayplain">
>  some text some text some text some text some text some text some text some
>text
>  some text some text some text some text some text some text some text some
>text
>  some text some text <b>some text</b> some text some text some text some
>text
>  some text some text some text some text some text some text some text some
>text
></span>
><br><br>
><span class="textdisplayplain">
>  some text some text some text some text some text some text some text some
>text
>  some text some text some text some text some text some text some text some
>text
>  some text some text <b>some text</b> some text some text some text some
>text
>  some text some text some text some text some text some text some text some
>text
></span>
>
>My user don't know html. At all... So how do I do to create an edit admin
>that let him only modify the text?
>
>I did something like this:
>
><span class="textdisplayplain">
><!-- text entry start -->
>  some text some text some text some text some text some text some text some
>text
>  some text some text some text some text some text some text some text some
>text
>  some text some text <b>some text</b> some text some text some text some
>text
>  some text some text some text some text some text some text some text some
>text
><!-- text entry end -->
></span>
><br><br>
><span class="textdisplayplain">
><!-- text entry start -->
>  some text some text some text some text some text some text some text some
>text
>  some text some text some text some text some text some text some text some
>text
>  some text some text <b>some text</b> some text some text some text some
>text
>  some text some text some text some text some text some text some text some
>text
><!-- text entry end -->
></span>
>
>It works fine, because I identify the edit areas by the comment tags.
>The problem with this is that if I put an option like Add New Page to the
>admin system, the user would have to surround the tags with the comments, I
>mean, he would have to edit the HTML.
>
>Pretty toff thing!!!
>
>Jesus!!
>
>Thank you,
>
>Rom
>
>-----Original Message-----
>From: Plutarck [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, April 17, 2001 10:25 AM
>To: [EMAIL PROTECTED]
>Subject: Re: [PHP] Dynamic built web pages administration
>
>
>If you are storing the content in a database, your job is a ton easier.
>
>Just add an edit link on the page you want people to be able to edit. It
>will link over to an edit page with the value of the current page sent in
>the URL via get.
>
>Get the content from the database pointed to by the url, and stick it in a
>variable.
>
>On the edit page have a text area. Set the "value" to the content the person
>can edit.
>
>When someone clicks submit, just take the content they submit and stuff it
>into the database using UPDATE.
>
>Of course you will need to do safety features like stripslashes() or the
>special character functions before storing the data, just to be safe. You
>will also want to have the option only available for registered users, and
>you probably want to limit it to users you know won't be malicious.
>
>There are many little tricks like using a little piece of javascript to
>execute a file on the hard drive that shouldn't be executed, malicious
>ActiveX controls, java applets, etc, that you don't want users writing to
>the page.
>
>But for administration used by only trusted people, it's actually pretty
>simple to put together. For use by people who aren't trusted...
>
>
>--
>Plutarck
>Should be working on something...
>..but forgot what it was.
>
>
>""Romulo Roberto Pereira"" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hello,
> >
> > I was wondering if anybody have developed something related to dynamic web
> > pages building and administration. I need to store the content of the site
> > in the database and later as the user navigate, mount the content using
> > templates. This part is easy, since PHP is very powerfull in this area. My
> > problem would be to let the user modify the actual page content... how?
>any
> > ideas?
> >
> > TIA,
> >
> > Rom
> >
> >
> > --
> > 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]





Could anyone tell me if there is a easy way of detecting screen resolutions
in php,

Thanks.





PHP is server side, so it has no mthodology for detecting client side
information.

Try javascript.

-----Original Message-----
From: Stuart Rees [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 4:05 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Screen Resolutions


Could anyone tell me if there is a easy way of detecting screen resolutions
in php,

Thanks.


--
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 Mié 18 Abr 2001 00:15, Michael Geier wrote:
> PHP is server side, so it has no mthodology for detecting client side
> information.

This is half true. It is server side, but remember that the browser sends 
information about the client.
Of course, not the resolution! ;-)

> Try javascript.

This is a very good idea!

Saludos... :-)

-- 
El mejor sistema operativo es aquel que te da de comer.
Cuida tu dieta.
-----------------------------------------------------------------
Martin Marques                  |        [EMAIL PROTECTED]
Programador, Administrador      |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------




<script language=javascript type="TEXT/JAVASCRIPT">
<!--
widthvar = screen.width
heightvar = screen.height
// -->
</script>

or something like that


"Martín Marqués" <[EMAIL PROTECTED]> wrote in message
01041718172501.16385@bugs">news:01041718172501.16385@bugs...
> On Mié 18 Abr 2001 00:15, Michael Geier wrote:
> > PHP is server side, so it has no mthodology for detecting client side
> > information.
>
> This is half true. It is server side, but remember that the browser sends
> information about the client.
> Of course, not the resolution! ;-)
>
> > Try javascript.
>
> This is a very good idea!
>
> Saludos... :-)
>
> --
> El mejor sistema operativo es aquel que te da de comer.
> Cuida tu dieta.
> -----------------------------------------------------------------
> Martin Marques                  |        [EMAIL PROTECTED]
> Programador, Administrador      |       Centro de Telematica
>                        Universidad Nacional
>                             del Litoral
> -----------------------------------------------------------------
>
> --
> 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]
>






"Boget, Chris" <[EMAIL PROTECTED]> wrote:
> We compiled PHP to be used as a CGI and it's
> working great.  However, whenever we run a
> php script, the following message gets outputted
> at the start of the output:
> 
> "X-Powered-By: PHP/4.0.3pl1
> Content-type: text/html"
> 
> Is there any way we can suppress that message?

In php.ini change:

expose_php = On

to

expose_php = Off

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/





Hello,

I am having problems compiling truetype font support into php4.
Would someone please share any info that might help solve this?

setup:
php version 4.0.6-dev
apache 1.3.14

configuration:
./configure --with-ttf=/usr/local --enable-gd-native-ttf
--with-gd=/usr/local/src/gd-1.8.3 --with-jpeg-dir=/usr/local/src/jpeg-6b
--with-apxs=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql
--with-ming=/usr/local/src/ming-0.1.0 --enable-ftp
--with-pdflib=/usr/local/src/pdflib-3.03
--with-dom=/usr/local/src/libxml2-2.3.6
--with-zlib-dir=/usr/local/src/zlib --with-png-dir=/usr/local/src/libpng
--with-tiff-dir=/usr/local/src/tiff-v3.5.5/
--with-mcrypt=/usr/local/src/libmcrypt-2.4.9

Going through the results of a make show that php wasn't compiled with
-lttf .

Also, if more info is needed to help me with this problem please let me
know.

Thanks,
barce




HI
I have been corrected b4 but I compiled gd with truetype support and it 
works fine. I think you have to edit the gd Makefile.
Then delete the php config.cache and re run configure
Tom
At 11:47 PM 17/04/01 +0200, barce wrote:
>Hello,
>
>I am having problems compiling truetype font support into php4.
>Would someone please share any info that might help solve this?
>
>setup:
>php version 4.0.6-dev
>apache 1.3.14
>
>configuration:
>./configure --with-ttf=/usr/local --enable-gd-native-ttf
>--with-gd=/usr/local/src/gd-1.8.3 --with-jpeg-dir=/usr/local/src/jpeg-6b
>--with-apxs=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql
>--with-ming=/usr/local/src/ming-0.1.0 --enable-ftp
>--with-pdflib=/usr/local/src/pdflib-3.03
>--with-dom=/usr/local/src/libxml2-2.3.6
>--with-zlib-dir=/usr/local/src/zlib --with-png-dir=/usr/local/src/libpng
>--with-tiff-dir=/usr/local/src/tiff-v3.5.5/
>--with-mcrypt=/usr/local/src/libmcrypt-2.4.9
>
>Going through the results of a make show that php wasn't compiled with
>-lttf .
>
>Also, if more info is needed to help me with this problem please let me
>know.
>
>Thanks,
>barce
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]





Hi i send one question

how i can execute two or more stored procedured?

example 

$first_procedure = odbc_exec($conn,"execute sp_list
$quantity"); 

$second_procedure = odbc_exec($conn,"execute
sp_list_names $last_name"); 

how i use values of $second_procedure

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




i'm not sure what you're asking. maybe this?

$result = odbc_exec($conn, "execute" . odbc_exec($conn,"execute sp_list
$quantity") . $last_name);

// I don't know much about odbc api, but that's how you execute a func in a
func


"Juan Andres" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi i send one question
>
> how i can execute two or more stored procedured?
>
> example
>
> $first_procedure = odbc_exec($conn,"execute sp_list
> $quantity");
>
> $second_procedure = odbc_exec($conn,"execute
> sp_list_names $last_name");
>
> how i use values of $second_procedure
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






I found out today after suffering from minor headaches and hair loss that if
you have functions defined in and outside file name 'foo.php', and in those
functions you use cookies, you must pass those cookies to the function
called. I tried using a value from a cookie in a function and it never could
access it unless I passed it. Funny
--
Patrick Hanna
Database integration--E-commerce solutions
The Wentworth Company





On 17-Apr-01 Pat Hanna wrote:
> I found out today after suffering from minor headaches and hair loss that if
> you have functions defined in and outside file name 'foo.php', and in those
> functions you use cookies, you must pass those cookies to the function
> called. I tried using a value from a cookie in a function and it never could
> access it unless I passed it. Funny

function my_func() {
  global $cookie; // ?

  if ($cookie == "thin mint")
     call_girl_scout();
}

BTW, sometimes the hair does grow back.

-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.




To prevent further hair loss, realize that this is true for ALL variables declared
outside the function, including form variables and session variables. Either pass
them as parameters or use the 'global' declaration in the function, as Don did.

Don Read wrote:

> On 17-Apr-01 Pat Hanna wrote:
> > I found out today after suffering from minor headaches and hair loss that if
> > you have functions defined in and outside file name 'foo.php', and in those
> > functions you use cookies, you must pass those cookies to the function
> > called. I tried using a value from a cookie in a function and it never could
> > access it unless I passed it. Funny
>
> function my_func() {
>   global $cookie; // ?
>
>   if ($cookie == "thin mint")
>      call_girl_scout();
> }
>
> BTW, sometimes the hair does grow back.
>
> --
> Don Read                                       [EMAIL PROTECTED]
> -- It's always darkest before the dawn. So if you are going to
>    steal the neighbor's newspaper, that's the time to do it.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]






Check out "global" it allows you to make things "global" or at the top of your
file you could do a define with the cookie value in it an it would be accessbile
without passing the value to the function - this saves both time in typeing
and is faster since it doesn't have to copy the cookie value to a local variable
each time it is used in a function.

--Joe

On Tue, Apr 17, 2001 at 06:36:45PM -0400, Pat Hanna wrote:
> I found out today after suffering from minor headaches and hair loss that if
> you have functions defined in and outside file name 'foo.php', and in those
> functions you use cookies, you must pass those cookies to the function
> called. I tried using a value from a cookie in a function and it never could
> access it unless I passed it. Funny
> --
> Patrick Hanna
> Database integration--E-commerce solutions
> The Wentworth Company


/* Joe Stump
 * Sr. PHP Developer 
 * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net
 */





Dean Hall wrote

> Instead of 'array_push', do this:
> 
> $input[$key] = $val;
> 
Hey thanks dean that did the trick, I was trying:

$array[] = $key . "=>" . $val

which of course doesn't work hehe.

Regards

Joseph







Uh oh.  Thats gonna go to my head.
--
phill

""Jason Caldwell"" <[EMAIL PROTECTED]> wrote in message
9bf94i$90r$[EMAIL PROTECTED]">news:9bf94i$90r$[EMAIL PROTECTED]...
> Many THANKS!
>
> I find this newsgroup to be one of the *best* I've come across!  Responses
> are quick, usually detailed and always right on target...
>
> You guys and gals rock!
>
> Jason
>
>
>
>
> --
> 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]
>





How would I word a query to see what tables exist in a db that begin with
box

for example include
boxTABLE1
boxTABLE2
boxTABLE3
but exclude
sphereTABLE1

I'm basically trying lo populate a list box with the tables beginning with
box in PHP.

Matt "Trollboy" Wiseman
www.shoggoth.net/trollboy/trollboy.jpg
[EMAIL PROTECTED]
"I wish the world had one throat!!"
-Al Bundy

---------------------------------------------------------
Please do not resell my e-mail address
to anyone or send me unsolicited e-mail
---------------------------------------------------------





"Matt "TrollBoy" Wiseman" <[EMAIL PROTECTED]> wrote:
> How would I word a query to see what tables exist in a db that begin with
> box
>
> for example include
> boxTABLE1
> boxTABLE2
> boxTABLE3
> but exclude
> sphereTABLE1
>
> I'm basically trying lo populate a list box with the tables beginning with
> box in PHP.

Use the SHOW TABLES command within PHP and loop through the results and grab
those that match your criteria.  Or use PHP directory functions (readdir and
associated functions) or a system ls function within backticks (like `ls -1
$prefix*`) to read the files within the directory containing the database.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/






On 17-Apr-01 Matt \"TrollBoy\" Wiseman wrote:
> How would I word a query to see what tables exist in a db that begin with
> box
> 
> for example include
> boxTABLE1
> boxTABLE2
> boxTABLE3
> but exclude
> sphereTABLE1
> 
> I'm basically trying lo populate a list box with the tables beginning with
> box in PHP.
> 

mysql> show tables;
+-----------------+
| Tables_in_cache |
+-----------------+
| admh020         |
| ctl             |
| hs021132        |
| pending         |
| signc           |
| signd           |
| tmpc            |
| tmpd            |
| trnc            |
| trnd            |
+-----------------+
10 rows in set (0.02 sec)

mysql> show tables like 'tmp%';
+------------------------+
| Tables_in_cache (tmp%) |
+------------------------+
| tmpc                   |
| tmpd                   |
+------------------------+
2 rows in set (0.02 sec)

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.




In MySQL you can do this:

$sql = "SHOW TABLES LIKE 'box%'";
$r = mysql_query($sql);

// then loop through the tables and populate

--Joe


On Tue, Apr 17, 2001 at 07:49:11PM -0400, Matt TrollBoy Wiseman wrote:
> How would I word a query to see what tables exist in a db that begin with
> box
> 
> for example include
> boxTABLE1
> boxTABLE2
> boxTABLE3
> but exclude
> sphereTABLE1
> 
> I'm basically trying lo populate a list box with the tables beginning with
> box in PHP.
> 
> Matt "Trollboy" Wiseman
> www.shoggoth.net/trollboy/trollboy.jpg
> [EMAIL PROTECTED]
> "I wish the world had one throat!!"
> -Al Bundy
> 
> ---------------------------------------------------------
> Please do not resell my e-mail address
> to anyone or send me unsolicited e-mail
> ---------------------------------------------------------
> 
> 
> -- 
> 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]


/* Joe Stump
 * Sr. PHP Developer 
 * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net
 */





Guys,

I've admitted defeat and set up a Redhat 6.0 box which runs the web site and
talks to the SCO server as a database server. I'm doing this for a large client
who wants a "Business Card Generator" on his site and PDF seems to be the best
way to go as the printer wants a PDF file with the info to print on his shells
(pre-printed sheets).

Tried to make this work about a year ago, PHP on Redhat talking to an Informix
database on SCO, and failed miserably. Took about 15 minutes this time - I read
the error messages!

The secret was that, even though DBPATH was set on the SCO machine it wasn't
being read by the Linux box. I modified the connect statement to the db to
include the DBPATH - hey presto!

$dbh = ifx_connect("/dbpath/dbname@dbserver", "userid", "password");

Performance is pretty good as well.

For this client this is actually the optimum solution, the SCO box was running a
National e-commerce solution and acting as a dbserver for his internal sales
organisation as well. This takes the load off the SCO box and probably provides
some extra security as well.

If you would like more info let me know.

Chris

Paul Gardiner wrote:

> Hello again Dean, Chris,
>
> Snap I'm afraid. I didn't spend too much time on it but it's on the list of
> things to do. If I manage to get any further I'll let you know.
>
> If this is urgent though Chris, let me know your exact configure/build
> procedure and which versions you're using of the tiff, jpeg etc and also how
> you built these. As there's not as many of us on SCO it maybe better if we
> put our heads together to get it sorted - you know what they say :o)
>
> Best regards,
> - Paul -
>
> ----- Original Message -----
> From: "Grimes, Dean" <[EMAIL PROTECTED]>
> To: "'Chris Fry'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, April 17, 2001 1:36 PM
> Subject: RE: [PHP] PHP4.0.4pl1+PdfLib3.03+SCO
>
> > I had the exact same problem.... Haven't had time to work it though.
> >
> > -----Original Message-----
> > From: Chris Fry [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, April 16, 2001 3:26 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] PHP4.0.4pl1+PdfLib3.03+SCO
> >
> >
> > Pdflib 3.03 compiles OK and builds a static library -
> > /usr/local/lib/libpdf.a.
> >
> > PHP fails to configure - cannot find PDF_show_boxed in the library -
> > pdflib extension requires pdflib 3.x.
> >
> > This command is in the library and the header file. Configure finds my
> > tiff & jpeg library (--with-tiff-dir=/usr/local
> > --with-jpeg-dir=/usr/local) but is either not finding the library
> > (--with-pdflib=/usr/local) or is not able to find PDF_show_boxed in the
> > library.
> >
> > Can anyone help??
> >
> > Chris
> >
> > --
> > Chris Fry
> > Quillsoft Pty Ltd
> > Specialists in Secure Internet Services and E-Commerce Solutions
> > 10 Gray Street
> > Kogarah
> > NSW  2217
> > Australia
> >
> > Phone: +61 2 9553 1691
> > Fax: +61 2 9553 1692
> > Mobile: 0419 414 323
> > eMail: [EMAIL PROTECTED]
> > http://www.quillsoft.com.au
> >
> > You can download our Public CA Certificate from:-
> > https://ca.secureanywhere.com/htdocs/cacert.crt
> >
> > **********************************************************************
> >
> > This information contains confidential information intended only for
> > the use of the authorised recipient.  If you are not an authorised
> > recipient of this e-mail, please contact Quillsoft Pty Ltd by return
> > e-mail.
> > In this case, you should not read, print, re-transmit, store or act
> > in reliance on this e-mail or any attachments, and should destroy all
> > copies of them.
> > This e-mail and any attachments may also contain copyright material
> > belonging to Quillsoft Pty Ltd.
> > The views expressed in this e-mail or attachments are the views of
> > the author and not the views of Quillsoft Pty Ltd.
> > You should only deal with the material contained in this e-mail if
> > you are authorised to do so.
> >
> > This notice should not be removed.
> >
> >
> >
> > --
> > 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]
> >
> >

--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

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

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

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

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.






Had the same issues - frames is definitely the way to go.

One problem, Acrobat uses the available window space to display the pdf file. I
am displaying a small, business card size, pdf and acrobat is displaying at 175%
because it can. Does anyone know of a parameter that can be set to force display
at 100%.

Chris

Henrik Johansson wrote:

> Hi alexis.
>
> Yes, with Internet Explorer equipped with the shell-integration component in
> a Windows
> environment, this is possible with the Adobe Acrobat plugin.
> For Netscape, this is not currently (to my knowledge) an option.
> Further, to display a pdf-document in only a part of IE, the easiest way, i
> guess, would be
> to use frames as a base for Your HTML/PHP-documents.
>
> Best Regards,
> Henrik Johansson!
>
> > ----------
> > From:         Alexis Antonakis[SMTP:[EMAIL PROTECTED]]
> > Reply To:     [EMAIL PROTECTED]
> > Sent:         den 17 april 2001 11:32
> > To:   Php-General@Lists. Php. Net
> > Subject:      [PHP] 'Embedding' a PDF file
> >
> > Hi,
> >
> > I've got a couple of questions relating to PDF files.
> >
> > Firstly, to display a PDF file in your browser, I presume that you must
> > have
> > a 'plug-in' installed?
> >
> > Secondly, is it possible to display a PDF file within a table, as I have
> > only ever seen them fill up the entire browser?
> >
> > TIA
> > Alexis
> >
> >
> > --
> > 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]
> >

--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

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

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

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

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.






This question has not much with PHP, but I work with PHP...

Can I get the data from a table in MySQL and copy/transfer all data to
other database to a table with the same name?

regards,

Augusto Cesar Castoldi





Hi:
The easiest way to do it is using mysqldump. mysqldump creates a file
that contains SQL statements to reconstruct a database, which you can
easily execute on the other database. It will create tables with same
names and all the records will be copied, too.

Seung-woo Nam

Augusto Cesar Castoldi wrote:
> 
> This question has not much with PHP, but I work with PHP...
> 
> Can I get the data from a table in MySQL and copy/transfer all data to
> other database to a table with the same name?
> 
> regards,
> 
> Augusto Cesar Castoldi
>




> Can I get the data from a table in MySQL and copy/transfer all data to
> other database to a table with the same name?
> 

Assuming that both databases are on the same server and that you have created the 
empty table in the second database:

mysql

> INSERT INTO DATABASE2.TABLENAME SELECT * FROM DATABASE1.TABLENAME

I don't know what the implications are for large tables, possibly use mysqldump 
utility instead.

Regards

Grant Walters
Brainbench 'Most Valuable Professional' for Unix Admin
Walters & Associates, P O Box 13-043 Johnsonville, Wellington, NEW ZEALAND
Telephone: +64 4 4765175, CellPhone 025488265, ICQ# 23511989 





There are a few ways to do this...

1.) Copy the binary files over in the mysql data directory ... have to be root
    and normally at a shell.

2.) SELECT * FROM table and then while() you have rows INSERT INTO other_table
    those values

3.) mysqldump can be used via PHP and used by most users ...

hope this helps ...

--Joe

On Tue, Apr 17, 2001 at 09:05:02PM -0300, Augusto Cesar Castoldi wrote:
> This question has not much with PHP, but I work with PHP...
> 
> Can I get the data from a table in MySQL and copy/transfer all data to
> other database to a table with the same name?
> 
> regards,
> 
> Augusto Cesar Castoldi
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


/* Joe Stump
 * Sr. PHP Developer 
 * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net
 */





#3 is the easiest...

from command line:

#   mysqldump -uroot db_from > db.sql
#   mysql -uroot db_to < db.sql

Now, the entire database was copied.

This is the easiest way for the whole database. With single table it is
quite similar.
Also if the table in db_to already exists, then it might make more sense a
loop in PHP to reinsert the staff under your own conditions.


Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-----Original Message-----
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 10:48 AM
To: Augusto Cesar Castoldi
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] MySQL data


There are a few ways to do this...

1.) Copy the binary files over in the mysql data directory ... have to be
root
    and normally at a shell.

2.) SELECT * FROM table and then while() you have rows INSERT INTO
other_table
    those values

3.) mysqldump can be used via PHP and used by most users ...

hope this helps ...

--Joe

On Tue, Apr 17, 2001 at 09:05:02PM -0300, Augusto Cesar Castoldi wrote:
> This question has not much with PHP, but I work with PHP...
> 
> Can I get the data from a table in MySQL and copy/transfer all data to
> other database to a table with the same name?
> 
> regards,
> 
> Augusto Cesar Castoldi
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


/* Joe Stump
 * Sr. PHP Developer 
 * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.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]




This is an issue to do with IE cacheing the page too aggressively.

Add this to local.inc in your extended session class.

Someone contributed this to the list sometime ago, I'm sorry I don't have
their name to give them credit so I'll just say Thanks! and pass it along
myself.

BTW this is great for development; you may want to switch back to the
default cache handling once the site is online.

 var $allowcache = "iehack";

   function put_headers() {
    # Allowing a limited amount of caching, as suggested by
    # Padraic Renaghan on [EMAIL PROTECTED]
    #
    # Note that in HTTP/1.1 the Cache-Control headers override the Expires
    # headers and HTTP/1.0 ignores headers it does not recognize (e.g,
    # Cache-Control). Mulitple Cache-Control directives are split into
    # mulitple headers to better support MSIE 4.x.
    #
    # Added pre- and post-check for MSIE 5.x as suggested by R.C.Winters,
    # see
http://msdn.microsoft.com/workshop/author/perf/perftips.asp#Use%20Cache-Cont
rol%20Extensions
    # for details
    switch ($this->allowcache) {

      case "passive":
        $mod_gmt = gmdate("D, d M Y H:i:s", getlastmod()) . " GMT";
        header("Last-Modified: " . $mod_gmt);
        # possibly ie5 needs the pre-check line. This needs testing.
        header("Cache-Control: post-check=0, pre-check=0");
      break;

      case "public":
        $exp_gmt = gmdate("D, d M Y H:i:s", time() +
$this->allowcache_expire * 60) . " GMT";
        $mod_gmt = gmdate("D, d M Y H:i:s", getlastmod()) . " GMT";
        header("Expires: " . $exp_gmt);
        header("Last-Modified: " . $mod_gmt);
        header("Cache-Control: public");
        header("Cache-Control: max-age=" . $this->allowcache_expire * 60);
      break;

      case "private":
        $mod_gmt = gmdate("D, d M Y H:i:s", getlastmod()) . " GMT";
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
        header("Last-Modified: " . $mod_gmt);
        header("Cache-Control: private");
        header("Cache-Control: max-age=" . $this->allowcache_expire * 60);
        header("Cache-Control: pre-check=" . $this->allowcache_expire * 60);
      break;

   case "iehack":
  header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
  header("Cache-Control: no-cache");
  header("Cache-Control: post-check=0,pre-check=0");
  header("Cache-Control: max-age=0");
  header("Pragma: no-cache");
   break;

      default:
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
        header("Cache-Control: no-cache");
        header("Cache-Control: post-check=0, pre-check=0");
        header("Pragma: no-cache");
      break;
    }

Matt Friedman
Spry New Media
http://www.sprynewmedia.com



----- Original Message -----
From: "Paul Cusack" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 17, 2001 10:33 AM
Subject: [phplib] Sessions in windows


> I have just installed phplib on my Windows ME and have used the test files
> for session management and everything appears to be working fine except
the
> Per Session Data counter does not increase when I reload the page.
>
> The strange thing is though that if I edit the php source code and then
> reload the page the counter increase to the correct number.
>
> Any ideas?
>
> PC
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>





Thanks!  :)






ok this doesn't work either I get the same cache error.  anybody have any
other suggestions?

Randy

-----Original Message-----
From: Phil Driscoll [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 12:48 PM
To: Randy Johnson; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] temp file help


Instead of:
header("Content-disposition: filename=backup.csv");
try
header('Content-Disposition: attachment; filename=backup.csv');

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



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

I'm trying to write a CGI PHP script which should do nothing, but print one
line.  PHP is in /usr/bin/php.  The script I've made is:

#!/usr/bin/php
<?php
echo "42";
?>

When I run this script (called »ez«) form the commandline, I get the
expected output, ie.:

[alex@www cgi-bin]$ ./ez 
X-Powered-By: PHP/4.0.4
Content-type: text/html

42

But when I run the script via a browser, like http://localhost/cgi-bin/ez, I
get an internal server error and in apache's error log the line "Premature
end of script headers"


What am I doing wrong, what have I forgotten, and how to do it right?

Thanks,
Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 1 day 2 hours 23 minutes




I am calling the following php script from an HTML form with
<form name="comment_form" method="post" action="php/comment_form.php">

In Internet Exploder 5.0 it processes the form, sends the message and
commits to the database, but does not return to the referring page.

In Netscape 4.77 it displays an error message the document contained
no data even though it processes the form, sends the message and
commits to the database.

I would appreciate any insight on how to resolve this problem.

Thanks,

Jack


<?

$form_date = date("Y-m-d");
$form_time = date("H:i:s");

if (isset ($submit_form)) {

    // Define Mail Variables
    //
    $mailTo = "[EMAIL PROTECTED], $form_email";
    $mailSubject = "Message Subject";
    $mailHeaders = "From:  $form_email";
    $mailBody = "The following comment was submitted:\n\n";
    $mailBody .= "Date:   $form_date\n";
    $mailBody .= "Time:   $form_time\n\n";
    $mailBody .= "By:     $form_name\n";
    $mailBody .= "        $form_address1\n";
    $mailBody .= "        $form_address2\n";
    $mailBody .= "        $form_city, $state   $zip\n";
    $mailBody .= "        $form_country\n\n";
    $mailBody .= "E-mail: $form_email\n";
    $mailBody .= "Phone:  $form_phone\n\n";
    $mailBody .= "$form_comments\n";
    mail($mailTo, $mailSubject, $mailBody, $mailHeaders);


    // Connect to MySQL and store the collected information in the
database.
    //
    mysql_connect( "localhost", "uid", "pwd");
        $query = "INSERT INTO comments VALUES
        ('$form_id',
         '$form_date',
         '$form_time',
         '$form_name',
         '$form_address1',
         '$form_address2',
         '$form_city',
         '$form_state',
         '$form_zip',
         '$form_country',
         '$form_email',
         '$form_phone',
         '$form_comments')";
    $result = mysql_db_query( "bbleisurepark", $query) OR
die(mysql_error());

    if ($result) {
        // Add success-error messages here....
    }
}
?>




I can't be sure without seeing everything, but you've most likely done
everything correct except for the post-processing HTML output...in other
words, if you're sending info to a php script, you have to output some HTML
at the end of the processing that gives the correct HTML layout and says for
instance "success"...or, as I often do, send the info to $PHP_SELF, and at
the end of the mail and database calls print out the HTML skeleton with a
success message...as it stands right now, it sounds like you're sending it
to a script, and expecting it to go somewhere afterwards which is
incorrect...you have to do something after you process the info...
best of luck,
jack

-----Original Message-----
From: Jack Lauman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 8:47 PM
To: php-general
Subject: [PHP] Form Processing problem....


I am calling the following php script from an HTML form with
<form name="comment_form" method="post" action="php/comment_form.php">

In Internet Exploder 5.0 it processes the form, sends the message and
commits to the database, but does not return to the referring page.

In Netscape 4.77 it displays an error message the document contained
no data even though it processes the form, sends the message and
commits to the database.

I would appreciate any insight on how to resolve this problem.

Thanks,

Jack


<?

$form_date = date("Y-m-d");
$form_time = date("H:i:s");

if (isset ($submit_form)) {

    // Define Mail Variables
    //
    $mailTo = "[EMAIL PROTECTED], $form_email";
    $mailSubject = "Message Subject";
    $mailHeaders = "From:  $form_email";
    $mailBody = "The following comment was submitted:\n\n";
    $mailBody .= "Date:   $form_date\n";
    $mailBody .= "Time:   $form_time\n\n";
    $mailBody .= "By:     $form_name\n";
    $mailBody .= "        $form_address1\n";
    $mailBody .= "        $form_address2\n";
    $mailBody .= "        $form_city, $state   $zip\n";
    $mailBody .= "        $form_country\n\n";
    $mailBody .= "E-mail: $form_email\n";
    $mailBody .= "Phone:  $form_phone\n\n";
    $mailBody .= "$form_comments\n";
    mail($mailTo, $mailSubject, $mailBody, $mailHeaders);


    // Connect to MySQL and store the collected information in the
database.
    //
    mysql_connect( "localhost", "uid", "pwd");
        $query = "INSERT INTO comments VALUES
        ('$form_id',
         '$form_date',
         '$form_time',
         '$form_name',
         '$form_address1',
         '$form_address2',
         '$form_city',
         '$form_state',
         '$form_zip',
         '$form_country',
         '$form_email',
         '$form_phone',
         '$form_comments')";
    $result = mysql_db_query( "bbleisurepark", $query) OR
die(mysql_error());

    if ($result) {
        // Add success-error messages here....
    }
}
?>

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






Hey,

Why doesn't HTTP_POST_VARS work inside functions?

---somefile.php - forms action ---

function foo() {
       reset($HTTP_POST_VARS);
        while( list($key, $val) = each($HTTP_POST_VARS) ) {
                if ( $key != "Submit" xor $key != "x" xor  $key != "y" ) {
                 $input[$key] = $val;
                 }
       }
       return $input;
}

$input = foo();

---

I thought the above would work but it returns the following error(s):

...  value passed to reset is not an array or object ...
... value passed to each is not an array or object ...

It seems that HTTP_POST_VARS does not like being called from inside 
functions, as the above will work if not inside the function,  I thought 
that HTTP_POST_VARS was in the global scope (as of php 4.0.3 track-vars 
is always on) , so it should have no problem being called from anywhere?

Does anyone know what gives?

Regards,

Joseph






> I thought the above would work but it returns the following error(s):
>
> ...  value passed to reset is not an array or object ...
> ... value passed to each is not an array or object ...
>
> It seems that HTTP_POST_VARS does not like being called from inside
> functions, as the above will work if not inside the function,  I thought
> that HTTP_POST_VARS was in the global scope (as of php 4.0.3 track-vars
> is always on) , so it should have no problem being called from anywhere?
>
> Does anyone know what gives?

It is a normal global variable.  Like all other global variables you need
to declare the fact that you want the global variable inside a function.
Simply put: global $HTTP_POST_VARS; at the top of your function and it
will work just fine.

Read the section on variable scope in the PHP documentation.

-Rasmus





Rasmus Lerdorf wrote:

> It is a normal global variable.  Like all other global variables you need
> to declare the fact that you want the global variable inside a function.
> Simply put: global $HTTP_POST_VARS; at the top of your function and it
> will work just fine.
> 
> Read the section on variable scope in the PHP documentation.


Thanks Rasmus,

I should really be tarred and feathered eh :-)

Joseph






Greetings, 

This is a mysql question, (but I'm using php with it).

Most everything is working correctly; however, when 
I hit one button I get: 
Database error: cannot use database xxxxxx
MySQL Error: 0 ()
Session halted.

What should I be looking for?  Is this a user/password
problem?  Is this a GRANT problem?

Any help here would be appreciated.

Thanks!




Max Pyziur                                     BRAMA - Gateway Ukraine
[EMAIL PROTECTED]                                  http://www.brama.com/




http://asp2php.naken.cc/

Haven't been there, haven't done that, BUT, I do have the t-shirt!
-- 
-----------------------------------------------------------------
Look lovingly upon the present,
for it holds the only things that are forever true.
-----------------------------------------------------------------
                                Sincerely, Dennis Gearon (Kegley)




I'm blind!!
Whats wrong here? $besk has a value at one place but not in another?

Jeez ....

M.

 $besk=$row1[0];
 print "beskr $besk"; <-- prints value of $besk

 print "        <td><input type='text' name='txteItem' size='20' maxlength='20' 
value='".$eItem."'></td>"; <-- works
        print "   <td><input type='text' name='txteDesc' size='50' maxlength='50 
value='".$besk."'></td>"; <-- DOES NOT PRINT A THING!!
       print "  <td><input type='text' name='txtePrice' size='10' 
maxlength='10' value='".$row['s_price']."'></td>"; <-- works
      print "   <td><input type='text' name='txteQuant' size='10' 
maxlength='10' value='".$row['s_stock_quantity']."'></td>"; <--works




You're missing a single quote after the value of MAXLENGTH on the line 
that's not working...  Maybe that's the problem.

-- 

[ Swift eNetwork ] Matrix
>>>>> http://matrix.swifte.net/

--




[EMAIL PROTECTED] wrote:

> You're missing a single quote after the value of MAXLENGTH on the line
> that's not working...  Maybe that's the problem.
> 

Yes!!
Thanks! I thought I was going crazy.

Martin S.




How do I get the last 10 rows in a table?

thanks

randy






In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("Randy Johnson") wrote:

> How do I get the last 10 rows in a table?

{select clause} order by {fieldname} desc limit 10

-- 
CC




> How do I get the last 10 rows in a table?

select blah from foo order by something desc limit 10

-Rasmus





Well - what is considered the last of the list? Is it a number? are they names?

Either way  you have a field you are ordering by ...

SELECT * FROM table ORDER BY lastname DESC LIMIT 10;

that'll do the trick. FYI you can sort numbers, dates, and chars - this is from
the hip and you might be able to do others ...

--Joe


On Mon, Apr 16, 2001 at 11:53:12PM -0700, Randy Johnson wrote:
> How do I get the last 10 rows in a table?
> 
> thanks
> 
> randy
> 
> 
> 
> -- 
> 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]


/* Joe Stump
 * Sr. PHP Developer 
 * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net
 */





Hi Everyone,

Ive been asked to do a task here at my work and its something ive never 
done before. I was hoping you guys could point me in the right direction so 
I can research some more and discover how in the hell im gonna do this :)

Basically, I have been issued a TAB delimited text file which I need to 
process and insert all the data into a table. Here is a basic example of 
what I need to do..........

Say the text file had the following lines (thousands of them, 1 record per 
line)

Screw   Big     12      200     1.99
Screw   Big     10      400     1.50

And I wanted to import each line into a table (Mysql DB) that had 6 fields 
(5 for each of the above plus an autoincremented ID field

stock_id
stock_name
stock_desc
stock_length
stock_qty
stock_price


Any suggestions and direction pointing will be greatly appreciated.




--
       Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628 8888  fax: +61 2 4628 8890
             --------------------------------------------

       Unix -- because a computer's a terrible thing to waste!





Chris,

What you need to do is read each line of the file into an array:

$aryInput = file("/path/filename", "r");

Connect to the Database:

$dbh = mysql_connect ("localhost", "user", "password");
 if (! $dbh) {
  print "Error connecting to the Database Engine<br>";
 }

Select the table:

mysql_select_db (stock);

Now process each line in turn:

for($i=0;$i<count($aryInput);$i++) {
    // Split each line into the fields you want
    $aryInputLine = explode("    ", $aryInputLine[$i]);
    // There is a TAB between the "    " on the previous line and this assumes
that there is only
    // one TAB between the fields
    $stock_id = $aryInputLine[0];
    $stock_name = $aryInputLine[1];
    $stock_desc = $aryInputLine[2];
    $stock_length = $aryInputLine[3];
    $stock_qty = $aryInputLine[4];
    $stock_price = $aryInputLine[5];
    // Now put your insert statement here
    $insstock = mysql_query ("INSERT INTO tablename (stock_name, stock_desc,
stock_length, stock_qty, stock_price) VALUES ('$stock_name', '$stock_desc',
$stock_length, $stock_qty, $stock_price)", $dbh);
}

This should get you started!

Chris Fry

Chris Aitken wrote:

> Hi Everyone,
>
> Ive been asked to do a task here at my work and its something ive never
> done before. I was hoping you guys could point me in the right direction so
> I can research some more and discover how in the hell im gonna do this :)
>
> Basically, I have been issued a TAB delimited text file which I need to
> process and insert all the data into a table. Here is a basic example of
> what I need to do..........
>
> Say the text file had the following lines (thousands of them, 1 record per
> line)
>
> Screw   Big     12      200     1.99
> Screw   Big     10      400     1.50
>
> And I wanted to import each line into a table (Mysql DB) that had 6 fields
> (5 for each of the above plus an autoincremented ID field
>
> stock_id
> stock_name
> stock_desc
> stock_length
> stock_qty
> stock_price
>
> Any suggestions and direction pointing will be greatly appreciated.
>
> --
>        Chris Aitken - Webmaster/Database Designer - IDEAL Internet
> email: [EMAIL PROTECTED]  phone: +61 2 4628 8888  fax: +61 2 4628 8890
>              --------------------------------------------
>
>        Unix -- because a computer's a terrible thing to waste!
>
> --
> 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]

--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

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

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

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

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.






Hey there guys,

    This may seem like a dumb question, but I have to ask it anyway.

I have a form in one of my php based scripts that allows for file uploads.
I recently noticed a potential issue if people upload files containing
anything else but the standard characters ([_a-z0-9-]+(\.[_a-z0-9-]).

    I am not sure if this can be done, but what I need to do is parse this
variable (lets call it $file_name) by character looking for anything save
letters a-z (A-Z) and numbers 0-9.  Any arrangements of numbers, letters and
full stops (.) are to be permitted, and if any character does not meet those
specifications, that single character should be converted to an underscore.

    Any ideas on how I can go about doing something like this?

BTW: (Some background info)  I examined the average validate e-mail idea,
however, rather than reject the string, I would like to be able to 'replace'
the offending character.

Thanks in advance,

Sean






$str = eregi_replace("[^[_a-z0-9-]]", '_', $str)

would this 2-seconds written-in, non-tested scratch of code do the job?

If not then something like this...

eregi_replace() is what you are looking for.



Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-----Original Message-----
From: Sean Coyle [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 2:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Is it possible to parse a variable by character?


Hey there guys,

    This may seem like a dumb question, but I have to ask it anyway.

I have a form in one of my php based scripts that allows for file uploads.
I recently noticed a potential issue if people upload files containing
anything else but the standard characters ([_a-z0-9-]+(\.[_a-z0-9-]).

    I am not sure if this can be done, but what I need to do is parse this
variable (lets call it $file_name) by character looking for anything save
letters a-z (A-Z) and numbers 0-9.  Any arrangements of numbers, letters and
full stops (.) are to be permitted, and if any character does not meet those
specifications, that single character should be converted to an underscore.

    Any ideas on how I can go about doing something like this?

BTW: (Some background info)  I examined the average validate e-mail idea,
however, rather than reject the string, I would like to be able to 'replace'
the offending character.

Thanks in advance,

Sean


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




[Cross post to php-lang] Regular expression functions can do the job and already have reply. Answer for the original question: How to access string by character. I'm not sure if accessing string as array is going to be depreciated or not. (Or is it already depreciated???) But you could do $str = 'abc'; for ($i = 0; $i < strlen($i); $i++) { echo $str[$i]; } It prints characters in string one by one. I also not sure behavior of following code is defined or not. (It's used to be undefined. You probably should not rely on this.) $str = 'abc'; $str[0] = 'X'; You may get $str = 'Xbc' or $str[0] = 'X'. Anyone knows current status on this??? Regards, -- Yasuo Ohgaki "Sean Coyle" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hey there guys, > > This may seem like a dumb question, but I have to ask it anyway. > > I have a form in one of my php based scripts that allows for file uploads. > I recently noticed a potential issue if people upload files containing > anything else but the standard characters ([_a-z0-9-]+(\.[_a-z0-9-]). > > I am not sure if this can be done, but what I need to do is parse this > variable (lets call it $file_name) by character looking for anything save > letters a-z (A-Z) and numbers 0-9. Any arrangements of numbers, letters and > full stops (.) are to be permitted, and if any character does not meet those > specifications, that single character should be converted to an underscore. > > Any ideas on how I can go about doing something like this? > > BTW: (Some background info) I examined the average validate e-mail idea, > however, rather than reject the string, I would like to be able to 'replace' > the offending character. > > Thanks in advance, > > Sean > > > -- > 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] >



if i perform a SELECT query (say) like the following:

SELECT email_addr FROM myTable WHERE x = 1

in this query i want to pull-out (or list) all email addresses where x
equals 1, however, suppose i don't want any duplicate email addresses...

would i use ORDER BY and COUNT(*) to get listing of non-duplicate email
addresses, and just ignore the COUNT() ?

Thanks.







> if i perform a SELECT query (say) like the following:
>
> SELECT email_addr FROM myTable WHERE x = 1
>
> in this query i want to pull-out (or list) all email
> addresses where x equals 1, however, suppose i don't want any
> duplicate email  addresses... would i use ORDER BY and COUNT(*) to
get listing
> of non-duplicate email addresses, and just ignore the COUNT() ?

You would use neither :) To get the distict email addressese you can
use

SELECT email_addr FROM myTable WHERE x = 1 GROUP BY email_addr

Check MySQL manual for SELECT options for more info.








Opps. I meant GROUP BY... and it looks like I don't need to include the
COUNT().

SELECT email_addr, x GROUP BY email_addr HAVING x = 1;

Is this the only way to display a listing without duplicates, or is there a
more efficient (faster) way?  I don't want to DELETE the duplicates, just
don't want dups to show up in my SELECT queries.

Thanks.
Jason



""Jason Caldwell"" <[EMAIL PROTECTED]> wrote in message
9bj9ld$pad$[EMAIL PROTECTED]">news:9bj9ld$pad$[EMAIL PROTECTED]...
> if i perform a SELECT query (say) like the following:
>
> SELECT email_addr FROM myTable WHERE x = 1
>
> in this query i want to pull-out (or list) all email addresses where x
> equals 1, however, suppose i don't want any duplicate email addresses...
>
> would i use ORDER BY and COUNT(*) to get listing of non-duplicate email
> addresses, and just ignore the COUNT() ?
>
> Thanks.
>
>
>
>
> --
> 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 18-Apr-01 Jason Caldwell wrote:
> Opps. I meant GROUP BY... and it looks like I don't need to include the
> COUNT().
> 
> SELECT email_addr, x GROUP BY email_addr HAVING x = 1;
> 
> Is this the only way to display a listing without duplicates, or is there a
> more efficient (faster) way?  I don't want to DELETE the duplicates, just
> don't want dups to show up in my SELECT queries.
> 
> Thanks.
> Jason
> 
> 

select distinct(email_addr) ...

-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.




Hi php'ers

Executing the following code on my Redhat 7.2 box, through Apache i
get the most annoying output:

Code:

function listDirectory($basedir){
  $diary_directory = opendir($basedir);
    while($filename = readdir($diary_directory)) {
      if(strcmp(".", $filename) != 0) {
        if(strcmp("..", $filename) != 0) {
          print("<br>$filename is \"");
          print filetype($filename)."\"";
        }
      }
    }
  closedir($diary_directory);
}
listDirectory(".");
   
Output (sample):
       index.php is ""                  (should be "file")
       Ansatte is ""                    (should be "dir")
       Produkter is ""                  (should be "dir")
       Kontorer is "dir"
       view.php3 is ""                  (should be "file")

       
What could possibly be the error?


Kind regards,
    Morten Winkler






On Wed, 18 Apr 2001 15:53, Morten Winkler Jørgensen wrote:
> Hi php'ers
>
> Executing the following code on my Redhat 7.2 box, through Apache i
> get the most annoying output:
>
> Code:
>
> function listDirectory($basedir){
>   $diary_directory = opendir($basedir);
>     while($filename = readdir($diary_directory)) {
>       if(strcmp(".", $filename) != 0) {

Here you need to prefix the full path ($basedir ?) to $filename, else the 
script will try to find the file in the current working directory.


>         if(strcmp("..", $filename) != 0) {
>           print("<br>$filename is \"");
>           print filetype($filename)."\"";
>         }
>       }
>     }
>   closedir($diary_directory);
> }
> listDirectory(".");
>
> Output (sample):
>        index.php is ""                  (should be "file")
>        Ansatte is ""                    (should be "dir")
>        Produkter is ""                  (should be "dir")
>        Kontorer is "dir"
>        view.php3 is ""                  (should be "file")
>
>
> What could possibly be the error?
>
>
> Kind regards,
>     Morten Winkler

-- 
David Robley                        | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet                            | http://auseinet.flinders.edu.au/
            Flinders University, ADELAIDE, SOUTH AUSTRALIA




this is really buggin me... i've got this free-for-all that i want to make, and 
everything seems logical, but....

echo "<form method=\"POST\" action=\"$PHP_SELF\" name=\"linkadd\">";
echo "<input type=\"text\" name=\"url\" size=\"20\" value=\"http://\"><br>";
echo "<input type=\"text\" name=\"text\" size=\"20\"><br>";
echo "<input type=\"submit\" name=\"submit\" value=\"Generate New Link\">";
echo "</form>";



if (isset($url) && isset($text)) {
    $fp = fopen("./file.txt", "w");
    fwrite("$fp", "<a href=\"$url\">$text</a><br>", "w");
    fclose($fp);
}

... that isn't writing anything to the file. any help would be appreciated. thx in 
advance




The topic says it, i was wondering if anyone had a how-to on suEXEC CGI
php. I have used the cgi before but havnt ever had the time to setup the
suEXEC. Wondering if there is a guide to save me going crazy.


Cameron



Reply via email to